Skip to main content

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"
}
FieldTypeDescription
typestring (URI)Machine-readable error type identifier
titlestringShort, human-readable summary of the error type
statusintegerHTTP status code
detailstringHuman-readable explanation specific to this occurrence
instancestringThe request URI that caused the error

HTTP status codes

StatusWhen it occurs
200 OKRequest succeeded
204 No ContentRequest succeeded with no response body (e.g. DELETE)
400 Bad RequestMalformed request — invalid JSON, missing required fields, constraint violations
401 UnauthorizedToken is missing, expired, or has an invalid signature
403 ForbiddenToken is valid but lacks the required scope
404 Not FoundThe requested resource does not exist
409 ConflictThe request conflicts with existing state (e.g. duplicate name)
410 GoneThe API version has been retired — use a current version
422 Unprocessable EntityRequest is syntactically valid but semantically invalid
500 Internal Server ErrorUnexpected 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"