> For the complete documentation index, see [llms.txt](https://docs.zero.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zero.inc/developers/api/errors.md).

# Errors

A failed request returns an error status with a JSON body whose `error` field holds the message. Most errors the request itself can fix also carry:

* `code`: a stable, machine readable reason, such as `unknown_field`, `invalid_operator_value`, `invalid_value` or `not_null_violation`. Match on `code` rather than on the message.
* `path`: the part of the request at fault, such as `where.stage.$in`, `fields.nme` or `workspaceId`.
* `hint`: how to fix the request, such as the value shape an operator expects or a "did you mean" suggestion.

```json
{
  "error": "Field or relation nme doesn't exist on model companies",
  "code": "unknown_field",
  "path": "where.nme",
  "hint": "Did you mean \"name\"?"
}
```

| Status | When                                                                                                                                                                                                                                                                                                                                                                 |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | The request cannot run as sent: an unknown field in `fields`, `where` or `orderBy`, an operator given a value of the wrong shape, a value the request sent that does not match its field's type (such as an id that is not a UUID), or a required field the request left out or set to `null`.                                                                       |
| `403`  | The request filters on, sorts or groups by, aggregates, or reads inside a field the token may not access (`private_field`, `masked_field`), or writes to a workspace the token is not a member of. A private field named on its own in `fields` answers `400 unknown_field` instead, as if it did not exist.                                                         |
| `409`  | A record in the same workspace already has the value the request wrote to a field that is unique within the workspace (`unique_violation`). A value that must be unique across all workspaces, such as a user's email address, answers `500` instead, and so does a duplicate in a model whose records only some members of the workspace can read, such as `chats`. |
| `500`  | Something failed on Zero's side, including a database error the request did not cause. Such a body can still carry a `code`.                                                                                                                                                                                                                                         |
| `503`  | The database schema is briefly behind the API, usually during a deploy (`schema_out_of_date`). The request is fine as sent: retry it shortly.                                                                                                                                                                                                                        |
| `504`  | The query timed out (`query_timeout`). Narrow `where`, request fewer `fields`, or lower `limit`.                                                                                                                                                                                                                                                                     |

Database errors answer `400` or `409` only on the record endpoints (`/api/{model}`), where the query runs on exactly what the request sent. Other endpoints answer such an error with `500`. `503` and `504` apply on every endpoint.

A list response can also carry a `warnings` array next to `data`, naming parts of the request the API ignored or changed instead of rejecting. Each warning has a `code`, a `path` and a `message`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zero.inc/developers/api/errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
