Skip to main content
When a request fails, use its HTTP status and structured problem body to decide what to do next. Errors returned by API handlers use Content-Type: application/problem+json. The public hosting layer can reject unrecognized paths with a 404 without a problem body, so check the status and content type before parsing an error as JSON.

Problem fields

Do not expect an error to use an endpoint’s success envelope. For example, a failed search returns a problem object, rather than a populated error field alongside data.

Validation errors

If you omit the search query or pass an invalid NIF to a company lookup, the problem includes an errors array. Each entry contains a field and a message. This example shows the response to an authenticated search without q:

Error reference

The identifiers below are suffixes of the type URL. An empty search result is a successful 200 response, not company-not-found.

Timeouts and upstream outages

Your directory search has a five-second service deadline; your company lookup has a 30-second service deadline. These deadlines begin after API-key admission. Authentication and network overhead can add to your total request time. If both company-data providers fail and you have an available cached record, you can receive 200 with data.stale: true instead of an upstream error. Check data.updated_at before using it. Database failures can still return an error even when a company was previously cached. See Get a company for the fallback behavior.

Retry behavior

Correct validation and authentication failures before retrying. For temporary server errors, use a bounded retry policy with increasing delays. For 429, follow Limits and credits and distinguish rate exhaustion from credit exhaustion. An admitted company request may already have consumed a credit even if it returned an error. Each admitted retry consumes another credit.