Automotion docs
API

Templates

Store movie documents as reusable templates with declared `{{variables}}`, then render them with per-request values — the data-driven video workflow.

Store movie documents as reusable templates with declared {{variables}}, then render them with per-request values — the data-driven video workflow.

All endpoints live under https://api.automotion.dev/v1, require Authorization: Bearer <api key>, and answer with the standard envelopes.

POST /templates

Create a template. Store a movie document as a reusable template. The document's declared variables (body.variables) become the template's manifest; declared-but-unused variables are returned as warnings.

Request body

The template to create.

FieldTypeDefaultDescription
name *string (non-empty)Display name of the template.
body *objectThe template's movie document, with {{variable}} placeholders. Its declared variables (body.variables) become the template's manifest.

Example

curl -X POST https://api.automotion.dev/v1/templates \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily update",
    "body": {
      "schema": "v1",
      "preset": "9:16",
      "variables": {
        "headline": {
          "type": "string",
          "description": "Today's headline."
        }
      },
      "scenes": [
        {
          "id": "update",
          "duration": 4,
          "background": "#1e293b",
          "elements": [
            {
              "id": "update-text",
              "type": "text",
              "text": "{{headline}}"
            }
          ]
        }
      ]
    }
  }'

Responses

  • 201 — The created template, with manifest warnings. Returns TemplateWriteResource.

TemplateWriteResource

FieldTypeDefaultDescription
id *string (non-empty)Template id.
name *string (non-empty)Display name of the template.
body *objectThe template's movie document, verbatim as stored, with {{variable}} placeholders.
variables *objectThe declared variables manifest (mirrors body.variables; empty object when none).
createdAt *string (date-time)Creation time (ISO-8601).
updatedAt *string (date-time)Last update time (ISO-8601).
warnings *object[]Non-fatal manifest findings (e.g. declared-but-unused variables). Never stored.

Errors

VALIDATION_ERROR · SCHEMA_INVALID · UNSUPPORTED_SCHEMA_VERSION · ELEMENT_ID_DUPLICATE · SCENE_ID_DUPLICATE · SCENE_EMPTY · VARIABLE_UNDECLARED — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.

GET /templates

List templates. List the caller's templates, newest first, with page pagination.

Parameters

NameInTypeRequiredDescription
pagequeryinteger (≥ 1)no1-based page number.
page_sizequeryinteger (1–100)noPage size (max 100).

Example

curl https://api.automotion.dev/v1/templates \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY"

Responses

  • 200 — A page of templates. Returns TemplateListResource.

TemplateListResource

FieldTypeDefaultDescription
items *object[]The page of results, newest first.
page *integer (≥ 1)1-based page number.
pageSize *integer (≥ 1)Number of items per page.
total *integer (≥ 0)Total number of matching items.
hasMore *booleanWhether further pages exist (page * pageSize < total).

Errors

VALIDATION_ERROR — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.

GET /templates/{id}

Get a template. Fetch a template with its document and variables manifest.

Parameters

NameInTypeRequiredDescription
idpathstring (non-empty)yesThe template id.

Example

curl https://api.automotion.dev/v1/templates/$TEMPLATE_ID \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY"

Responses

  • 200 — The template. Returns TemplateResource.

TemplateResource

FieldTypeDefaultDescription
id *string (non-empty)Template id.
name *string (non-empty)Display name of the template.
body *objectThe template's movie document, verbatim as stored, with {{variable}} placeholders.
variables *objectThe declared variables manifest (mirrors body.variables; empty object when none).
createdAt *string (date-time)Creation time (ISO-8601).
updatedAt *string (date-time)Last update time (ISO-8601).

Errors

NOT_FOUND — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.

PUT /templates/{id}

Update a template. Replace a template's name and/or document (re-validated).

Parameters

NameInTypeRequiredDescription
idpathstring (non-empty)yesThe template id.

Request body

The fields to replace (at least one).

FieldTypeDefaultDescription
namestring (non-empty)New display name.
bodyobjectAn Automotion movie document. The "schema" tag selects the Movie Schema version it is parsed under.

Example

curl -X PUT https://api.automotion.dev/v1/templates/$TEMPLATE_ID \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily update (v2)"
  }'

Responses

  • 200 — The updated template, with manifest warnings. Returns TemplateWriteResource.

TemplateWriteResource

