# API Codes

When something goes wrong, the API returns a JSON object with a `code` and a `message` explaining what happened.

### Error Response Format

```json
{
    "code": "ERROR_CODE",
    "message": "Human-readable error description"
}
```

### Error Codes

| Code                     | HTTP Status | Description                                                                                                                           |
| ------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `UNAUTHORIZED`           | 401         | Session expired or invalid token. Log in again.                                                                                       |
| `FORBIDDEN`              | 403         | Your account does not have the required permission. Contact your account administrator.                                               |
| `NOT_FOUND`              | 404         | The ticket or resource does not exist. Double-check the ID.                                                                           |
| `DEPOSIT_NOT_REVIEWABLE` | 400         | The deposit cannot be flagged for review. It may not exist, belong to another merchant, or not enough time has passed since creation. |
| `INVALID_DOCUMENT`       | 400         | Invalid file or document type when uploading an attachment.                                                                           |

{% hint style="info" %}
If you receive a `401 UNAUTHORIZED` error, your session has expired. Simply call the Login Endpoint again to get a new BEARER\_TOKEN.
{% endhint %}

### Required Capabilities

Some endpoints require specific capabilities assigned to your user account. If you receive a `403 FORBIDDEN` error, contact your account administrator to verify your permissions.

| Capability             | Required for                      |
| ---------------------- | --------------------------------- |
| `TICKETS_CREATE`       | Creating draft tickets            |
| `TICKETS_CONFIRM`      | Confirming and submitting tickets |
| `DEPOSITS_FLAG_REVIEW` | Flagging deposits for review      |

{% hint style="warning" %}
If you are missing a capability, reach out to your account manager or contact our support team at `integration@lime-pay.com`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lime-pay.com/api-documentation/support-tickets-api/api-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
