> For the complete documentation index, see [llms.txt](https://docs.omypayments.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.omypayments.com/api/api-endpoints/swaps/error-format.md).

# Error format

**Missing / invalid API key**

```json
{
  "success": false,
  "message": "Missing api key",
  "statusCode": 0
}
```

Include the `apiKey` header in every request. [docs.omypayments.com/api/authentication](https://docs.omypayments.com/api/authentication)

**Validation error (`400 Bad Request`)**

```json
{
  "success": false,
  "message": "Validation error",
  "errors": [
    {
      "field": "amount",
      "messages": ["Invalid value format"]
    }
  ]
}
```

**No permission (`403 Forbidden`)**

The API key does not have the **swap** permission enabled.

```json
{
  "success": false,
  "message": "You have no permissions for this action",
  "statusCode": 403
}
```

**Internal error (`500`)**

```json
{
  "success": false,
  "message": "Internal Server Error",
  "statusCode": 500
}
```