FieldTypeDefaultDescription
id *string (non-empty)Template id.
name *string (non-empty)Display name of the template.
body *objectThe template's movie document, verbatim as stored, with {{variable}} placeholders.
variables *objectThe declared variables manifest (mirrors body.variables; empty object when none).
createdAt *string (date-time)Creation time (ISO-8601).
updatedAt *string (date-time)Last update time (ISO-8601).
warnings *object[]Non-fatal manifest findings (e.g. declared-but-unused variables). Never stored.

Errors

VALIDATION_ERROR · SCHEMA_INVALID · UNSUPPORTED_SCHEMA_VERSION · ELEMENT_ID_DUPLICATE · SCENE_ID_DUPLICATE · SCENE_EMPTY · VARIABLE_UNDECLARED · NOT_FOUND — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.

DELETE /templates/{id}

Delete a template. Delete a template. Renders already created from it are unaffected.

Parameters

NameInTypeRequiredDescription
idpathstring (non-empty)yesThe template id.

Example

curl -X DELETE https://api.automotion.dev/v1/templates/$TEMPLATE_ID \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY"

Responses

  • 204 — Deleted.

Errors

NOT_FOUND — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.

POST /templates/{id}/renders

Render a template. Resolve the template's {{variables}} with the supplied values and enqueue a render via the same path as POST /v1/renders (identical quota, idempotency, watermark and webhook gating).

Parameters

NameInTypeRequiredDescription
idpathstring (non-empty)yesThe template id.
Idempotency-Keyheaderstring (non-empty, ≤ 255 chars)noOptional client-chosen key making the create retry-safe (§9): replaying the same key with the same body returns the ORIGINAL render with 200; a different body is rejected with IDEMPOTENCY_KEY_REUSED.

Request body

Variable values and render options.

FieldTypeDefaultDescription
variablesobjectValues for the declared variables, keyed by variable name.
webhook_urlstring (uri)Webhook notified on render.completed / render.failed. Paid plans only; trial requests are rejected with WEBHOOKS_NOT_ALLOWED.
draftbooleanRender a fast, low-resolution, watermarked draft instead of the final output.

Example

curl -X POST https://api.automotion.dev/v1/templates/$TEMPLATE_ID/renders \
  -H "Authorization: Bearer $AUTOMOTION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "variables": {
      "headline": "Automotion ships the docs"
    }
  }'

Responses

  • 201 — The queued render. Returns RenderResource.
  • 200 — Idempotent replay: the same Idempotency-Key with the same body returns the original render. Returns RenderResource.

RenderResource

FieldTypeDefaultDescription
id *string (non-empty)Render id.
status *"queued" | "preparing" | "rendering" | "done" | "failed"Render lifecycle state (§6): queued → preparing → rendering → done | failed.
progress *integer (0–100)Monotonic progress percent: 0–20 preparing, 20–99 rendering, 100 done.
draft *booleanWhether this is a fast low-res draft render.
watermark *booleanWhether the output carries the Automotion watermark (drafts and the trial plan).
outputUrl *string (uri) | nullCDN URL of the finished MP4. Null until the render is done.
expiresAt *string (date-time) | nullWhen the output expires per the plan's retention window (30d trial / 90d Starter+Pro / 365d Studio). Set on completion.
error *object | nullThe failure, when status is failed. Always references a catalog code. Null otherwise.
durationSec *number (≥ 0) | nullOutput duration in seconds, known once preparation finishes.
meteredMinutes *number (≥ 0) | nullWeighted render minutes charged against the credit balance (10 credits each), set when the render completes.
fps *integer (> 0)Frames per second of the output.
templateId *string (non-empty) | nullSource template id when the render was created from a template.
webhookUrl *string (uri) | nullWebhook target notified on completion or failure (paid plans).
createdAt *string (date-time)Creation time (ISO-8601).
updatedAt *string (date-time)Last state-change time (ISO-8601).

Errors

NOT_FOUND · VALIDATION_ERROR · SCHEMA_INVALID · UNSUPPORTED_SCHEMA_VERSION · ELEMENT_ID_DUPLICATE · SCENE_ID_DUPLICATE · SCENE_EMPTY · VARIABLE_MISSING · VARIABLE_TYPE_MISMATCH · VARIABLE_UNDECLARED · INSUFFICIENT_CREDITS · CONCURRENCY_LIMIT · IDEMPOTENCY_KEY_REUSED · WEBHOOKS_NOT_ALLOWED — plus the pipeline-wide UNAUTHORIZED · RATE_LIMITED · INTERNAL.