The API
Create a demo from a script, attach a session, read a job back with its beats and a stable error code, and list the assets and voices you can name.
Everything the composer does, a script can do: the API is the same create path the form walks, validated by the same schema and counted against the same allowances. Every request and every answer is JSON.
Authenticate
With an API key. Create one in Settings under API keys, or ask an agent connected over MCP to make one. Send it on every request as
Authorization: Bearer <key> (or x-api-key: <key>); the request then acts as your account, in the
workspace that was active when you made the key, with your plan and your allowances. The key is shown
once and stored only as a hash, so copy it when it appears; revoke it from the same list. An account
holds up to 10 keys at once.
- A key reaches the job, connection, voice, media-library and support endpoints on this page, and
nothing else. Anywhere else it is answered
403. - A key does only what the permissions it was made with allow, here and on the MCP server alike: a key
made with read-only permission can list and read but not create or delete. A request outside them is
answered
403with a sentence naming the permission it needs. - Each key is limited to 120 requests per 60 seconds; past that the answer is
429with aRetry-Afterheader. Your daily and in-flight demo allowances belong to the account, not the key, so more keys never mean more demos. - A key that is wrong or revoked is answered
401; a key whose workspace you have since left is answered403. A refused key never falls back to a browser cookie or to a guest — the request is refused, with anerrorname and a sentence saying why.
Without a key, a request rides on the same browser cookie the app uses, and a request with no cookie is answered as a guest — a session is minted for it, and it is counted and capped exactly like a guest at the composer (see Guests and accounts). Send the cookie back on every later call, or the jobs you created will not be yours to read. A guest cannot hold a key.
Create a demo
POST /api/jobs with a JSON body. Two fields are required; everything else is optional, and an
unknown key is dropped rather than refused.
{
"url": "https://…",
"prompt": "Show how a new project is created and shared",
"quality": "high",
"format": "desktop",
"connectionId": "3f1c9c0e-6c1e-4a3a-9c1e-2b1f0d8a7e11",
"introAssetId": "b0b3e8b2-2c8d-4a9d-8c3a-1d2e3f4a5b6c",
"introTransition": "fade",
"voiceProfileId": "7c2d1e9a-4b3f-4c8d-9e1f-0a1b2c3d4e5f"
}
The rules the composer enforces are enforced here too, with the same sentences:
- An asset id must be in your library, or a built-in preset, and of the kind its slot expects.
- A transition needs a stinger to run against.
"introTransition": "fade"with nointroAssetIdis refused rather than ignored — see Intros, outros and audio. - A faster
playbackSpeedcannot sit besideitemSeconds: the seconds you asked each item to stay on screen would shrink with the video, so the create is refused rather than delivering shorter holds. - A
voiceProfileIdmust be on the account's live voice list, and naming one at all is a Pro lever — the same two gates the workspace voice in Settings passes. Absent, the demo narrates in the workspace's voice, or the house voice when none is set. If the voice service cannot be reached to check the id, the create is refused rather than trusted; try again in a moment. - The saved connection must be one of yours.
A created job answers 202 Accepted:
{ "id": "…", "status": "queued", "quality": "high", "url": "/jobs/…" }
The other answers, each with a machine-readable error and a sentence you can show:
400— the body is not JSON, or a field fails validation;issueslists which.422— the body is well formed but one of the rules above refused it;erroris the sentence.402 upgrade_required— a paid lever on a workspace that has not paid;featuresnames the lever,messagesays so in words. No amount of waiting fixes it, so it carries noRetry-After.429 quota_exhausted— an allowance is spent;scopesays which,limitthe number, andRetry-Afterhow long. See Limits.500 internal_error— Demofy failed on this request;messagesays to try again. Any route a key can call answers its own failures as JSON like this, never with an empty body.
A 502, 503 or 524 can also come from the network in front of Demofy (during a deploy, say), before
the request reaches it; that body may be an HTML page or empty. Treat any answer that is not JSON as a
failed attempt and try again after a few seconds.
Before you create one, GET /api/queue says how busy Demofy is, as two counts and nothing else:
{ "queued": 3, "running": 2 }
queued is how many jobs are waiting for a worker, which is the queueAhead a job you create now
starts with; running is how many are being worked on. Both count every workspace's jobs, since one
pool of workers serves them all, and neither names a job. It takes a key or the session cookie, a
guest's included; a request with neither is a 401. The MCP server's queue tool answers the same.
A scripted job
Send "kind": "scripted" and a complete demoscript instead of a prompt, and the job replays
your plan with no discovery and no model call. title is optional and becomes the library's name
for it; the finishing ids, the two transitions, playbackSpeed, session and connectionId mean exactly
what they mean on a demo create. The URL, the tier and the format come from the plan's own meta, so there
is nowhere to state them twice. The camera's rhythm is in the plan too: meta.style.cameraRhythm: "pulse" asks for the camera look.cameraRhythm describes above, and leaving it out keeps chain
(the plan states only pulse; "chain" there is refused). So is the hand: meta.style.pointer is "touch" or "none", and leaving it out draws the
cursor, on a mobile plan too ("cursor" there is refused). See The kinds of job.
A scripted plan can also place a video you uploaded as a beat, between the web beats around it: a step whose
action is { "kind": "clip", "assetId": "…" }, naming a clip from your media library (upload one as below,
with metadata: { "kind": "clip" }). The beat touches no page. It plays the clip where the browser card stands,
fitted inside the card's space without stretching or enlarging it, with the camera at rest and no pointer, for as long
as the clip runs, measured from the file itself. Its narration, caption, hidden and sound work as on any beat, and a
line longer than the clip holds the clip's last frame until the line ends. The step still carries wait and assert
(any valid ones), but neither is run. Its zoom must be { "mode": "none" }, and it takes no focusSelector,
focusPoint or masks. A clip that is not yours, or an asset of another kind, is refused before anything is
recorded. The clip plays silent for now: its own sound is not mixed. Placing a clip from the editor, an edit, or the
MCP server is not built yet; a demo created from a prompt never places one.
Your own narration is held to the same line rules Demofy's voice-over is: the first line opens on the viewer's
problem or result rather than the screen or a click, no line narrates a click or uses a stock phrase, and no
line repeats another. A plan that breaks one is refused with a 400 that lists every violation at the line it is
about, so one answer names everything to fix. A plan with meta.muteNarration speaks none of its lines, so none is
judged.
For a scripted job, top-level captureProfile: "compact" resolves the ordinary desktop template
viewport through Demofy's profile table before the plan is stored. Custom conflicting viewport or
device-pixel overrides are refused. A directly profiled plan must already carry the matching
meta.captureProfile and viewport. A re-render keeps the stored profile; it does not apply scaling twice.
The job JSON echoes captureProfile when selected and omits it for legacy jobs. This names recording
geometry; it does not promise that a site's dialogs or controls fit inside the viewport or camera.
A visible cookie or consent banner is answered once per site before it can sit in the video: Demofy
presses the banner's own Reject (or Necessary only) button, and Accept only when the banner offers no
way to refuse. This happens on every job; the build log names the site and the button. A plan whose
own steps click the banner keeps it for those steps, and a scripted plan with
meta.keepConsentBanner: true leaves every banner exactly as the site shows it. A demo created from a
prompt has no way to ask for that yet.
Joining finished demos
Send "kind": "join" and a parts list of 2 to 30 finished demo ids, and Demofy joins them
into one new video in that order. Nothing is recorded again, so it takes minutes, not a recording's time.
{
"kind": "join",
"parts": ["5b1e…", "9c2f…", "0d7a…"],
"title": "Weekly progress",
"playbackSpeed": "swift"
}
- Each part keeps its own narration, music and captions. The joined video's captions track carries every part's
cues at the moment that part plays, and its steps (the chapters in
steps) are every part's steps in order, eachidprefixed with its part's place (p2-…). - It is delivered at the first part's size. A part recorded at a larger tier is scaled down to it.
title,introAssetId,outroAssetId,audioAssetId, the two transitions andplaybackSpeedmean what they mean on a demo create, applied to the joined video as a whole: one intro before part 1, one outro after the last part, one speed for all of it. A speed is refused when any part already plays at one: a join never speeds a part up twice, so join it at natural speed.- It counts as one demo against your allowance (
429as a create does). It is delivered at the first part's quality, and your workspace's plan today is asked for that quality as an edit's is: a High or Ultra part in a workspace that no longer pays for it is refused with402 upgrade_required, never quietly delivered smaller. - Its length is capped by what one job can encode: up to 145 minutes at 1920 × 1080, or 72 minutes at 1920 × 1080 with an intro, outro, music or speed, and less at a larger size. Parts that run longer together are refused with a sentence stating this join's own cap: join fewer demos, or demos made at a lower quality.
- An agent on MCP asks you to confirm a join before it runs, because it spends a demo.
Each of these is refused with 422 and a sentence naming the part by its place in the list: a part you cannot open
(a missing id and someone else's demo read the same), a part that has not finished or that failed, an imported
video (it has no steps to carry), a part in another workspace than part 1, and a part of another format or shape
than part 1. A phone video next to a desktop one is refused, never letterboxed. A joined video answers like any
other on GET /api/jobs/:id, with kind: "join", and its row in GET /api/jobs lists its joinPartIds. It cannot
be re-recorded, refreshed or edited itself.
Attaching a one-shot session
When session is true the job is created but not started, and the answer carries two more
fields:
{
"id": "…",
"status": "queued",
"url": "/jobs/…",
"sessionUploadUrl": "https://…",
"sessionCompleteUrl": "/api/jobs/…/session/complete"
}
PUTa Playwright storage-state JSON tosessionUploadUrlwithContent-Type: application/json.POSTtosessionCompleteUrl. The upload is checked against the live schema, and the pipeline starts. An invalid file is deleted and answered422; you may upload again and complete again.
The session is single-use. It is destroyed at the end of the job, whatever the outcome, which has two consequences worth knowing:
- A refresh of that demo cannot reuse it — pressing re-shoot on a job that ran on a one-shot session is refused with a sentence that says to record again with a session attached, or to save a connection. The automatic re-shoot after a failed capture is the one exception: it copies the session under the new job's own key before the old one is destroyed, so it runs signed in.
- A saved connection is the reusable alternative, and the better one for a script that records the same product repeatedly. See Recording behind a login and What happens to a saved session.
Reading a job
GET /api/jobs/:id answers the job's state and, once it has finished, short-lived signed URLs for
its files. Every URL in the body expires; fetch a fresh body rather than storing one. An id you
cannot see — unknown, or somebody else's — is a 404 either way.
Each entry in steps is one beat: id, kind (goto, click, fill, select, press, scroll, hold or clip),
title, target, narration, waitedMs, tStartMs, tEndMs, spanApproximate, item, navFallback, waitRecovery and skipped. The target is the label a person would read — the button's
text, the field's name, the URL of a goto, the key of a press — never a selector, because a
selector is an implementation detail of the page and it is not yours. waitedMs is how long the beat
waited between its action and its check's verdict on the recording that made the video (null before
one exists): a beat whose check never held shows its whole patience here, and that is where the video
stood still.
A hold beat is the pause a numbered item asked for when it only waits or watches ("3. Wait on the editor."): nothing is
clicked or typed, the page stays live, and it lasts at least 2 seconds, or the item's itemSeconds when you gave one. It carries
that item's number like any other beat, so the item always has a span to time a sentence against.
A select beat chooses one option of a dropdown list by the option's own text; its target is the dropdown's name.
Three more fields place each beat in the finished video, for a caller that times its own voice against it:
tStartMsandtEndMs— where the beat starts and ends in the delivered video, in milliseconds, after the intro and after any long wait was shortened. Every beat carries them, narrated or not, the opening one included, whatevernarrationwas set to.nullfor a job made before they existed.spanApproximate—truewhen the recording's clock could not be tied to the video's (seerecordingGate.calibration): the span is then exact against the narration and captions, and late against the picture by the recorder's start-up, typically 0.1 to 0.5 seconds.falsefor an exact span,nullwhen there is no span.item— the numbered prompt item the beat came from, when the prompt was written as numbered items (nullotherwise). Discovery does not keep one beat per item: an item may become two beats (a click repeated, a scroll done in two moves) or none (listed inunmatchedItems). A beat that shares no word with the item it falls under, such as a banner dismissed between two items, carriesnullrather than being claimed for it. For a scripted job, it is theitemeach step of your plan states.navFallback—"full-load"when the beat's click left the page where it was and Demofy loaded the link's page in full, once, to go on;nullwhen the click got there on its own.waitRecovery— how the beat's wait for a control was got past when it did not come true on its first look:"scroll-revealed"(it showed only once scrolled into view),"fallback-selector"(only a looser way of finding the control found it),"reclicked"(the click was made once more),"settled-elsewhere"(it came true once the page settled on another address) or"self-healed"(it never came true, and the recording went on from a page it confirmed another way).nullwhen the wait came true on its own. ReadwaitedMsas the app's own time only when this isnull.skipped—"already-shown"when the beat is a click your plan markedunlessShownand the control it waits for was already on screen, so no click was made;"nothing-to-close"when the beat only closes something over the page (a banner, a toast, a dialog) and it was already gone, so no click was made and the beat has no narration;"cookie-banner"when the beat presses a site's cookie banner and something sat on top of it, so Demofy answered the banner itself (or filmed it as it was) and the beat has no narration;nullwhen the beat ran its action.
A check that cannot hold on a page that stays busy without making progress (a class flipping on a loop, a status poll every few seconds) is given up well before the full patience, and the build log names what kept the page busy. A page that shows it is working (a spinner, a progress bar, new text, or a request still open, such as an AI generation that answers in one response) keeps the full patience.
errorCode is for the branch in your code; error is for the person. Switch on errorCode, never on the
words of error: they are written for a reader and can change, and code that matched the older wording must
move to errorCode. A sign-in page is not an
error: it pauses the job with needsSignIn (above). A page discovery could not get past for another
reason, for instance, ends the run with repeated_action: the plan kept pressing the same button there. brief_not_on_page means the prompt asked for something the page did not have, and its only
way on was a link that starts something else, such as an empty list's "make your first" button; when the demo needs
what a signed-in account holds, connect a saved login and create the job again. llm_budget, egress_unreachable and worker_lost are the codes
that are Demofy's own fault. For llm_budget the day's planning budget is spent; for egress_unreachable the service
every recording browser connects through did not answer; for worker_lost the process recording the job stopped
on Demofy's side. Either way nothing about your request needs changing, and creating the job again later is the
remedy. navigation_stalled means a click that should have opened
another page left the browser on the same address for 30 seconds with no answer
from that page. When the click was on a link to your own site, Demofy first loads that link's page in
full, once; a button is never clicked twice, since a second click could repeat what it does. A page that
answered and is still arriving gets the full wait. error names the step and the address it expected.
The recording stops there rather than film every later step on the wrong page, and a failed job does not
count against your allowance. page_load_timeout means a step that opens an address waited 30 seconds while
recording and the page never arrived (or it led to another site instead); error names the host and the step, and
creating the job again is usually the fix. step_timeout means Demofy found the field a step types into and ran out of time
while typing; your site did not change, and creating the job again is the fix. site_unreachable means the address itself never opened: its name did not
resolve, the server did not answer or refused, it answered with an error instead of a page, or it asked for
a browser username and password before showing anything. error says which, and names the host only.
lost_page is usually Demofy's own fault: the plan opened a page outside the plan and could not get back to where the
demo starts. Creating the job again is the fix, once the start address opens the same page every time.
guessed_address is Demofy's own fault: the plan kept asking to open an address it had guessed, one that is
not the site the demo is for, not in your prompt and not linked from your app, and Demofy never opens such an
address, so nothing of a site that may not be yours is recorded. error names the address.
These codes name a step the page would not let Demofy take. click_blocked: something sat on top of the
control (a pop-up, a banner, an overlay), or the control never became visible. no_effect_click: clicking
it changed nothing on the page. control_disabled: the control is disabled until something else happens
first. not_a_text_field: the plan tried to type into something that does not take typing, such as a
dropdown, or a button or link where it expected the field. control_not_listed: the plan kept choosing a control the page was not showing, most often one that
appears only on hover, further down the page, or after another step. retyped_field: the plan kept going back to type over text it had already put in a field; that is Demofy's fault, and creating the job again is the fix. fresh_element_missing: a step works on something the step before it creates, and while recording
nothing new appeared, most often because exploring already did that step on your site. ambiguous_target: a step works on one of several controls that look the same, and while recording none of them sat beside the text it was recorded beside.
saved_session_signed_out means the saved login the job used is no longer signed in.
capture_signed_out means the recording opened your site with the saved login, but before anything was filmed
the site had signed it out or shown its sign-in page, so the recording stopped rather than film the wrong account.
flat_camera means Demofy stopped the video before delivering it, because its camera would have stayed
still through the zoomed clicks it planned; that is our fault, and making the demo again is the fix.
item_lost means Demofy stopped the video before delivering it, because a part of the demo it recorded would
have been missing from the finished video; that is our fault too, and making the demo again is the fix.
scroll_did_not_move means a scroll the demo planned did not move the page while it was recorded, even
after a second try, so the video would have stood still under its narration; recordingGate.unmovedScrolls names the step.
recording_too_slow means the recording could not keep up with the page, so typing or scrolling would
have played in jumps. Both are our fault, and making the demo again is the fix. items_not_shown means
your prompt was a numbered list and Demofy found no way to show half or more of its items on the page;
nothing was recorded, and naming each item in the page's own words is the usual fix.
narration_unavailable means the voice service returned no spoken line for any of the demo's narration,
so Demofy stopped rather than deliver a narrated video with no voice; making the demo again a few minutes
later is the fix. voice_rejected means the voice service refused the narration voice the job asked
for, in a way it would repeat on every line (the voice was deleted there, or its settings are ones its engine
does not take), so Demofy stopped, usually before recording; error quotes what the voice service said, and
picking another voice or fixing that one is the fix. narration_floor means Demofy planned the demo but could not write a voice-over for it that
meets its own quality bar (a hook, no repeated lines, a close), so it stopped before recording; that is our
fault, the job did not count against your daily videos, and making the demo again is the fix.
phase_wedged means one stage of making the demo (recording, rendering or uploading) ran past its time
limit, or any stage stopped making progress, so Demofy stopped it; error names the stage, and making the
demo again is the fix. job_timeout means the whole job ran past the time one job may take, which is
raised for a job only by what its own recording honestly needs; error names the stage it was in.
page_not_found means the URL opened a "page not found" screen, so nothing was recorded; check the address.
brief_mismatch means the page at the URL does not have what the prompt asks to show (a pricing tour
started on an article, say); nothing was recorded, and pointing the URL at the page that has it is the fix.
parked_domain means the URL opened a page offering the domain for sale rather than a website; nothing was
recorded, and checking the address is the fix.
reset_hook_failed means the saved login's reset hook answered something other than a 2xx status (or did not
answer) when Demofy called it before exploring or recording, so the job stopped before anything was filmed;
error names the hook's site and what it answered, never its address.
To follow a job while it runs, GET /api/jobs/:id/events is a Server-Sent Events stream: it
replays the whole build log, then tails it until the job ends. It is the same log the job page
shows — see Reading the build log. Reading the JSON again works too; there
is no webhook.
Answering a sign-in pause
A job paused with needsSignIn waits for one of three answers. Signing in is the one only a person
can give, because it takes a password, a code or a consent screen: hand them signInUrl, they sign
in once in a browser Demofy drives, and the same job carries on by itself. The link opens the job
page's sign-in card, so it works for whoever is signed in to the account that owns the job.
The other two need no person. POST /api/jobs/:id/sign-in with one of:
202 means the job was sent again; read it as before. A job you cannot see is a 404, like
everywhere else. Any refusal is a 409 carrying the job page's own sentence: the job is not waiting
any more, the saved connection is for another site, or the demo already records behind a saved login
for a different site. Only the person who created the job may answer it.
Cancelling a job
POST /api/jobs/:id/cancel stops a job that has not finished: a paused one, a queued one or one
that is recording. It is the job page's Cancel button. 200 means it stopped; the job then reads
failed with cancelled: true, and a cancelled demo does not count against the day's demos. A job
you cannot see is a 404, and one that already finished is a 409 carrying the page's sentence.
Anyone in the job's workspace may cancel it.
Editing a finished demo
POST /api/jobs/:id/edit ships an edit of a finished demo, the way the step editor's Render button
does (see The step editor). The body is the edit, never a new script: a steps
list with one line per beat of the demo's plan, each carrying the beat's id, its narration and
whether it is hidden from the final cut, plus an optional camera. An optional look,
finishing and voiceover change the whole video, and so does an optional voice: a voice id from
GET /api/voices that reads the narration from then on. Like naming a voice on a create, it is a paid
choice and must be one of your voices. Every beat is replayed from the plan Demofy stored; nothing else
about the plan can be changed from here.
finishing holds the same fields a create takes for the clips and the speed: introAssetId, outroAssetId,
audioAssetId, introTransition, outroTransition and playbackSpeed. A field you leave out keeps the
demo's own; null takes it off (for playbackSpeed, back to natural). An edit that changes only the
finishing, the look or the voice is put together again from the demo's own recording when Demofy kept
it, and recorded again when it did not.
202 answers with a new job, in the same shape a create answers; the demo you edited is kept
as it was. Read the new job as before. A job you cannot see is a 404, a body that is not an edit is
a 400 carrying the schema's issues, and a demo that cannot be edited — it has not finished, or the
edit changes nothing — is a 409 carrying the editor's own sentence. An edit is a new recording, so
it spends a demo from your allowance and answers 429 and 402 exactly as a create does.
Your library and your voices
GET /api/assets?kind=intro — or outro, audio, logo or clip — lists the assets you may attach in that
slot: yours, plus the built-in presets. Each carries id, kind, title, contentType,
sizeBytes, durationS, a playable url, isPreset and createdAt. A signed-out caller sees
only the presets.
Uploading takes the same three steps the picker takes, and a key can take all of them:
POST /api/upload-tokenwithname,size,typeandmetadata: { "kind": "intro" }(oroutro,audio,logo,clip). The answer is akey, a signeduploadUrland itsexpiresInin seconds. A type or size the slot does not take is a400; too many uploads started in a short time is a429with aRetry-Afterheader.PUTthe file's bytes touploadUrl, with the sameContent-Type. The file goes straight to storage; it never passes through Demofy.POST /api/assetswith thatkey,fileName,kind,contentType,sizeBytesand, for audio or video,durationS.201answers the new asset, whoseidis whatintroAssetId,outroAssetIdandaudioAssetIdtake, and what a clip beat'sassetIdnames. A file that is not what its slot needs is a422with a sentence, and the upload is removed. A503withretryable: trueand aRetry-Afterheader means storage could not be read just then: the upload is kept, so send the same register again.
DELETE /api/assets/{id} removes one of your assets. A preset, or an id that is not yours, is a
404. See The media library for what each slot holds.
GET /api/voices lists the voices a demo can narrate with. Each carries id and name, plus
description, language and voiceType when the voice service stated them. The id is what
voiceProfileId takes. A signed-out caller is refused; an unreachable voice service answers with
voices set to null and a sentence, which is not the same thing as an empty list.
GET /api/connections lists your saved logins, the ones connectionId takes. Each carries id,
label and origin, and two records of how it last went, so you can see a dead login before a demo
pauses on it. lastVerifiedAt is when Demofy last saw it signed in, checking just before a demo
(null if never); check says whether that check can happen for this site at all (checkable, or
same-address, unprobed or self when it cannot). needsSignIn is true when the last demo behind
it stopped at the site's sign-in page and nothing has used or saved it again since; sign in again in
the app or save it again, and it goes back to false. false means no demo has found it signed out,
not that it is signed in now: listing never opens the site. No cookie name or value is ever in the list.
lookOnly is true for a saved login whose demos may open and read pages on its site but never create,
change, send or delete anything there. PATCH /api/connections/{id} with { "lookOnly": true } turns that
on and { "lookOnly": false } turns it off; it answers { "ok": true, "lookOnly": … }, or 404 for a login
that is not yours. Use it for a shared, reviewer or production account. A demo already running keeps the
setting it started with.
GET /api/jobs lists the videos in your active workspace — the same set the library page shows,
never another workspace's.
Support
POST /api/support files a support ticket from your account; the reply goes to your account's
email. Send a subject, a body, a topic (bug, billing, feature or other), an optional
jobId, and up to five attachments, each a name and an https url to the file (a link, never
the file itself). 201 answers the ticketId, which is the reference on the reply. A body the form
would refuse is a 422; a caller who is not signed in is a 401; more than five requests in an hour
is a 429 with a Retry-After header. GET /api/support lists the tickets you filed this way,
newest first.