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

# Errors

Treevox uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the `5xx` range indicate an error with Treevox's servers (these are rare).

Some `4xx` errors that could be handled programmatically include an [error code](/api/error-codes.md) that briefly explains the error reported.

### Object error

{% tabs %}
{% tab title="JSON" %}

```json
{
    "timestamp": "2021-11-18T14:54:56.626Z",
    "message": "Validation failed",
    "code": "bad_request",
    "errors": [
        {
            "property": "name_property",
            "validator": {
                "isNumber": "limit must be a number"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="192.83552621774749">Name</th><th width="150" data-type="checkbox">Required</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>timestamp</td><td>true</td><td>String</td><td>Error date</td></tr><tr><td>message</td><td>true</td><td>String</td><td>A human-readable message providing more details about the error.</td></tr><tr><td>code</td><td>true</td><td>String</td><td>For some errors that could be handled programmatically, a short string indicating the <a href="/api/error-codes.md">error code</a> reported.</td></tr><tr><td>errors</td><td>false</td><td>Array&#x3C;Object></td><td>Detailed description of the request errors. This field may be empty.  When <strong><code>code</code></strong> is <strong><code>bad_request</code></strong>, <strong><code>errors</code></strong> contains the list of errors</td></tr><tr><td>errors[].property</td><td>true</td><td>String</td><td>Property that is generating the error</td></tr><tr><td>errors[].validator</td><td>true</td><td>Object</td><td><strong><code>Key</code></strong> would be the name of the validator, <strong><code>value</code></strong> would be the error message </td></tr></tbody></table>

### HTTP status code summary

{% tabs %}
{% tab title="Text" %}

```http
200 - OK	         Everything worked as expected.
400 - Bad Request	 The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized	 No valid API key provided.
403 - Forbidden	         The API key doesn't have permissions to perform the request.
404 - Not Found	         The requested resource doesn't exist.
409 - Conflict	         The request conflicts with another request
429 - Too Many Requests	 Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
5xx - Server Errors	 Something went wrong on Treevox's end. (These are rare.)
```

{% endtab %}
{% endtabs %}
