Handling API Errors

Use this guide to decide what to do when a Company.info API request fails: correct the request, wait before retrying, or contact support.

This page covers common errors across the API Hub. For endpoint-specific errors, response formats, and exceptions, see the documentation for the API you are calling.

Read the error response

Start with the HTTP status code. If the response uses the JSON:API error format, the body contains an errors array. Read the error entries for more context:

  • status is the HTTP status represented as a string.
  • code identifies the error when the API documents a specific code. Some responses use the HTTP status as the code instead.
  • title and detail explain what went wrong. Do not match on their text in your integration unless the API explicitly documents a value as stable.
  • source, when present, can point to the request parameter or body field that caused the error.
  • links.type, when present, can link to documentation about the error.

Common errors

HTTP statusWhat to do
400 Bad RequestCheck the request parameters and body. Use the error details to identify what needs correcting before you try again.
401 UnauthorizedCheck that your API key is present and valid. See API Keys & Access.
403 ForbiddenCheck the error code. If it is quota_exceeded, stop sending requests to the affected API and do not retry automatically. For other 403 responses, check your key’s access and the API-specific documentation.
404 Not FoundVerify the endpoint and resource ID. Check the API documentation for what 404 means on that endpoint.
429 Too Many RequestsFor rate_limit_exceeded, wait at least as long as specified by Retry-After, then retry if safe and reduce your request rate.
500 Internal Server ErrorCheck the API-specific guidance. Do not assume every 500 is temporary. Retry only if the failure is likely transient and repeating the request is safe.
503 Service UnavailableFor temporary capacity limits capacity_exceeded) or maintenance, respect Retry-After when present. Retry only if repeating the request is safe.

For quota reset rules, usage headers, and examples of quota_exceeded, rate_limit_exceeded, and capacity_exceeded, see Quota & Rate Limits.

Retry safely

  • Correct invalid requests first. Do not retry the same request if its parameters, body, or credentials need to change.
  • Respect Retry-After. Wait at least as long as the header specifies before retrying. Use exponential backoff with a small random delay (jitter) for subsequent attempts, and set a maximum number of retries.
  • Be careful with requests that create or change resources. A timeout or server error does not necessarily mean the operation failed. Before repeating a request that places an order or creates a resource, check its outcome or follow the API’s documented retry procedure.

Find API-specific errors

For validation rules, business errors, and endpoint-specific exceptions, see the relevant API guide and API Reference.

Contact support

If an error persists, include the API and endpoint, the time of the request, the HTTP status, and the error code if available. Include the X-Correlation-Id response header when present so we can trace the request.

Do not share API keys or sensitive request or response data.


Did this page help you?