> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amplemarket.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors and Compatibility

> How to navigate the API responses.

# Handling Errors

Amplemarket uses convention HTTP response codes to indicate the success or failure of an API request.

Some errors that could be handled programmatically include an [error code](#error-codes) that briefly describes the reported error. When this happens, you can find details within the response under the field `_errors`.

## Error Object

An error object MAY have the following members, and MUST contain at least on of:

* `id` (string) - a unique identifier for this particular occurrence of the problem

* `status` (string) - the HTTP status code applicable to this problem

* `code` (string) - an application-specific [error code](#error-codes)

* `title` (string) - human-readable summary of the problem that SHOULD NOT
  change from occurrence to occurrence of the problem, except for purposes of localization

* `detail` (string) - a human-readable explanation specific to this occurrence of the problem, and can be localized

* `source` (object) - an object containing references to the primary source of the error which **SHOULD** include one of the following members or be omitted:
  * `pointer`: a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) to the value in the request document that caused the error (e.g. `"/data"` for a primary data object, or `"/data/attributes/title"` for a specific attribute). This **MUST** point to a value in the request document that exists; if it doesn’t, then client **SHOULD** simply ignore the pointer.

  * `parameter`: a string indicating which URI query parameter caused the error.

  * `header`: a string indicating the name of a single request header which caused the error.

Example:

```js theme={null}
{
	"_errors":[
		{
			"status":"400",
			"code": "unsupported_value",
			"title": "Unsupported Value",
			"detail": "Number of emails exceeds 100000 limit"
			"source": {
				"pointer": "/emails"
			}
		}
	]
}
```

## Error Codes

The following error codes may be returned by the API:

| code                             | title                         | Description                                                                                                                              |
| -------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| internal\_server\_error          | Internal Server Error         | An unexpected error occurred                                                                                                             |
| insufficient\_credits            | Insufficient Credits          | The account doesn’t have enough credits to continue the operation                                                                        |
| person\_not\_found               | Person Not Found              | A matching person was not found in our database                                                                                          |
| unavailable\_for\_legal\_reasons | Unavailable For Legal Reasons | A matching person was found in our database, but has been removed due to privacy reasons                                                 |
| unsupported\_value               | Unsupported Value             | Request has a field containing a value unsupported by the operation; more details within the corresponding [error object](#error-object) |
| missing\_field                   | Missing Field                 | Request is missing a mandatory field; more details within the corresponding [error object](#error-object)                                |
| unauthorized                     | Unauthorized                  | The API credentials used are either invalid, or the user is not authorized to perform the operation                                      |

# Compatibility

When receiving data from Amplemarket please take into consideration that adding fields to the JSON output is considered a backwards-compatible change and it may happen without prior warning or through explicit versioning.

<Tip>It is recommended to future proof your code so that it disregards all JSON fields you don't actually use.</Tip>
