Skip to content
Last updated

Errors

Error format

Failed requests return a non-2xx status and a JSON body:

{
  "error": "Bad Request",
  "message": "Sample 'MySample' not found"
}

error is the status category. message is a human-readable explanation meant to be shown to whoever fixes the input. Don't parse it for program logic: its wording can change between releases.

Status codes

StatusMeaningRetry?
400The request is invalid: a missing field, an unknown panel, a duplicate name, files not found. message says whichNo. Fix the request
401Missing, invalid or expired tokenLog in again, then retry once
403The token is valid, but this user can't access this resourceNo
404The case, report or variant doesn't exist in your organizationNo
429Rate limit exceededYes, after the Retry-After header's number of seconds
5xxServer errorYes, with exponential backoff

Partial success inside a 200

Some batch and multi-step endpoints return 200 even when part of the work failed, and report the failure in the body. Always check these fields:

EndpointCheck
Generate report from workbenchEach entry in reports has its own error
Publish reporterror in the response
Signed report filedownload_link is null and error explains why
Analysis statusAn unknown ID comes back with status: "INVALID" instead of failing the call
Rename case order, Copy as skeletonsuccess and error

v1 and v2 endpoints validate differently

Where an endpoint has a v2, prefer it: v2 validates the whole request up front and says exactly what's wrong. v2/shell_case/create checks panel names, the assay, duplicate sample and case names, family relations and the assignee before creating anything. v2/shell_case/link names the exact missing files and the buckets it searched.

One difference changes behavior, not just the message:

assigned_to isn't a user in your organizationResult
v1/shell_case/createSilently ignored. The case is created unassigned
v2/shell_case/create400 Invalid assignedTo email: …, and no case is created

Each endpoint's reference page lists its common error messages with examples.

Retry safely

Creating cases isn't idempotent. If a create call times out, the case may still have been created. Look it up by name with status by name before retrying.

import time

def call_with_retry(client, method, path, attempts=5, **kwargs):
    for attempt in range(attempts):
        r = client.request(method, path, **kwargs)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", 60)))
        elif r.status_code >= 500:
            time.sleep(2 ** attempt)
        else:
            return r
    return r