Create a post
If action is omitted, the post is scheduled when scheduled_at is present and published immediately otherwise. Send action: "draft" to create a draft. Publishing or scheduling to YouTube is not available through this endpoint; use an agent automation instead.
POST
/api/cli/postsAuthorization
AuthorizationBearer token (ba_sk_...) · headerrequiredAPI key from /dashboard/api-keys. Keys expire after 365 days.
Request body
requiredapplication/jsontitlestringDefaults to the first 120 characters of the caption
max length 120
captionstringrequiredX targets limit the caption to 280 characters
min length 1 · max length 2200
media_typestringInferred when omitted. image: 1 URL; carousel: 2+; video: 1 MP4.
Allowed:
imagecarouselvideomedia_urlsstring<uri>[]JSON array of HTTPS URLs, not a comma-separated string
max items 10
slidesSlide[]max items 10
Show propertiesHide properties
Array of
Slidetextstringmax length 500
urlstring<uri>requiredaspect_ratiostringdefault: "9:16"
targetsTarget[]max items 12
Show propertiesHide properties
Array of
Targetsocial_account_idstring<uuid>requiredplatformPlatformrequiredAllowed:
tiktokinstagramyoutubelinkedinxsettingsobjectactionstringAllowed:
draftpublishschedulescheduled_atstring<date-time>Required for schedule; must be in the future. scheduled_time is accepted as an alias.
project_idstring<uuid>Responses
201
Created
postobjectParent post
social_postsobject[]One delivery per target
400
Invalid post
errorstringissuesobject401
Missing, invalid, expired, or revoked API key
errorstringrequiredcodestring