API Status Codes and Error Handling

Display APIs use standardized HTTP status codes and error response fields so applications can consistently determine request outcomes, identify failures, and decide how to handle a response.

HTTP status codes

Use the HTTP status code as the primary indicator of the overall request outcome.

CodeDescriptionHow to handle it
200 OKRequest completed successfully.Process normally. Valid list requests with no matches return an empty result set.
201 CreatedA resource was created successfully.Process the created resource or returned identifier.
202 AcceptedAn asynchronous request was accepted but is not complete.Use returned job/status information to check completion.
204 No ContentRequest completed successfully with no response body.Treat as success; do not parse a body.
206 Partial ContentOnly part of the requested content is available.Process returned content and inspect unavailable content.
207 Multi-StatusA bulk request contains mixed item-level outcomes.Evaluate each item independently; do not treat the entire response as failed.
400 Bad RequestMalformed request or request/field validation failure.Use error information to correct the request before retrying.
401 UnauthorizedAuthentication is missing, invalid, or expired.Obtain valid authentication and retry.
403 ForbiddenCaller is authenticated but lacks required access.Verify access; do not retry unchanged unless access changes.
404 Not FoundRequested resource does not exist or is not accessible.Verify the resource identifier or path.
409 ConflictRequest conflicts with resource state, readiness, or uniqueness.Resolve the conflicting condition before retrying.
410 GoneA previously valid resource is permanently unavailable or expired.Do not retry the same resource reference.
429 Too Many RequestsAPI rate limit has been exceeded.Honor Retry-After and use backoff.
500 Internal Server ErrorUnexpected server-side failure.Retry when appropriate for the operation and use backoff. Follow the support process if the issue persists.
503 Service UnavailableThe service is temporarily unavailable, overloaded, or undergoing a transient disruption.Retry with backoff when the operation is safe to retry. Honor Retry-After when it is returned.
520The gateway received an unexpected or unrecognized response from an upstream service.Treat as a transient infrastructure failure. Retry with backoff when the operation is safe to retry.
521The gateway could not establish a connection to the upstream service.Treat as a transient infrastructure failure. Retry with backoff when the operation is safe to retry.

Error Handling

When an API returns an error, first use the HTTP status code to determine the type of failure. Then inspect the response body for additional information about what failed.

Error responses can include the following fields:

FieldDescription
codeIndicates the outcome of the request or item, such as success or failure.
detailsMachine-readable result or error codes. Use these codes for programmatic error handling.
messageOptional high-level, human-readable summary of the error.
errorsStructured diagnostics for a failed item. When present, use errorType for the error condition, field for the affected request field when applicable, and description for an explanation of the error and, when available, guidance on how to resolve it.

Example error response

{ "code": "failure", "details": ["ERROR_CODE"], "message": "One or more errors occurred.", "errors": [ { "field": "fieldName", "errorType": "ERROR_CODE", "description": "Explanation of the error and, when available, how to resolve it." }
]
}

Exact fields can vary by endpoint and error condition. See the endpoint's API Reference for the complete response schema.

Bulk and partial responses

Some APIs process multiple items in a single request. When a bulk request returns mixed outcomes, evaluate each item in the response independently. Successful items contain the fields defined for that endpoint's successful response, while failed items include error information describing the individual failure.

Do not treat a mixed-outcome response as a failure of every item. Process successful items normally and use the error information returned for failed items to determine the appropriate next action.

Response schemas vary by endpoint. See the endpoint Guide for workflow-specific response behavior and examples, and the API Reference for the exact response fields and schema.

Retry guidance

ResponseGeneral guidance
400, 403, 404, 410Do not retry unchanged. Correct the request, access, or resource reference first.
409Retry only after the conflicting state or condition changes.
429Wait for the Retry-After duration before retrying.
5xx, including 503Retry with backoff when the operation is safe to retry. Honor Retry-After when provided.
520, 521Treat as transient infrastructure failures and retry with backoff when the operation is safe to retry.

API Reference

This guide describes common behavior across Display APIs. For an endpoint's exact supported HTTP responses, response schema, field types, optionality, and examples, see that endpoint in API Reference.



Did this page help you?