API Reference

The doublespeed REST API lets you list and manage posts, review and approve drafts, discover templates, clone videos, and run Hook + demo batches programmatically. Every endpoint is scoped to a single product through its API key.

Authentication

Generate a key from the API tab in your product dashboard, then send it in the Authorization header on every request:

Authorization: Bearer ds-your-api-key-here

The key determines the product scope. Endpoints ignore any product_id or userId sent in the query or body.

Posts

GET /api/v1/posts

List draft, scheduled or posted posts for your product.

ParameterRequiredDescription
statusYesdraft, scheduled, posted, or all
account_idNoFilter to a specific account (UUID)
page_sizeNoItems per page, default 20, max 100
pageNoPage number, default 1
date_from / date_toNoInclusive YYYY-MM-DD date filters

Responses are paginated (page, page_size, total_count, total_pages) and each post includes its status, account, caption, public post URL, and view/like/comment stats once live.

Every post also carries media, the files it posts: type (video or slideshow), video_url for a video or slide_urls in order for a slideshow, and a thumbnail_url. A slideshow's thumbnail is its first slide; a video's is a still frame up to 720 px on the long side, which can be null for a while on an older post until it is made in the background. The URLs are public and unsigned, so they do not expire. A post rendered again can get new files, so read media again rather than keeping an old URL.

curl -H "Authorization: Bearer ds-your-api-key-here" \
  "https://doublespeed.ai/api/v1/posts?status=posted&page_size=20"

The other post endpoints cover the rest of the lifecycle:

  • POST /api/posts/create creates a video or slideshow post in one multipart request: caption, files, target account (or randomAccount), optional music. The post takes the account's next open posting slot, or a slot on the day given as scheduledAt (YYYY-MM-DD), picked between 8 AM and 8 PM Pacific within the account's daily posting target. A day with no slot left answers 409 and the post is not created, so it never moves to another day. Every platform takes a day; TikTok accounts also take an exact time in that window. The response carries the locked scheduledAt, or estimatedScheduledAt while the post waits for a slot.
  • GET /api/v1/posts/queue lists each account's queued posts in firing order with each one's locked scheduled_at (or an estimated_at while it waits for a slot); POST /api/v1/posts/queue/reorder swaps the slots of the posts you name so they go out in the order you give.
  • PATCH /api/v1/posts/{post_id}/status moves a post between draft and scheduled. Scheduling places the post in the account's next available slot, or on the day sent as target_day (YYYY-MM-DD, any platform; a full day falls back to the next open slot). Sent with a review draft's id, scheduled approves the draft (see Review drafts).
  • DELETE /api/v1/posts/{post_id} removes a queued (scheduled) post. For live or pending posts, POST /api/v1/posts/{post_id}/deletion-request files a deletion request instead and marks the post delete_requested. Sent with a review draft's id, it declines the draft instead (see Review drafts).

POST /api/posts/create

Queue a video or slideshow on one account. The request is multipart/form-data.

