List a batch job's results

GET/lang2fhir/batch/{job_id}/results

A lighter status page. Returns the same per-item status entries as GET /lang2fhir/batch/{job_id}, but without the job record or counts, and the entries carry result_size rather than any result content. Use each entry's item_id to fetch that item's result from GET /lang2fhir/batch/{job_id}/results/{item_id}.

Entries are listed in a stable order that is not upload order and is the same across pages. Match each entry to your own records by its id (your correlation label) or item_id (from the upload response), never by position.

RequiresBearerauthentication

Path parameters

job_idstringrequired

Query parameters

cursorstringoptional

Opaque pagination cursor from a previous page's next_cursor.

limitintegeroptionaldefault 20

Page size. Defaults to 20; values above 100 are clamped to 100.

Returns  

A page of per-item result statuses

Response fields

resultsobject[]required
item_idstringrequired

Server-assigned opaque item ID, used in result URLs.

idstringoptional

The caller's correlation label, echoed back; omitted when none was supplied.

statusstringrequired

Item status.

pendingprocessingsucceededfailed
attemptsintegerrequired

Number of processing attempts so far. An item runs up to 3 attempts, and only an interruption — a worker preemption or a recovered internal error — is retried; a conversion error fails the item with no retry.

detect_retriesinteger (int64)optional

How many times concept detection was re-run for the item because a pass returned no concepts. Present only on a succeeded item whose detection re-ran at least once; omitted otherwise.

result_sizeinteger (int64)optional

Size in bytes of the item's stored result. Present once the item has succeeded.

errorobjectoptional

A job- or item-level failure. Never contains document or patient content.

kindstringrequired

Short stable token to branch on. Item-level kinds: invalid_input (the stored body was not a valid create/document request), processing_failed (the conversion failed), budget_exceeded (the item ran past its time budget — 600s for a document item, 450s for a create item), result_too_large (the result exceeded the storage cap), input_unavailable (the input could not be read), and retries_exhausted / attempts_exhausted (buried after too many failed attempts). Job-level kinds: timeout (the job did not finish within 36 hours of creation).

messagestringrequired

Human-readable description of the failure.

completed_atstring (date-time)optional

When the item finished. Absent until then.

next_cursorstringoptional

Cursor for the next page, when has_more is true.

has_morebooleanrequired

Whether more results remain beyond this page.

GETRequest
# Get authentication token
PHENOML_TOKEN=$(curl -X POST "https://experiment.app.pheno.ml/v2/auth/token" \
  -u "$PHENOML_CLIENT_ID:$PHENOML_CLIENT_SECRET" \
  | jq -r '.access_token')

curl -X GET "https://experiment.app.pheno.ml/lang2fhir/batch/abc-123-def-456/results?cursor=example&limit=20" \
  -H "Authorization: Bearer $PHENOML_TOKEN"
200 OKExample Response
{
  "results": [
    {
      "item_id": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "id": "chart-note-0042",
      "status": "succeeded",
      "attempts": 1,
      "detect_retries": 1,
      "result_size": 20482,
      "error": {
        "kind": "processing_failed",
        "message": "the item could not be converted"
      },
      "completed_at": "2024-01-15T09:30:00Z"
    }
  ],
  "next_cursor": "<cursor>",
  "has_more": false
}