Skip to content
DEVELOPER API

Render a composition without opening the editor

Upload a .motion project, swap any layer by its name, and render it from n8n, a cron job or your own backend. One POST in, one MP4 out — and the editor never has to open.

ImportPOST /v1/templates/import
# 1. the project — once
curl -X POST https://motion-back-production.up.railway.app/api/v1/templates/import   -H "Authorization: Bearer pm_live_…"   -F "file=@MyProject.motion.zip"

# → { "id": "tpl_7f8a9b",
#     "requiredInputs": ["heroImage"] }
Upload & renderPOST /v1/renders
# 2. the file, then the render — every time
curl -X POST https://motion-back-production.up.railway.app/api/v1/assets   -H "Authorization: Bearer pm_live_…"   -F "file=@new-hero.png"
# → { "url": "https://res.cloudinary.com/…" }

curl -X POST https://motion-back-production.up.railway.app/api/v1/renders   -H "Authorization: Bearer pm_live_…"   -H "Idempotency-Key: order-4711"   -d '{
    "templateId": "tpl_7f8a9b",
    "inputs": { "heroImage": "https://res.cloudinary.com/…" },
    "callbackUrl": "https://hooks.example.com/premation"
  }'
Resultrender.finished
// 3. minutes later, at your webhook
{
  "jobId": "clx9zz110000",
  "status": "completed",
  "videoUrl": "https://res.cloudinary.com/…/out.mp4",
  "error": null,
  "renderDurationMs": 74213
}
HOW IT WORKS

Four steps, three of them once

Steps one to three are setup. Step four is the only thing your automation runs.

01

Send us the project

POST a zipped .motion to /v1/templates/import. Every media layer comes back as an input named after the layer — heroImage, backgroundVideo. No editor step, no field authoring.

02

Mint a scoped key

Five scopes, optional expiry, revocation that takes effect on the next request. The secret is shown once and stored only as a hash.

03

POST the inputs

One request queues a job and returns a job id immediately. Send an Idempotency-Key and a retry costs you nothing.

04

Collect the MP4

Poll the job, or pass a callbackUrl and receive one webhook when it settles. Downloads answer 302 straight to the file.

THE SURFACE

Small enough to read in one sitting

High-level only: templates, renders, keys and usage. There is no layer or keyframe CRUD — the API renders compositions, it does not edit them.

Base https://motion-back-production.up.railway.app/api
  • POST/v1/rendersQueue a render
  • GET/v1/renders/{id}Poll status and progress
  • GET/v1/renders/{id}/download302 to the MP4
  • POST/v1/renders/{id}/cancelCancel, releasing the reserved minutes
  • POST/v1/templates/importUpload a .motion, get a drivable template
  • POST/v1/assetsUpload bytes, get a URL a render can read
  • GET/v1/templatesList templates and their input manifests
  • GET/v1/usageQuotas, and what you have spent
  • POST/v1/keysMint a key (session only)
BUILT FOR IT

Shaped around the tools that call it

Four decisions that exist specifically because the caller is usually an HTTP node in someone else's workflow engine.

No SDK, no custom node

Everything is a plain HTTP request. X-API-Key is accepted because it is n8n's default header; downloads redirect because HTTP nodes follow redirects; rate limits answer 429 because that is what automation tools back off on.

Send files, not URLs

POST /v1/assets takes the bytes your workflow is already holding and returns a URL a render can read. No S3 bucket in the middle whose only job is to bridge two systems that both have the file.

Idempotent by request

An Idempotency-Key on a render returns the original job rather than queueing a second one. A retried workflow or a re-run CI job does not bill you twice.

Scoped, revocable keys

Five scopes, optional expiry, and revocation that takes effect on the next request. Key management itself is session-only, so a leaked key cannot mint more keys or cover its tracks.

The same renderer as your export

Hosted renders run the same offline render path as File ▸ Export, against the same frozen document — not a re-implementation, and not a browser screenshotting a canvas.

BEFORE YOU BUILD

Three things it does not do

These are the facts most likely to make this the wrong tool for your pipeline. Better to read them now than after wiring up a workflow.

Not in it

MP4 only

The desktop exporter's other formats — WebM with alpha, ProRes 4444, PNG sequence, Lottie, SVG, GIF — are not exposed over the API.

Not in it

No alpha channel

MP4 has none. Transparency is flattened onto the composition background, so a template meant for overlay compositing needs a filled background.

Not in it

No audio yet

The hosted renderer does not mux an audio track. Compositions with sound render silent; add audio downstream in your pipeline.

The API is a hosted-build feature, and it is plan-gated. The open-source local edition has no backend to call, and a free account cannot mint keys. Quotas, rate limits and the numbers your plan enforces are in Plans, quotas & limits — and GET /v1/usage is always the authority over any table.

Start with the quickstart

Upload a project, send the inputs, collect the MP4. You need Premation to build the composition in the first place — everything after that is HTTP.