FieldRequiredDescription
productIdYesYour product's ID: the UUID in your dashboard URL
accountUsernameYesTarget account username, without the @. Omit it when randomAccount is "true"
platformNoPlatform of the target account: tiktok (default), instagram, facebook or youtube
descriptionYesPost caption, hashtags included. At most 100 characters for a YouTube account (it becomes the Short's title) and 2,200 for a TikTok account; a longer caption returns 400
filesYesOne video file, or several image files for a slideshow
musicLinkNoA TikTok sound link or an Instagram audio link, or "auto" to keep the music the platform adds itself
scheduledAtNoA day to publish on (YYYY-MM-DD), on any platform, from today up to a year ahead. TikTok accounts also take an exact time. Omit it for the account's next open slot
aiGeneratedNoTikTok feed posts only. "true" turns on TikTok's AI-generated content label for this post and "false" leaves it off. Omit it to follow your organization's setting in Settings, under Posting. Only Android phones set the label
draftNo"true" saves a draft instead of queueing

productId is the UUID in your dashboard URL, the part right after the domain. In https://doublespeed.ai/123e4567-e89b-12d3-a456-426614174000/posts it is 123e4567-e89b-12d3-a456-426614174000. The request examples in the API tab of your product dashboard already have yours filled in. It has to be the product your API key belongs to; any other value returns 403.

One call creates one post on one account. The account is looked up by productId, platform and accountUsername, and platform defaults to tiktok, so a call never posts to every platform that has the username. To post to a TikTok account and an Instagram account that share a username, make two calls.

The music link has to come from the account's platform: a TikTok sound link (https://www.tiktok.com/music/...) for a TikTok account, an Instagram audio link (https://www.instagram.com/reels/audio/...) for an Instagram account. A link from the other platform returns 400.

TikTok account:

curl -X POST https://doublespeed.ai/api/posts/create \
  -H "Authorization: Bearer ds-your-api-key-here" \
  -F "productId=YOUR_PRODUCT_ID" \
  -F "accountUsername=myaccount" \
  -F "platform=tiktok" \
  -F "description=Caption here" \
  -F "musicLink=https://www.tiktok.com/music/original-sound-7xxxxxxxxxxxxxxxxxx" \
  -F "files=@video.mp4"

Instagram account with the same username:

curl -X POST https://doublespeed.ai/api/posts/create \
  -H "Authorization: Bearer ds-your-api-key-here" \
  -F "productId=YOUR_PRODUCT_ID" \
  -F "accountUsername=myaccount" \
  -F "platform=instagram" \
  -F "description=Caption here" \
  -F "musicLink=https://www.instagram.com/reels/audio/123456789012345/" \
  -F "files=@video.mp4"

POST /api/posts/create-from-urls takes the same fields as JSON, with videoUrl or imageUrls in place of files. The API tab in your product dashboard has the full field and error reference for both endpoints.

Schedule a post for a day

Every platform takes a posting day. Send scheduledAt as YYYY-MM-DD when you create the post, and it goes out that day at a time picked between 8 AM and 8 PM Pacific, within the account's daily posting target. TikTok accounts can also take an exact time in that window.

The day can be today or any day up to a year ahead: the last day you can pick is 364 days after today, counted in posting days that start at 5 AM Pacific. A day that is already over, or further out, answers 400 with scheduled_at_too_soon or scheduled_at_too_far (target_day_too_soon or target_day_too_far for target_day).

curl -X POST https://doublespeed.ai/api/posts/create-from-urls \
  -H "Authorization: Bearer ds-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "YOUR_PRODUCT_ID",
    "accountUsername": "myaccount",
    "platform": "instagram",
    "description": "Caption here",
    "videoUrl": "https://example.com/video.mp4",
    "scheduledAt": "2026-12-08"
  }'

The response's post.scheduledAt is the locked publish time, in UTC. If the account has no slot left that day, the call answers 409 and creates nothing, so the post never moves to another day:

{
  "success": false,
  "code": "scheduled_at_day_full",
  "error": "No open posting slot remains on 2026-12-08 for this account: ..."
}

To put a draft you already created on a day, send target_day with the status change. Here a full day does not fail: the post takes the account's next open slot and the response carries day_unavailable: true.

curl -X PATCH "https://doublespeed.ai/api/v1/posts/POST_ID/status" \
  -H "Authorization: Bearer ds-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{ "status": "scheduled", "target_day": "2026-12-08" }'

Post outcome webhooks

