Quickstart
This guide takes you from an API key to a finished MP4 on disk. You need an account on the Agency plan and a few minutes while the video renders.
-
Get an API key
In the app, open Account > API keys, create a key and copy it. Then store it in an environment variable so it stays out of your code:
Terminal window export REIGNITOR_API_KEY="emp_..."See Authentication for details.
-
Check the key
Call
GET /v1/me. A200means the key works. The response also shows your credit balance.Terminal window curl https://reignitor.com/v1/me \-H "Authorization: Bearer $REIGNITOR_API_KEY"const BASE = 'https://reignitor.com';const headers = { Authorization: `Bearer ${process.env.REIGNITOR_API_KEY}` };const res = await fetch(`${BASE}/v1/me`, { headers });console.log(res.status, await res.json());import os, requestsBASE = "https://reignitor.com"headers = {"Authorization": f"Bearer {os.environ['REIGNITOR_API_KEY']}"}res = requests.get(f"{BASE}/v1/me", headers=headers)print(res.status_code, res.json()){"user_id": "3f1c2a9e-8b7d-4c1e-9f0a-2d6b5e4c3a21","email": "dev@example.com","name": "Sam","credits_remaining": 42} -
Start a video
Call
POST /v1/renderwith abrief. Reignitor plans the scenes and starts the render. Send anIdempotency-Keywith a fresh value, so a network retry cannot start the same video twice.Terminal window curl https://reignitor.com/v1/render \-H "Authorization: Bearer $REIGNITOR_API_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: $(uuidgen)" \-d '{"brief": "A 20 second advert for Northwind Coffee, a small-batch roaster. Warm, early-morning mood. End on the line: Roasted this week, at your door by Friday.","kind": "ad","duration_sec": 20,"aspect": "9:16","quality": "draft"}'import { randomUUID } from 'node:crypto';const res = await fetch(`${BASE}/v1/render`, {method: 'POST',headers: {...headers,'Content-Type': 'application/json','Idempotency-Key': randomUUID(),},body: JSON.stringify({brief: 'A 20 second advert for Northwind Coffee, a small-batch roaster. Warm, early-morning mood. End on the line: Roasted this week, at your door by Friday.',kind: 'ad',duration_sec: 20,aspect: '9:16',quality: 'draft',}),});const job = await res.json();if (res.status !== 202) throw new Error(`${res.status} ${job.code}: ${job.error}`);console.log(job.job_id);import uuidres = requests.post(f"{BASE}/v1/render",headers={**headers, "Idempotency-Key": str(uuid.uuid4())},json={"brief": "A 20 second advert for Northwind Coffee, a small-batch roaster. ""Warm, early-morning mood. End on the line: ""Roasted this week, at your door by Friday.","kind": "ad","duration_sec": 20,"aspect": "9:16","quality": "draft",},)job = res.json()if res.status_code != 202:raise RuntimeError(f"{res.status_code} {job.get('code')}: {job['error']}")print(job["job_id"])You get
202 Acceptedand ajob_id:{"job_id": "7d2e4b10-5c3a-4f8e-a1b2-9c0d8e7f6a54","status": "starting","title": "Northwind Coffee, at your door by Friday","scenes": 4,"credits_used": 12,"watermarked": false,"poll_url": "/v1/job/7d2e4b10-5c3a-4f8e-a1b2-9c0d8e7f6a54","note": "Render started. Poll poll_url, or subscribe to video.completed via POST /api/webhooks/hooks."} -
Wait for the job to finish
Poll
GET /v1/job/{id}every few seconds untilstatusissucceeded,failedorcancelled. A render usually takes a few minutes.Terminal window JOB_ID="7d2e4b10-5c3a-4f8e-a1b2-9c0d8e7f6a54"while true; doJOB=$(curl -s "https://reignitor.com/v1/job/$JOB_ID" \-H "Authorization: Bearer $REIGNITOR_API_KEY")STATUS=$(echo "$JOB" | jq -r .status)echo "$STATUS $(echo "$JOB" | jq -r .progress)%"case "$STATUS" in succeeded|failed|cancelled) break ;; esacsleep 10doneecho "$JOB"const FINAL = new Set(['succeeded', 'failed', 'cancelled']);let result;while (true) {const res = await fetch(`${BASE}/v1/job/${job.job_id}`, { headers });result = await res.json();console.log(result.status, `${result.progress}%`);if (FINAL.has(result.status)) break;await new Promise((r) => setTimeout(r, 10_000));}if (result.status !== 'succeeded') throw new Error(result.error ?? result.status);import timeFINAL = {"succeeded", "failed", "cancelled"}while True:result = requests.get(f"{BASE}/v1/job/{job['job_id']}", headers=headers).json()print(result["status"], f"{result['progress']}%")if result["status"] in FINAL:breaktime.sleep(10)if result["status"] != "succeeded":raise RuntimeError(result["error"] or result["status"])A finished job looks like this:
{"job_id": "7d2e4b10-5c3a-4f8e-a1b2-9c0d8e7f6a54","status": "succeeded","progress": 100,"video_url": "https://cdn.example.com/exports/7d2e4b10.mp4","error": null}Rather than polling, you can subscribe a webhook to
video.completed. -
Download the video
video_urlis a direct link to the MP4. Download it and store it on your side.Terminal window curl -L -o northwind.mp4 "$(echo "$JOB" | jq -r .video_url)"import { writeFile } from 'node:fs/promises';const video = await fetch(result.video_url);await writeFile('northwind.mp4', Buffer.from(await video.arrayBuffer()));video = requests.get(result["video_url"])video.raise_for_status()with open("northwind.mp4", "wb") as f:f.write(video.content)
If something goes wrong
Section titled “If something goes wrong”401: check the key and theBearerprefix. See Authentication.402: the account is not on the Agency plan, or is out of credits. Readcode.422 BRAND_REQUIREDorNO_ANCHOR, or400 PRESENTER_REQUIRED: the render needs a brand, a product photo or a presenter. See Making videos.429: slow down. See Limits.
Every status and code is listed in Errors.
Next steps
Section titled “Next steps”- Making videos: brand kits, product photos, scene plans and training videos.
- Webhooks: get a signed callback when a video is ready.
- Create render reference: every field.