Handling Atlas Errors

Handling Atlas Errors

Understand Atlas API error responses including HTTP status codes, error structure, and how to handle authentication, payload, resource, and server errors.

Atlas uses standard HTTP status codes to communicate request outcomes. Generally:

Structure of an Atlas Error

Most Atlas errors follow the structure below:

JSON

{
  "requestId": "f006ad7b-096c-4254-8c7e-2d23a55b0b0e",
  "requestTimestamp": "2025-09-04 11:49:40",
  "message": "The given data was invalid.",
  "errors": {},
  "statusCode": 422
}
Field Type Description
requestId string Unique identifier for the request. Include this when contacting support.
requestTimestamp string Timestamp when the error occurred (UTC).
message string Description of the error.
errors object Detailed validation errors or additional error context.
statusCode integer HTTP status code indicating the error type.

Handling Atlas Errors

Your integration should always check the HTTP status code first and read the top-level message for a quick summary of the error. Additionally, you can inspect the errors for field-level or contextual details and log the requestId to simplify debugging and support requests.

Authentication Errors

Authentication-related failures occur when Atlas cannot verify your identity or permissions. It usually fails with a 401 Unauthorized status code and can indicate a missing, malformed, or invalid API key/token.

When you encounter this kind of error, it is important to do the following before retrying the request:

If the techniques above do not work and you still receive the error, contact support to escalate your issues.

Payload Errors

These are the most common category of errors you can encounter on Atlas. It happens when the payload you are sending in your request does not match the one Atlas is expecting.

Common errors and status codes in this category include:

When you encounter this kind of error, it is important to do the following before retrying the request:

If the techniques above do not work and you still receive the error, contact support to escalate your issues.

Resource Errors

These errors occur when the requested resource does not exist or cannot be accessed.

Common errors and status codes in this category include:

When you encounter this kind of error, it is important to do the following before retrying the request:

If the techniques above do not work and you still receive the error, contact support to escalate your issues.

Server Errors

Server errors indicate a failure on Atlas’s side.

Common errors and status codes in this category include:

When you encounter 5xx errors, the only thing you can do is to retry the request with exponential backoff while we fix things on our end.

If your request involves write operations use idempotency keys to avoid applying a change multiple times.

If these errors persist, contact support and include the requestId.