Instead of polling, register signed webhooks through /api/v1/webhooks (GET, POST, and PATCH/DELETE on /api/v1/webhooks/{webhook_id}). Up to 5 endpoints per product receive post.succeeded and post.failed the moment an outcome is known, and post.linked once the live post URL exists. The embedded post object matches GET /api/v1/posts items. Each endpoint keeps a paginated delivery history (GET /api/v1/webhooks/{webhook_id}/deliveries) with per-delivery resend, plus a POST /api/v1/webhooks/{webhook_id}/test event. Failed deliveries retry with backoff for up to 7 attempts; each delivery is signed with an x-doublespeed-signature header. Endpoints can also subscribe to draft.ready (a review draft appears) and draft.replaced (a draft gets a new version, with previous_version_id); name them in subscribed_events, since an endpoint created without a list gets the post events only. Their draft object matches GET /api/v1/drafts items.

Review drafts

Review drafts are the slideshows and videos on your Drafts page and review links that have not been posted yet. Read them, show their media, then approve or decline each one by its id. One draft is one variant: a draft group with three variants is three drafts.

GET /api/v1/drafts

ParameterRequiredDescription
statusNoopen (default): not queued and not declined. queued: approved into a post. all: every draft, declined ones included
account_idNoOnly drafts assigned to this account (UUID)
page_sizeNoItems per page, default 20, max 50
pageNoPage number, default 1

