Error Codes
The Patholytix API uses standard HTTP status codes and returns machine-readable error responses in RFC 9457 Problem Details format.
Error response format
All error responses have Content-Type: application/problem+json and follow this structure:
{
"type": "https://api.patholytix.com/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "The 'name' field must be between 10 and 255 characters.",
"instance": "/api/v1/studies"
}
| Field | Type | Description |
|---|---|---|
type | string (URI) | Machine-readable error type identifier |
title | string | Short, human-readable summary of the error type |
status | integer | HTTP status code |
detail | string | Human-readable explanation specific to this occurrence |
instance | string | The request URI that caused the error |
HTTP status codes
| Status | When it occurs |
|---|---|
200 OK | Request succeeded |
204 No Content | Request succeeded with no response body (e.g. DELETE) |
400 Bad Request | Malformed request — invalid JSON, missing required fields, constraint violations |
401 Unauthorized | Token is missing, expired, or has an invalid signature |
403 Forbidden | Token is valid but lacks the required scope |
404 Not Found | The requested resource does not exist |
409 Conflict | The request conflicts with existing state (e.g. duplicate name) |
410 Gone | The API version has been retired — use a current version |
422 Unprocessable Entity | Request is syntactically valid but semantically invalid |
500 Internal Server Error | Unexpected server error — contact support if this persists |
Common errors
401 Unauthorized
{
"type": "https://api.patholytix.com/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "The provided token has expired.",
"instance": "/api/v1/studies"
}
Resolution: Request a new access token via POST /oauth/token. See Authentication.
403 Forbidden
{
"type": "https://api.patholytix.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Insufficient scope. Required: STUDY_WRITE.",
"instance": "/api/v1/studies"
}
Resolution: Your client does not have the required scope. Contact your Deciphex account representative to update your client's role bundles.
400 Bad Request
{
"type": "https://api.patholytix.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Required field 'name' is missing.",
"instance": "/api/v1/studies"
}
Resolution: Check the request body against the API Reference and ensure all required fields are present.
422 Unprocessable Entity
{
"type": "https://api.patholytix.com/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "The 'name' field must be between 10 and 255 characters. Received: 'Hi' (2 characters).",
"instance": "/api/v1/studies"
}
Resolution: The value provided failed a business rule validation. Review the constraint documented in the API Reference for the affected field.
404 Not Found
{
"type": "https://api.patholytix.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Study '5cd97ae75fdbf7000143cb30' does not exist.",
"instance": "/api/v1/studies/5cd97ae75fdbf7000143cb30"
}
Resolution: Verify the ID is correct. The resource may have been deleted.
Error handling in code
Python
import requests
resp = requests.get(
"https://api.dev.patholytix.com/api/v1/studies",
headers={"Authorization": f"Bearer {token}"}
)
if not resp.ok:
error = resp.json()
print(f"Error {error['status']}: {error['title']}")
print(f"Detail: {error['detail']}")
resp.raise_for_status()
curl
curl -s -o response.json -w "%{http_code}" \
"https://api.dev.patholytix.com/api/v1/studies" \
-H "Authorization: Bearer YOUR_TOKEN"