Skip to content
dhanu docs
Browse pages

API reference

Read a job

GET /api/pub/v1/jobs/{jobId}, follow background work the API started for you until it succeeds or fails.

GEThttps://api.dhanu.ai/api/pub/v1/jobs/{jobId}

Anything that takes longer than a request, a video render, an export, returns 202 at once with a job, and finishes in the background. Read the job until status is succeeded or failed, or subscribe to the job.succeeded and job.failed webhooks and skip polling entirely.

Request

Path parameterTypeRequiredNotes
jobIdstringYes
curl https://api.dhanu.ai/api/pub/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer $DHANU_API_KEY"
const job = await dhanu.jobs.get(jobId);

// or block until it finishes (polls every 2 s, up to 10 min)
const done = await dhanu.jobs.wait(jobId);
job = dhanu.jobs.get(job_id)

# or block until it finishes
done = dhanu.jobs.wait(job_id)

Response

200 OK

{
  "job": {
    "id": "…",
    "type": "video.generate",
    "status": "succeeded",
    "result": { "videoId": "…" },
    "error": null,
    "createdAt": "2026-09-17T10:15:00.000Z",
    "completedAt": "2026-09-17T10:18:12.000Z"
  }
}

status moves queued → running → succeeded | failed (or cancelled). result is set on success and error on failure; both are null until then.

Errors

CodeStatusMeaning
invalid_api_key401The bearer key is missing or unknown.
api_key_revoked401The key was revoked.
api_key_expired401The key passed its expiry date.
api_key_ip_not_allowed403The caller's IP is outside the key's allowlist.
developer_access_revoked403The key's creator lost developer access in the workspace.
api_key_project_scope403The key covers no active projects, or projectId is outside its scope.
not_found404No such resource in the key's workspace.

The full list is on Errors.