目標賬號只找一次,之後想排多少就排多少。
已連接賬號在 API 裡是只讀的:它們只在後台連接一次,因為 OAuth 憑據絕不能離開服務器。列出它們,記住 id。
export AUTOSTUD_API_KEY="sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Read-only on purpose: accounts are connected from the dashboard,
# so the OAuth tokens never leave the server.
curl "https://autostud.ai/api/v1/social_accounts?status=active&limit=10" \
-H "Authorization: Bearer $AUTOSTUD_API_KEY"一個視頻、一個賬號、一個時刻和一段文案。調用返回的是排隊中的帖子,不是已發布的帖子,所以真實來源仍然是你自己的調度器。
curl -X POST https://autostud.ai/api/v1/actions/publishing.schedule_post \
-H "Authorization: Bearer $AUTOSTUD_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: lighthouse-ep12-tiktok" \
-d '{
"video_id": "0f4c8b71-2d95-47a3-9e6c-15b8ad7f3c20",
"account_id": "9a2c6f18-4b70-4d35-8e91-0f7d3c84b562",
"scheduled_at": "2026-08-21T18:30:00.000Z",
"caption": "Episode 12: the keeper who never slept #lighthouse"
}'按天分組讀日曆,按狀態過濾隊列,或者接住 post.published 然後不必再問。失敗也走同一條路,並附上原因。
curl -X POST https://autostud.ai/api/v1/actions/publishing.calendar \
-H "Authorization: Bearer $AUTOSTUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "from": "2026-08-17", "to": "2026-08-24" }'
# Need something more specific? The queue is a plain resource:
curl "https://autostud.ai/api/v1/scheduled_posts?status=error&platform=tiktok" \
-H "Authorization: Bearer $AUTOSTUD_API_KEY"四個字段。渲染好的文件、目標、時刻,以及文字。
video_id要發布的視頻。必须已經渲染:隊列發的是文件,不是時間軸。
account_id發往哪個已連接賬號。一帖一個目標,所以一次失敗絕不會拖垮其他。
scheduled_at什麼時候發出。平台允許的任何時間,包括立刻。
caption隨帖的文案。話題標籤和 @ 都裝在裡面,原樣發出。
日曆回答"這周有什麼要發",資源回答"這條視頻後來怎麼了"。兩者都可過濾,所以不用多加一個端點就能搭出後台。
GET /api/v1/social_accountsGET /api/v1/scheduled_postspublishing.calendar排期是承諾,不是結果。平台接受之後 post.published 才觸發;部分發布同樣觸發,此時負載裡帶著每個賬號的結果。
post.publishedpost.failed不能,這是刻意的。賬號在後台連接,好讓 OAuth 令牌永遠不離開服務器;API 能做的只是列出它們並向它們發布。
帖子留在隊列裡並標為錯誤狀態,post.failed 帶著原因觸發。不會在你背後悄悄重試。
可以:每個目標調用一次。分開發送意味著某個平台拒了文案,也不會把其余的一起取消。
publishing.calendar 返回兩個日期之間按天分組的計劃帖。想更細就按 status、platform 或 video_id 過濾 scheduled_posts 資源。