HTTP Status Codes
The EMIS-X FHIR API uses standard HTTP status codes in conjunction with HL7 FHIR
OperationOutcome resources to indicate request success or describe failure
details.
Success Status Codes
Section titled “Success Status Codes”| Status Code | Description | Typical Usage |
|---|---|---|
200 OK |
Request succeeded | Returned for successful GET queries, single-resource reads, and searchset bundles. |
Client Error Status Codes
Section titled “Client Error Status Codes”| Status Code | Description | Meaning and Recommended Action |
|---|---|---|
400 Bad Request |
Invalid query or payload | The request URL, headers, or parameters are malformed. Inspect the returned OperationOutcome for specific validation issue details. |
401 Unauthorized |
Missing or invalid auth token | The Authorization header is missing, expired, or cryptographically invalid. Request a new token via OAuth 2.0. |
403 Forbidden |
Insufficient scopes or permissions | The token is valid, but the caller lacks the required scopes, role, or organisation access rights. |
404 Not Found |
Resource or route not found | The requested resource ID, patient ERN, or endpoint path does not exist. |
406 Not Acceptable |
Unsupported Accept header | The caller requested a content type that cannot be served. Use application/fhir+json or application/fhir+xml. |
415 Unsupported Media Type |
Unsupported Content-Type | The request payload content type is unsupported. Use application/fhir+json or application/fhir+xml. |
422 Unprocessable Entity |
Semantic or FHIR validation error | The request syntax is valid, but payload data violates FHIR constraints or clinical business rules. |
Server Error Status Codes
Section titled “Server Error Status Codes”| Status Code | Description | Meaning and Recommended Action |
|---|---|---|
500 Internal Server Error |
Unexpected server error | An unhandled exception occurred within the platform. Check the diagnostics element in the OperationOutcome for an incident tracking ID. |
502 Bad Gateway |
Upstream service failure | An upstream service or database failed to respond properly. |
503 Service Unavailable |
Service temporarily unavailable | The service is undergoing maintenance or experiencing temporary load. Retry with exponential backoff. |
504 Gateway Timeout |
Upstream service timeout | An upstream dependency took too long to complete. Retry with backoff. |
OperationOutcome Structure
Section titled “OperationOutcome Structure”When an error occurs (HTTP 4xx or 5xx), the platform returns a FHIR
OperationOutcome resource describing the failure:
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-found", "details": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/operation-outcome", "code": "MSG_NO_MATCH", "display": "No resource found matching criteria" } ], "text": "Resource Condition/a2aa38e2-0738-4ba0-a8aa-f2faaf6ad0de not found." }, "diagnostics": "CorrelationId: e2a893c5-9271-46ab-a021-93a8d11cbe28" } ]}Issue Properties
Section titled “Issue Properties”severity: Severity level of the issue (fatal,error,warning,information).code: Standard FHIR issue type code (such asinvalid,not-found,security,transient,exception).details.text: Human-readable description of the error.diagnostics: Diagnostics information, including the request correlation ID for support and troubleshooting.