BrenzuriStart free
Job status endpoint
Reference

Job status endpoint

A snapshot of a job: its status, its steps and why it failed.

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 status is done, failed or cancelled. step is then absent and finishedAt is set.
  • paused is not finished: a step failed and the job waits to be retried, skipped or cancelled, by a person or by a key with the edit scope. See Jobs.
  • steps lists every step with todo, running, done or failed, 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 as write-es, and for a job that adds languages it starts with sources.
  • error.code is cancelled or the cause of a failure: fetch_timeout, too_few_origins, model_timeout, provider_error or other.
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 the job.done webhook.
  • 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.read instead.