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

# Errors

> Troubleshoot problems with this comprehensive breakdown of all error codes.

## Error Schema

We use standard HTTP response codes for success and failure notifications.

```json theme={null}
{
  "success": false,
  "error": {
    "code": 400,
    "timestamp": "2024-01-01T00:00:00.000Z",
    "message": "User-friendly error message",
    "details": "error/error_code"
  }
}
```

| Field             | Type            | Description                      |
| ----------------- | --------------- | -------------------------------- |
| `success`         | boolean         | Always `false` for errors        |
| `error.code`      | number          | HTTP status code                 |
| `error.timestamp` | string          | ISO 8601 timestamp               |
| `error.message`   | string          | Human-readable error description |
| `error.details`   | string or array | Error code or validation details |

<Note>
  For validation errors (400), `details` contains an array of field-specific errors. For all other errors, `details` is a string error code.
</Note>

***

## `validation_error`

* **Status:** 400
* **Message:** Invalid request parameters.
* **Suggested action:** Check the `details` array for specific field errors. Ensure all required fields are included and properly formatted.

```json theme={null}
{
  "success": false,
  "error": {
    "code": 400,
    "timestamp": "2024-01-01T00:00:00.000Z",
    "message": "Invalid request parameters.",
    "details": [
      {
        "code": "validation/missing-user_id",
        "message": "user_id is required."
      }
    ]
  }
}
```

***

## `missing_api_key`

* **Status:** 401
* **Message:** Authentication required.
* **Suggested action:** Include the Authorization header: `Authorization: Bearer leo_xxxxxxxxx`

***

## `invalid_api_key`

* **Status:** 403
* **Message:** Insufficient permissions.
* **Suggested action:** Verify your API key has the required permissions for this endpoint.

***

## `not_found`

* **Status:** 404
* **Message:** Resource not found.
* **Suggested action:** Verify the resource UUID is correct and the resource exists.

***

## `duplicate_resource`

* **Status:** 409
* **Message:** Resource already exists.
* **Suggested action:** Check for existing resources before creating duplicates.

***

## `rate_limit_exceeded`

* **Status:** 429
* **Message:** Rate limit exceeded.
* **Suggested action:** Reduce request frequency. Implement exponential backoff. Contact support if you need higher limits.

***

## `internal_server_error`

* **Status:** 500
* **Message:** Internal server error.
* **Suggested action:** Retry the request after a brief delay. If the error persists, contact support.
