Skip to main content

Errors

The Batch API uses standard HTTP status codes. Errors return application/problem+json (RFC 9457), except the token endpoint, which returns OAuth errors.

{
"type": "https://docs.amorphous.health/errors/invalid-request",
"title": "Invalid request",
"status": 422,
"detail": "Document content exceeds 1 MiB.",
"instance": "/v1/data-engine/batches/7c9e6679-7425-40de-944b-e07fc1f90ae7/documents",
"requestId": "req_...",
"errors": [
{
"pointer": "/documents/0/content",
"code": "payload_too_large",
"detail": "Maximum inline document size is 1 MiB."
}
]
}

Handle errors by status and errors[].code. detail is for people and can change.

Problem Fields​

FieldDescription
typeURI for the problem type
titleShort summary of status
statusHTTP status code
detailExplanation for this occurrence
instanceRequest path
requestIdMatches the Request-Id header
existingBatchIdOn a create conflict, the batch that already uses externalReference
errorsField errors, each with pointer, code, and detail

Status Codes​

StatusMeaning
400 Bad RequestThe body or query is malformed
401 UnauthorizedThe token is missing, expired, or invalid
403 ForbiddenThe token lacks a scope, the caller IP is not allowed, the organization is suspended, or a test token called /fhir/R4
404 Not FoundThe ID does not exist for your organization
409 ConflictThe batch is in the wrong state, a retry does not match, externalReference is taken, or live processing is not enabled
413 Content Too LargeThe body exceeds the route limit
415 Unsupported Media TypeThe media type is not supported or does not match the document
422 Unprocessable ContentA field is invalid. See errors
429 Too Many RequestsRate limited. Wait for Retry-After
503 Service UnavailableTemporary failure. Retry with backoff

Document Errors​

A failed document has error.code and error.message. The message is safe to show to users.

CodeMeaning
checksum_mismatchThe uploaded file does not match checksumSha256
content_missingThe file was never uploaded
unsupported_contentThe file could not be read as its mediaType
conversion_emptyThe file contains no text
pipeline_failedExtraction failed
not_processedThe document was not processed in time

Token Errors​

POST /oauth/token returns OAuth 2.0 errors (RFC 6749) as application/json.

{ "error": "invalid_client", "error_description": "Client authentication failed." }
errorStatusMeaning
invalid_request400grant_type is missing, or both Basic and an assertion were sent
unsupported_grant_type400grant_type is not client_credentials
invalid_scope400A scope is not granted to the client
invalid_grant400The assertion has no jti or reuses one
invalid_client401Unknown client, wrong secret, invalid assertion, or disabled client
temporarily_unavailable429Too many requests or failed attempts. Wait for Retry-After