> For the complete documentation index, see [llms.txt](https://docs.companies.zone/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.companies.zone/api-docs/general/error-handling.md).

# Error Handling

Where an error occurs, it will usually be returned in the following format:

```json
{
    "code": 400,
    "error": "BAD_REQUEST",
    "message": "Unable to parse timestamp"
}
```

Where an error is the result of invalid user input and there is only one parameter to the API call, BAD\_REQUEST will usually be returned in the error field. Otherwise, a more specific error may be returned. The possible error values are documented in the documentation for the specific API methods. Only code and error should be used for automatic error handling, and the message field is meant to be displayed to application end users. You should not attempt to parse the message field automatically as its contents for any specific error may change at any time.

Where an unexpected internal error occurs, it will be returned in the following format:

```json
{
    "code": 500,
    "error": "INTERNAL_ERROR",
    "message": "An internal error occured and was automatically reported",
    "error_id": "306845bc7abe489ca094330fb3b36da0"
}
```

The error ID can be tied to an auto-reported exception internally and can be given to us when reporting a bug for easier debugging. It is simply a random ID and does not contain information that is useful for anyone other than our team.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.companies.zone/api-docs/general/error-handling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
