Error Responses

Our API uses standard HTTP status codes to indicate success or failure. All error responses return a structured JSON body that includes a code, message, and optionally, details.


Common HTTP Status Codes

CodeMeaningDescription
200OKRequest was successful.
201CreatedResource was successfully created.
400Bad RequestThe request is invalid (e.g., missing fields, invalid format).
401UnauthorizedInvalid or missing API key.
403ForbiddenAuthenticated, but not allowed to perform the operation.
404Not FoundResource not found or endpoint incorrect.
409ConflictDuplicate resource creation or logic conflict (e.g., reused idempotency key).
429Too Many RequestsRate limit exceeded.
500Internal Server ErrorAn unexpected server-side error occurred.
503Service UnavailableTemporary downtime or overload. Try again later.

Sample Error Response

{
  "code": "BAD_REQUEST",
  "message": "Missing required field: product_category",
  "details": {
    "field": "product_category",
    "expected_type": "string"
  },
  "request_id": "c749af13-5c99-4e3e-b43a-5cc2d94a8db2"
}

Debugging Tips

  • Check the code and message fields for immediate clarity on the error.
  • Use the request_id when contacting support to help trace the exact call.
  • Ensure your Content-Type is set to application/json and all required fields are included.

Handling Rate Limits

If you receive a 429 Too Many Requests, inspect the following response headers:

HeaderDescription
X-RateLimit-LimitMax requests per minute allowed
X-RateLimit-RemainingNumber of remaining requests in current window
X-RateLimit-ResetTime (Unix epoch) when the limit resets

You should back off and retry after the reset window.


Retrying Safely

For paid endpoints, we recommend using Idempotency Keys to prevent duplicate billing during retries.


Still Stuck?

If an error persists, contact us at support@antei.com and include:

  • The request_id from the response
  • Your API key type (live or sandbox)
  • A short description of what you were trying to do

We’re here to help.