Skip to content
BrainyShorts Docs
Esc
navigateopen⌘Jpreview

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/posts
Authorization
AuthorizationBearer token (ba_sk_...) · headerrequired

API key from /dashboard/api-keys. Keys expire after 365 days.

Request body
requiredapplication/json
titlestring

Defaults to the first 120 characters of the caption

max length 120
captionstringrequired

X targets limit the caption to 280 characters

min length 1 · max length 2200
media_typestring

Inferred when omitted. image: 1 URL; carousel: 2+; video: 1 MP4.

Allowed:imagecarouselvideo
media_urlsstring<uri>[]

JSON array of HTTPS URLs, not a comma-separated string

max items 10
slidesSlide[]
max items 10
Show properties
Array of Slide
textstring
max length 500
urlstring<uri>required
aspect_ratiostring
default: "9:16"
targetsTarget[]
max items 12
Show properties
Array of Target
social_account_idstring<uuid>required
platformPlatformrequired
Allowed:tiktokinstagramyoutubelinkedinx
settingsobject
actionstring
Allowed:draftpublishschedule
scheduled_atstring<date-time>

Required for schedule; must be in the future. scheduled_time is accepted as an alias.

project_idstring<uuid>
Responses
201

Created

postobject

Parent post

social_postsobject[]

One delivery per target

400

Invalid post

errorstring
issuesobject
401

Missing, invalid, expired, or revoked API key

errorstringrequired
codestring
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://www.brainyshorts.com/api/cli/posts" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "string",
  "caption": "string",
  "media_type": "image",
  "media_urls": [
    "http://example.com"
  ],
  "slides": [
    {
      "text": "string",
      "url": "http://example.com",
      "aspect_ratio": "9:16"
    }
  ],
  "targets": [
    {
      "social_account_id": "f4777757-36aa-48ee-b520-6e818e68eb51",
      "platform": "tiktok",
      "settings": {}
    }
  ],
  "action": "draft",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9"
}'
Response
{
  "post": {},
  "social_posts": [
    {}
  ]
}