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 | Meaning | Retry? |
|---|---|---|
400 | The request is invalid: a missing field, an unknown panel, a duplicate name, files not found. message says which | No. Fix the request |
401 | Missing, invalid or expired token | Log in again, then retry once |
403 | The token is valid, but this user can't access this resource | No |
404 | The case, report or variant doesn't exist in your organization | No |
429 | Rate limit exceeded | Yes, after the Retry-After header's number of seconds |
5xx | Server error | Yes, with exponential backoff |
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:
| Endpoint | Check |
|---|---|
| Generate report from workbench | Each entry in reports has its own error |
| Publish report | error in the response |
| Signed report file | download_link is null and error explains why |
| Analysis status | An unknown ID comes back with status: "INVALID" instead of failing the call |
| Rename case order, Copy as skeleton | success and error |
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 organization | Result |
|---|---|
v1/shell_case/create | Silently ignored. The case is created unassigned |
v2/shell_case/create | 400 Invalid assignedTo email: …, and no case is created |
Each endpoint's reference page lists its common error messages with examples.
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