Documentation

Overview

Use the service

Billing

Reference

Reference

GET /jobs/{jobId}

One capture item or one analytical job: its state, attempts and failure reason.

Syntax

GET https://grid-lab.zyxio.xyz/jobs/<jobId>
x-api-key: <key>

Request

NameWhereRequiredMeaning
x-api-keyheaderyes, or AuthorizationYour API key, or Authorization: Bearer <token> from Zyxio sign-in.
jobIdpathyesA capture item's id from GET /batches/{batchId}, or an analytical job's id, which starts with cj_.

Response

200 OK. For a capture item:

FieldMeaning
jobId, batchId, urlThe item, its batch and its URL.
statewaiting, prioritized, delayed (between attempts), active, completed or failed.
attemptsMadeAttempts so far; an item is tried up to three times.
failedReasonWhy the last attempt failed, or null.
artifactsThe storage names of the item's files. They are not downloadable as such; use GET /artifacts/{jobId}/{kind}.

For an analytical job (cj_...), the job record:

FieldMeaning
jobIdThe job's id.
phaseACCEPTED, QUEUED, PROVISIONING, RUNNING, PUBLISHING, SUCCEEDED, FAILED, TIMED_OUT or CANCELLED.
phaseTimestampsWhen the job entered each phase.
attempt, attemptsThe current attempt number and every attempt with its own phase, timestamps, termination and log availability.
terminationFor a finished attempt: class (workload, cancelled or platform), exitCode and reason.
imageDigestThe exact image that runs.
logs, logsTruncated, artifactsWhether the current attempt's log is published, and its size.

While job tracking is catching up, an analytical job's answer carries the header x-browsergrid-compute-degraded: reconciler-unready: the record may be a little behind, never wrong.

Errors

StatusBodyWhenWhat to do
401{"error": "unauthorized"}No credential, or a key that is revoked, expired, wrong, or of a suspended account.Send a valid key.
503{"error": "accounting_unavailable"}Your key or Zyxio sign-in could not be checked because the account database did not answer in time. Nothing was done.Retry shortly; the same request is safe to resend.
403{"error": "forbidden"}A valid Zyxio sign-in token whose identity has no account here, or whose account is suspended.Accept your invitation first, or use a key.
404{"error": "unknown job"}No such item or job, or it belongs to another identity.Check the id, and use the identity that created it.
503{"error": "COMPUTE_UNAVAILABLE"}Analytical jobs only: the job store did not answer in time.Retry after the retry-after seconds.

Example

curl -s https://grid-lab.zyxio.xyz/jobs/0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f \
  -H "x-api-key: $BROWSERGRID_API_KEY"
{
  "jobId": "0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f",
  "batchId": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b",
  "url": "https://example.com/",
  "state": "completed",
  "attemptsMade": 1,
  "failedReason": null,
  "artifacts": {
    "screenshot": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b/0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f/screenshot.png",
    "html": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b/0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f/page.html",
    "body": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b/0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f/body",
    "meta": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b/0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f/meta.json"
  }
}

Billing

Free.

See also

Captures, Analytical jobs, POST /jobs/{jobId}/retry.