Job status endpoint
On this page
GET /api/v1/jobs/{id} answers where a job is now. It is the route to use when you cannot hold an event stream open, for a cron job, a serverless function or a client that only does request and response. The full route description is under Jobs.
Poll until it settles #
curl "$BRENZURI_URL/api/v1/jobs/$JOB_ID" \
-H "Authorization: Bearer $BRENZURI_KEY"The job is finished when statusisdone,failedorcancelled.stepis then absent andfinishedAtis set.pausedis not finished: a step failed and the job waits to be retried, skipped or cancelled, by a person or by a key with theeditscope. See Jobs.stepslists every step withtodo,running,doneorfailed, and whether it is optional, so you can show progress without knowing the step names in advance. For a brief with language versions it includes the steps of each language, such aswrite-es, and for a job that adds languages it starts withsources.error.codeiscancelledor the cause of a failure:fetch_timeout,too_few_origins,model_timeout,provider_errororother.
const base = `${process.env.BRENZURI_URL}/api/v1`;
const headers = { Authorization: `Bearer ${process.env.BRENZURI_KEY}` };
async function waitFor(jobId) {
for (;;) {
const res = await fetch(`${base}/jobs/${jobId}`, { headers });
if (res.status === 429) {
await new Promise((r) => setTimeout(r, Number(res.headers.get('Retry-After') ?? 5) * 1000));
continue;
}
const job = await res.json();
if (['done', 'failed', 'cancelled'].includes(job.status)) return job;
await new Promise((r) => setTimeout(r, 4000));
}
}What it does not tell you #
It carries no credit figure and no balance. Whether a run is affordable is answered by POST /briefs/{id}/estimate; what a job cost is in thejob.donewebhook.A key or an agent sees article jobs and site reads only. Any other job is 404. MCP has no job tool. An agent polls article.readinstead.