# API Response Codes

This section outlines the standard response codes returned by our API. These codes provide information about what went wrong with a request and help developers diagnose and resolve issues effectively. Each code is accompanied by a human-readable message to assist in understanding the context of the error.

In every API response, you’ll find a `meta` object that contains the `code` and `message` fields. The `code` is a machine-readable identifier representing the result of the request, while the `message` provides a human-readable explanation of the code when applicable. A successful response typically includes a `code` of `1000` and a `message` of `null`. For error responses, the `code` corresponds to one of the values listed below, and the `message` will contain a descriptive explanation to help guide error handling.

## HTTP status and internal response codes

All AdFlex API responses return the fixed HTTP status `200 OK`, including application-level errors. Clients must inspect the internal `code` field in the response body to determine the actual result.

| HTTP Status | Internal Code | Meaning | Message |
|  --- | --- | --- | --- |
| 200 OK | `1000` | SUCCESS | null |
| 200 OK | `1001` | SOMETHING WENT WRONG | Something went wrong. Please try again later. |
| 200 OK | `1002` | BAD REQUEST | Bad Request |
| 200 OK | `1003` | NOT FOUND | Route not found. |
| 200 OK | `1004` | UNAUTHORIZED | UnAuthorized |
| 200 OK | `1005` | FORBIDDEN | Forbidden |
| 200 OK | `1006` | SERVICE UNAVAILABLE | Maintenance mode |
| 200 OK | `1007` | UNPROCESSABLE ENTITY | The given data is invalid. |
| 200 OK | `1009` | INTERNAL SERVER ERROR | Server Error |
| 200 OK | `1401` | REACH LIMIT CREDIT | You reached credit limit. |


> **Note:** The HTTP status is always `200 OK` and does not represent the application result. Always use the response-body `code` field for success and error handling.