API documentation
With the API, your system creates animations and downloads the finished files without anyone opening the app. It's part of the Agency plan, and each animation costs one credit, just like in the app.
Get started
Create a key under API keys in your account. The key is only shown once. Send it as a Bearer token with every request. All endpoints are under https://motipop.com.
Create an animation
POST /api/v1/animations
The request returns immediately with 202 and an id. The animation itself is generated and rendered afterwards.
curl -X POST https://motipop.com/api/v1/animations \
-H "Authorization: Bearer $MOTIPOP_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ordre-1042" \
-d '{
"templateId": "offer",
"brandUrl": "https://dinbutik.dk",
"inputs": {
"headline": "Nytårsudsalg",
"subline": "Op til 40 % på alt"
},
"formats": [
"mp4",
"gif"
],
"aspectRatios": [
"1:1",
"9:16"
]
}'HTTP/1.1 202 Accepted
{
"id": "3f2b2f4e-4f3a-4b8e-9a43-0c4c2a8d9a10",
"status": "generating",
"templateId": "offer",
"brandId": "9c1d6a52-6a47-4e0c-9a2b-7a5d3b1f0e44",
"watermark": false,
"formats": [
"mp4",
"gif"
],
"aspectRatios": [
"1:1",
"9:16"
],
"createdAt": "2026-12-02T08:15:00.000Z",
"finishedAt": null,
"error": null,
"renders": [
{
"id": null,
"format": "mp4",
"aspectRatio": "1:1",
"status": "queued",
"error": null,
"downloadUrl": null,
"downloadUrlExpiresAt": null
}
]
}Request fields
templateId- The template id, e.g. offer.
brandId / brandUrl- Either brandId (a brand in your team) or brandUrl (a website we read the logo, colours and fonts from and save as a new brand).
inputs- The template's texts as key-value pairs.
images- Up to 6 images as public https URLs.
formats- One or more of mp4, webm, gif and png. Default is mp4.
aspectRatios- One or more of 1:1, 4:5, 9:16 and 16:9. Default is 1:1.
locale- da, en, de, sv or nb: the language of the texts in the video (your inputs are translated if they are in another language). Leave it out and the texts keep the language they are written in (until December 2026 they were then written in Danish).
Get status and files
GET /api/v1/animations/:id
Poll the id until the status is completed or failed. Each file has its own status and a signed download URL that works for 5 minutes. Request the URL again if it has expired.
curl https://motipop.com/api/v1/animations/3f2b2f4e-4f3a-4b8e-9a43-0c4c2a8d9a10 \
-H "Authorization: Bearer $MOTIPOP_API_KEY"{
"id": "3f2b2f4e-4f3a-4b8e-9a43-0c4c2a8d9a10",
"status": "completed",
"finishedAt": "2026-12-02T08:16:12.000Z",
"renders": [
{
"id": "b1e0f6c2-2d1e-4c43-8f3c-1f0f7a9b2d11",
"format": "mp4",
"aspectRatio": "1:1",
"status": "done",
"error": null,
"downloadUrl": "https://…/renders/3f2b…/b1e0….mp4?X-Amz-Signature=…",
"downloadUrlExpiresAt": "2026-12-02T08:21:12.000Z"
}
]
}Status
generating- Claude is writing the animation.
rendering- The files are queued or being made.
completed- All files are finished and at least one succeeded.
failed- The animation couldn't be made and the credit was refunded, or every file failed.
Retry without paying twice
Send an Idempotency-Key header with POST. The same key with the same body returns the original id and doesn't use another credit. The same key with a different body returns 422.
Limits
By default, each key can send 30 requests a minute and create 200 animations a day. Responses include RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset, and on 429 the Retry-After header tells you how long to wait.
Webhook
Give the key a webhook URL and you'll get a POST when an animation is finished (animation.ready) or has failed (animation.failed). The message is signed with the key's secret in the Motipop-Signature header: t=timestamp,v1=HMAC-SHA256 of the timestamp, a dot and the raw body. Respond with 2xx. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 hours and 12 hours. The message contains no download URLs: fetch them with GET.
{
"id": "evt_5d2f…",
"type": "animation.ready",
"createdAt": "2026-12-02T08:16:12.000Z",
"data": {
"id": "3f2b2f4e-4f3a-4b8e-9a43-0c4c2a8d9a10",
"status": "completed"
}
}Verify the signature
import { createHmac, timingSafeEqual } from 'node:crypto';
// rawBody: the body exactly as received (not parsed and serialised again)
export function isFromMotipop(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false; // too old
const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest();
const given = Buffer.from(parts.v1 ?? '', 'hex');
return given.length === expected.length && timingSafeEqual(given, expected);
}Errors
Every error has the same shape: a code your program can check and a message for humans.
{
"error": {
"code": "insufficient_credits",
"message": "The team has no credits left.",
"pricingUrl": "/pricing"
}
}The main codes
missing_api_key- No key in the Authorization header (401).
invalid_api_key- The key doesn't exist (401).
api_key_revoked- The key has been revoked (401).
plan_required- The team doesn't have the Agency plan (403).
insufficient_credits- No credits left (402).
invalid_request- The request body is invalid (400).
rate_limited- Too many requests per minute (429).
daily_limit_reached- Daily animation limit reached (429).