Skip to content
BrainyShorts Docs
Esc
navigateopen⌘Jpreview

Claim a queued run (legacy queue)

Atomically claims one pending run. {"run": null} means no work. The legacy queue publishes to Instagram only; new integrations should use local automations.

POST/api/agent/runs/claim
Authorization
AuthorizationBearer token (ba_sk_...) · headerrequired

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

Request body
application/json
automation_idstring
lease_secondsinteger
min 60 · max 3600 · default: 900
Responses
200

OK

runobject | null
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/agent/runs/claim" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "automation_id": "string",
  "lease_seconds": 900
}'
Response
{
  "run": {}
}