Skip to content
BrainyShorts Docs
Esc
navigateopen⌘Jpreview

Open a TikTok or YouTube direct upload

MP4 only, up to 64 MiB. YouTube also requires the parent runner to send x-brainy-runner-key: ba_sk_....

POST/api/agent/runs/{id}/direct-upload
Authorization
AuthorizationBearer token (ba_run_...) · headerrequired

Per-run token returned by start, valid for 6 hours and bound to one run.

Path parameters
idstringrequired

Run id

Request body
requiredapplication/json
social_account_idstring<uuid>required
titlestringrequired
min length 1 · max length 100
descriptionstring
max length 2200
content_typestringrequired
content_lengthintegerrequired
max 67108864
content_sha256stringrequired
matches ^[a-f0-9]{64}$
content_md5string
matches ^[a-f0-9]{32}$
Responses
200

OK

sessionobject
401

RUN_TOKEN_REQUIRED or SOCIAL_TOKEN_EXPIRED

errorstringrequired
codestring
403

YOUTUBE_PARENT_RUNNER_REQUIRED

errorstringrequired
codestring
409

DIRECT_UPLOAD_CONFLICT

errorstringrequired
codestring
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://www.brainyshorts.com/api/agent/runs/string/direct-upload" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "social_account_id": "f4777757-36aa-48ee-b520-6e818e68eb51",
  "title": "string",
  "description": "string",
  "content_type": "video/mp4",
  "content_length": 67108864,
  "content_sha256": "string",
  "content_md5": "string"
}'
Response
{
  "session": {}
}