---
title: "Track a Video Job with Polling | Rendley API Docs"
description: "Long-running AI and export operations return jobs. Learn the job lifecycle, poll safely, and read the finished output."
url: https://docs.rendley.com/api/polling/
---

# Jobs and polling

AI generation and transformation requests, along with exports, return a **job id** and continue in the background. Poll the job until it finishes.

Image generation, transcription and exports share the same lifecycle. One polling loop covers all of them.

## The loop

1. Call an endpoint. It returns `{ "data": { "job_id": "..." } }`.
2. `GET /v1/jobs/{id}` every few seconds.
3. When `status` is `completed`, read `output.url`.

The completed job carries the download URL. There is no second call to resolve the file.

The agent has its own job system

Everything on this page covers `/v1/jobs/{id}`, which handles generation and exports. The automated editing agent runs on `/v1/agent/jobs/{id}` with its own statuses: `pending`, `running`, `waiting_input`, `completed`, `failed`, `canceled`. The two are not interchangeable. See [Automated editing](https://docs.rendley.com/api/automated-editing/).

## Status values

| Status | Terminal | Meaning |
| --- | --- | --- |
| `queued` | no | Accepted, waiting for a worker. |
| `processing` | no | A worker is running it. |
| `completed` | yes | Finished. Read `output`. |
| `failed` | yes | Did not finish. Read `error`. |
| `canceled` | yes | Canceled with `DELETE /v1/jobs/{id}`. |

Poll until the status is one of the three terminal values, waiting a few seconds between calls. Processing time varies by model, source length, output settings, and provider capacity.

## The completed job

```
{
  "data": {
    "id": "c41d8f2b-7a63-4e09-bd15-8f3a29c7e604",
    "type": "generate_video",
    "status": "completed",
    "output": {
      "url": "https://cdn.rendley.com/generated/video.mp4?signature=...",
      "url_expires_at": "2026-08-31T15:00:00Z",
      "media_id": "c448b6e3-2b78-4bda-b369-d1afc6aec07f",
      "file_hash": "c6c8ec4f9a6fdd9d",
      "mime_type": "video/mp4",
      "size": 4823104,
      "duration": 5
    }
  }
}
```

`id`string

The job id you polled.

`type`string

What the job did, e.g. generate_video, transcription, export_video.

`status`string

One of queued, processing, completed, failed, canceled.

`output`object | null

The result. Present once the job completes.

`url`string

Signed download URL for the generated file.

`url_expires_at`string

When that URL stops working. Poll the job again for a fresh one.

`media_id`string

The stored file, as a UUID. Use it to reference the output in a later call.

`file_hash`string

The engine's XXH64 content hash, 16 hex characters.

`mime_type`string

Content type of the generated file.

`size`number

File size in bytes.

`duration`number

Duration in seconds, for audio and video when it is known. Exports can leave it out.

`error`string | null

Why the job failed. Null unless the status is failed.

`result_data`string | null

The raw worker result, as a JSON string. output is the parsed, url-resolved version of it. Read output.

The job also carries `input_data`, `acknowledged`, `source_type` and `source_id`. They are bookkeeping for the Rendley app, not something an API integration needs.

`output.url` is a time-limited signed link. Download the file soon after the job completes, or re-poll the job for a fresh URL. Do not store the URL itself.

## A polling loop

```
const API_KEY = "YOUR_API_KEY";
const API = "https://api.rendley.com/v1";

const headers = { "Authorization": "Bearer " + API_KEY };

function sleep(ms) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}

async function waitForJob(jobId) {
  let job = { status: "queued" };

  while (job.status === "queued" || job.status === "processing") {
    await sleep(5000);

    const response = await fetch(`${API}/jobs/${jobId}`, { headers });

    if (!response.ok) {
      throw new Error("Job lookup failed: " + response.status);
    }

    job = (await response.json()).data;
  }

  if (job.status !== "completed") {
    throw new Error("Job " + job.status + ": " + (job.error || ""));
  }

  return job;
}
```

```
import time
import requests

API_KEY = "YOUR_API_KEY"
API = "https://api.rendley.com/v1"

HEADERS = {"Authorization": f"Bearer {API_KEY}"}

def wait_for_job(job_id):
    job = {"status": "queued"}

    while job["status"] in ("queued", "processing"):
        time.sleep(5)

        response = requests.get(f"{API}/jobs/{job_id}", headers=HEADERS)
        response.raise_for_status()
        job = response.json()["data"]

    if job["status"] != "completed":
        raise RuntimeError(f"Job {job['status']}: {job.get('error', '')}")

    return job
```

## Listing and canceling

`GET /v1/jobs` returns your recent jobs, newest first, capped at 200. It omits the `output` object. Fetch a single job when you need the download URL.

`DELETE /v1/jobs/{id}` cancels a job that is still `queued` or `processing`. It returns `200` either way, so read the job back to confirm the status changed. A job that already finished keeps its status. Canceled jobs are not deleted. They move to `canceled` and stay readable.

## When a job fails

A failed job carries a human-readable `error`. Common causes:

| Cause | What to do |
| --- | --- |
| Invalid `params` for the model | Check the model’s schema on its capability page. Parameters differ per model. |
| A referenced file is missing or unreadable | Confirm the `media_id` or URL you passed is reachable. |
| The provider rejected the request | Content policy or an unsupported input. The message says which. |

## Status codes

| Code | Meaning |
| --- | --- |
| `200` | The request was accepted. For generation, the body carries the `job_id`. |
| `400` | The body is invalid, or the account is out of credits (`NOT_ENOUGH_CREDITS`). Most billable endpoints have a `/cost` twin that prices a call first. |
| `401` | Missing or invalid API key. |
| `402` | A monthly plan quota is exhausted. Upgrade the plan. |
| `404` | No such job, or it is not yours. |

[Previous pageAuthentication](https://docs.rendley.com/api/authentication/) [Next pageErrors and retries](https://docs.rendley.com/api/errors/)
