The API uses the existing App script repository. Saved documents appear in the normal Timeline editor. Saving is not execution, and executing does not implicitly save an edited draft.
Document endpoints
Use JSON and Idempotency-Key for writes, without a token. The connection access rules apply. These CRUD routes do not use the action idempotency ledger; the header does not grant resource replay protection.
| Method and path | Input | Response |
|---|---|---|
GET /scripts/timelines |
None | {items} with document summaries and revisions |
POST /scripts/timelines/validate |
{document} or {text} |
{valid:true,errors:[]} |
POST /scripts/timelines |
{document} or {text} |
{id,revision} |
GET /scripts/timelines/{id} |
Saved document ID | {doc,source,metadata,revision} |
PUT /scripts/timelines/{id} |
{expectedRevision,document} or {expectedRevision,text} |
{id,revision} |
DELETE /scripts/timelines/{id} |
{expectedRevision} |
{deleted:true} |
GET /scripts/timelines/{id}/history |
Saved document ID | {items} from the script's history |
text is JSONC source. Send one of document or text, not both. Timeline JSONC comments are preserved by the store. Reads return normalized document metadata separately from source; use the source or a clean authored document when replacing content, rather than blindly posting every read-only field back.
Validation failures return an error response, not HTTP 200 with valid:false. A successful validation checks public exclusions without dispatching effects. Saving a timeline validates document structure but does not run it or reserve hardware.
Read the current revision before editing, deleting, or running a document:
- Create rejects an existing explicit ID with
409 already_exists; edit with PUT. - PUT requires a string
expectedRevision(428 revision_requiredif missing); stale revisions give409 revision_conflict. - DELETE and run require the current revision too, but return
409 revision_conflictfor a missing or stale value. - Unknown documents give
404 not_found.
History is read-only through this API. There is no public restore-version, metadata-only, export, import, or repository-switch route.
Minimal document and save envelope
This document waits without dispatching a camera action:
{
"name":"Local API wait",
"schemaVersion":1,
"steps":[
{"type":"wait","params":{},"duration":1000}
]
}
Wrap it as { "document": <document> } for validation or save. The service can generate the saved ID. Optional top-level fields are id, description, promptReference, requestId, deferTransfers, groups, lightGroups, and gpioGroups. Unknown top-level, step, and parameter fields are rejected. Each step has type, params, and optional duration.
Get the live schemas and catalog before authoring complex actions. Schemas include the full editor language; public execution is a restricted subset.
Public step reference
Every saved run rechecks API entitlement and the public action policy. target for camera actions follows exact target selection.
Step type |
Parameters and behavior |
|---|---|
trigger |
target; optional phase (warmup, capture, aborted), burst, waitForTransfer, requestId |
trigger-managed |
Empty params:{} only; real configured trigger-button action, without overrides |
autofocus |
target, boolean enabled |
set-setting |
target, setting, value; descriptor-backed persistent settings only |
set-mode |
target, nonempty modeId; discover camera modes first |
set-trigger-mode |
target or legacy groupId, mode; optional intervalMs, reversed, freezeStartsAtCamera, freezeMs, jumpMs, intervalIterations |
transfer |
action:"hold" or "resume" |
dataset |
action:"create", "select", or "rename"; safe name required by public policy |
wait |
Empty params; duration is the wait |
log |
message |
shot |
actions:[{atMs,action}]; optional requestId; live public scheduling handles trigger and set-setting actions |
repeat |
Integer count, steps; optional stepsByIteration, combineAsIterations |
light |
Light target, command; public command keys are only enabled, color, brightness, gamma, hue_offset, saturation_offset, lightness_offset |
light-effect |
Light target, effectId; optional effectParams, frameCount, framerate, durationMs, command, output |
gpio |
GPIO target, command with validated op, pin/pins, and applicable value, mode, duration_ms |
No separate public light/GPIO discovery or command endpoint exists. These actions require the installed node context. Light/GPIO targets use exactly one of all, nodeIds, ips, groupId, or groupIds, not camera numbers. Local lightGroups/gpioGroups declare node IDs and/or IPs.
GPIO timeline operations are set, pulse, read, or mode; pins are 0 through 27. Read results are not a replacement for a dedicated public GPIO state API. Pulse duration is at most 3600000 ms. Light effect frame count is 2 through 600 and framerate is positive, at most 120; timeline effect duration is at most 600000 ms. Actual effect IDs and output fields must match the installed effect service and validator.
node-command and light-preset remain excluded even when the editor schema describes them. There is no public sound step. Internal setting action names and path-like dataset names are rejected. Public dataset names cannot contain slash, backslash, colon, or ...
Configured trigger step
{
"name":"Configured button capture",
"schemaVersion":1,
"steps":[{"type":"trigger-managed","params":{},"duration":0}]
}
{"type":"trigger-managed","params":{}} calls the same real service as POST /trigger-managed: current selection, warmup, countdown, repeat, movie modes, and configured timeline. No target or timing overrides are accepted. The step waits for pending dispatch, repeat completion, or movie capture timing, not file readiness. The example uses duration:0 to omit a trailing pause.
Do not put this step inside a shot action or a trigger-bound timeline, including inside nested repeats or alternate iterations of that bound timeline. Recursion is rejected with managed_trigger_recursion. A running timeline containing this step also cannot invoke another timeline bound to the button. Bound-timeline entitlement and public action checks happen before effects; the step cannot bypass them.
Groups, timing, and transfer semantics
Address cameras directly with target:{"numbers":[1,2]}, using their assigned Camera List numbers. Timeline groups can declare the same selection as {"id":"chosen","numbers":[1,2]}. Their numbers resolve at run start and remain pinned in that group's table for the run. Unknown or ambiguous numbers fail resolution; missing numbers are not skipped. Nonempty local groups override generated fleet groups with the same ID. They do not create or edit a persistent zone.
Direct numbers targets resolve at each action, so later actions follow any intervening renumbering. Use a timeline-local numbered group when one run must keep the same resolved members. Persistent zones also retain camera identity across renumbering. Legacy serials declarations remain compatible with existing documents; operators do not need to provide them.
Step duration is a trailing pause, defaulting to 250 ms; duration:0 removes it for an action step. A wait step requires an explicit positive duration and uses it as its wait. These are milliseconds, not seconds.
A shot schedules trigger and set-setting actions at atMs offsets through the node scheduler with a shared request ID. The structural validator accepts some other nested action types, but the current shot executor does not schedule them.
Put autofocus, transfer, light, GPIO, and dataset actions in ordinary timeline steps, not inside a shot. Nested shot/repeat actions and trigger-managed shot actions are rejected. Per-action trailing pauses and trigger waitForTransfer do not make a shot execute its actions sequentially.
Scheduled node actions can already be in flight when entitlement is lost or a run is aborted. A target without a dispatch node can be skipped by this scheduler; a successful run is not a per-camera hardware-completion guarantee. Do not promise rollback or recall of every scheduled effect.
repeat.count is 1 through 100. stepsByIteration, when present, must have exactly one step array per iteration. combineAsIterations:true groups repeated captures as dataset iterations; it does not increase the step limit.
Transfers are deferred for a timeline by default (deferTransfers is true unless explicitly false). transfer hold/resume steps manage the shared transfer hold through the runner. waitForTransfer:true waits for that trigger's transfer through the service and temporarily releases the timeline's deferred hold as needed. Runner cleanup releases its hold; error cleanup restores transfer state when the run changed it. Transfer completion and processed dataset readiness are separate events.
Limits include 256 KiB per document, 500 expanded steps, repeat nesting depth 2, 32 groups per kind, 256 members per declared group, 64-character camera group IDs, 128-character names, and 512-character descriptions. A pause is at most 600000 ms; a shot has at most 256 actions and atMs at most 3600000 ms.
For detailed editor syntax, use the Timeline step reference and targets and groups, but apply this API's public exclusions and live shot subset.
Run and abort reference
| Method and path | Input | Response |
|---|---|---|
POST /scripts/timelines/{id}/runs |
JSON {expectedRevision} and Idempotency-Key |
{operation,replayed} |
GET /runs |
No query pagination | {items} containing shared API script-run and managed-trigger operations |
GET /runs/{id} |
Operation ID, not runner runId |
The run operation directly |
POST /runs/{id}/abort |
Shared API operation ID, Idempotency-Key; omit body or send {} |
{operation,replayed} for the abort request |
Only one timeline runs at once across desktop and integration callers. Run admission returns asynchronously with result.runId, the timeline ID, and saved revision. A busy runner can be recorded as a failed admission with runner_busy.
Read the run until it reaches a terminal state, or observe the event stream. Managed operations remain running until actual dispatch/repeat completion or movie end, or configured Script runner completion, not file readiness.
An abort response means cancellation was requested, not that every physical effect was undone. The abort operation's result contains abortRequested and runId for a runner abort, or operationId for a managed operation without a runner. Inspect the original operation for its terminal state. An inactive API run records not_active.
Run ownership is shared across API clients, so coordinate before aborting work. Already dispatched or scheduled commands may finish: abort is best effort, never physical recall.
The server checks current authorization before admission and between steps. If a document changed before a retry reaches admission, the revision check may reject even an existing idempotency key. Read the original operation rather than choosing a new key.