Drafts come newest first. Each one has its id, draft_group_id, version_id (it changes whenever the draft is edited, so key any cache on it), type, review_status, caption, account, post_id once approved, media_status and media (the same object as a post's). GET /api/v1/drafts/{draft_id} returns one draft and renders anything it is missing before answering, so the first read of a new version can take several seconds, or one to four minutes for a video with on-screen text.

media_status says what exists yet:

  • ready: media holds the files. For a video, the file that will be posted, with its on-screen text already in it; for a slideshow, the slides rendered from the current version.
  • pending: a slideshow or video not rendered for this version yet. Listings render a few in the background, and reading the single draft renders it.
  • unavailable: nothing to show for now: a render that failed (tried again an hour later), or a video whose clips cannot be composed on the server.
curl -H "Authorization: Bearer ds-your-api-key-here" \
  "https://doublespeed.ai/api/v1/drafts?status=open&page_size=20"

Approve a draft

PATCH /api/v1/posts/{draft_id}/status with { "status": "scheduled" } queues the draft to its account and answers with draft_id, the new post_id and its status. A video that still has to be composed answers 202 with queued_state: "creating" and turns scheduled within a few minutes. Approving the same version again returns the same post with already_queued: true, so retrying is safe. A draft with no account answers 409, and a draft that cannot be queued as it is answers 422 with the reason.

Decline a draft

DELETE /api/v1/posts/{draft_id}, with an optional { "note": "..." } body of up to 2000 characters, sets the draft's review_status to rejected and saves the note as a review comment that shows on the draft's review link and that the content agent reads as feedback. Nothing is deleted: a declined draft leaves the open listing but still reads by id and with status=all. The response's note_saved says whether the note was kept, since some HTTP clients drop a DELETE body. Declining a draft that is already queued answers 409 with its post_id.

To hear about new drafts instead of polling, subscribe a webhook to draft.ready and draft.replaced (see Post outcome webhooks).

Templates

GET /api/v1/templates

List lightweight template metadata: id, name, description, thumbnail and preview URLs, tags, pinned/public flags, and timestamps. Pinned templates sort first, then most recently updated.

ParameterRequiredDescription
searchNoCase-insensitive name or description pattern
only_pinnedNotrue to return only pinned templates
page / page_sizeNoPagination, default 1 / 20, max 100

Clone

POST /api/v1/clone

Clone a source video into a fresh 15 second AI generation. Only source (a public video URL) is required; add a product object (name, description, and optional tone, audience, imageUrl) to have the clone feature your product, or omit it to recreate the reference faithfully. Optional prompt adds creative direction and voiceover: true generates native spoken audio.

Generation takes minutes, so the POST returns immediately with a jobId; poll GET /api/v1/clone/{jobId} for the result. Requests that the product's credit balance cannot cover return 402.

Hook + demo

Start the same Hook + demo batches as the Videos page from your own scripts, and collect the finished videos. Batches use the same setup and queue, are charged to the product's credits, and each finished video is saved as a draft on its account.

Each start copies the setup of the newest Hook + demo batch on your product (demo video, avatars, product context, music, clone model and the rest), and any field you send replaces the copied one. If your product has no batch yet, the first call starts a new setup with your saved avatars and brand brief: send reference_links, a demo with demo_video_url, and avatar_ids or product_context if your product has none.

Starting batches spends credits, so it needs a key created with Can spend credits turned on. Any key can list and read batches. A key without it gets 403 with error: "missing_permission"; create a new key with the setting on.

POST /api/v1/routines/hook-demo/batches

Starts one batch per account. Get account IDs from GET /api/v1/accounts.

FieldRequiredDescription
account_idsYes1 to 50 account IDs on your product. One batch per account
from_batch_idNoCopy the setup of this batch. Default: the product's newest Hook + demo batch
hook_directionNoReplaces the copied hook direction
reference_linksNoTikTok or Instagram Reel video links, one per entry. Replaces the copied links and uploads
avatar_idsNoAvatar IDs from your product's media library. Replaces the copied avatars
max_videosNo1 to 100 videos per batch
product_contextNoWhat your product is and who it is for. Replaces the copied product context
clone_modelNowan, omni or seedance. Replaces the copied model
demo_video_idNoA video in your product's media library, up to 45 seconds. Replaces the copied demo
demo_video_urlNoA direct mp4, mov or webm link to use as the demo instead of demo_video_id. The server has to report the file's size. Send it once; later batches copy it

Unknown fields are rejected.

curl -X POST https://doublespeed.ai/api/v1/routines/hook-demo/batches \
  -H "Authorization: Bearer ds-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{ "account_ids": ["ACCOUNT_ID_1", "ACCOUNT_ID_2"], "max_videos": 5 }'

The response is 201 when at least one batch started, with one entry in results per account: { "account_id", "ok": true, "batch" } or { "account_id", "ok": false, "status", "error", "code" }. When no account started, the response status is the first account's error status. Save each batch.id to track it.

GET /api/v1/routines/hook-demo/batches

The product's Hook + demo batches, newest first, 20 a page; pass next_cursor back as cursor for the next page. GET /api/v1/routines/hook-demo/batches/{batchId} returns one batch.

Each batch has its id, status, account_id, requested_videos, video_count, credits and videos. Each video has its status, reference_url, hook_text, and once it succeeds, video_url and thumbnail_url. draft_id is the draft on the account the video went to; it stays null until the draft is delivered, and again if the draft is deleted.

  • Batch status: waiting, queued, preparing, generating, then succeeded, failed or cancelled.
  • Video status: frame, cloning, finishing, then succeeded or failed.
  • Poll every minute or two until the batch finishes.

How batches run

A product runs one Hook + demo batch at a time. Starting many accounts runs the first batch and leaves the rest waiting, in the order you listed the accounts.

Every batch is charged to the product's credit balance, at the same price as the Videos page. A batch is refused with 402 when the product is out of credits, after an auto top-up if one is set up. credits.state is used while the batch runs. Once it ends, the state is charged, free if nothing was delivered, or due if videos were delivered and the charge isn't recorded yet, with credits as the amount due.

Each video uses a reference clip and avatar pair that hasn't been used yet. When every pair is used, the account's result has code: "no_fresh_pairs"; send new reference_links or avatar_ids and start again.

404 means from_batch_id or an account isn't on your product. 400 names anything the setup is still missing (an avatar, a reference video or product context). 409 means there are no fresh pairs.

The same batches can be started from an AI assistant with the MCP Hook + demo tools.

Errors

All endpoints return 400 for invalid parameters and 401 when the API key is missing, inactive, or invalid. Error bodies are JSON with ok: false and a message.