# Error Handling

All Zotlo API endpoints use a unified error response format.\
Successful requests return **HTTP 200**, while failed requests return **HTTP 400** or **HTTP 500**.

## Failed Response Format

{% code overflow="wrap" %}

```json
{
  "meta": {
    "requestId": "app2.domain-REQ-5e73a811d5d",
    "httpStatus": 400,
    "errorMessage": "Subscriber profile not found.",
    "errorCode": 400009
  },
  "result": []
}
```

{% endcode %}

## Failed Response Fields

<table><thead><tr><th width="193.19921875">Field</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>Unique request identifier generated by Zotlo.</td></tr><tr><td>httpStatus</td><td>HTTP status code (<code>400</code>,<code>500</code>).</td></tr><tr><td>errorMessage</td><td>Localized error message.</td></tr><tr><td>errorCode</td><td>Zotlo-specific error code (<code>400008</code>, <code>400009</code>, etc.).</td></tr><tr><td>result</td><td>Empty or error-specific content.</td></tr></tbody></table>

## **General Error Rules**

* All successful responses always return **HTTP 200**, even if business logic fails (e.g., subscription canceled).
* Technical failures return **HTTP 400** or **HTTP 500**.
* Error messages respect the `Language` header you send.
* Retry logic is recommended only for **500000** or network errors.

## Common Error Codes

<table><thead><tr><th width="193.19921875">Code</th><th>Meaning</th></tr></thead><tbody><tr><td>404001</td><td>Invalid endpoint</td></tr><tr><td>401002</td><td>Invalid AccessKey or AccessSecret</td></tr><tr><td>400008</td><td>Invalid subscriberId</td></tr><tr><td>400009</td><td>Subscriber profile not found</td></tr><tr><td>500000</td><td>Internal server error</td></tr></tbody></table>

{% hint style="info" %}
**Tip for Debugging**

Save the requestId value, our support team can use it to locate the exact log for any API call.
{% endhint %}
