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

# Errors

> How SQR API errors are structured and what status codes to expect.

All error responses return JSON with an `error` field:

```json theme={null}
{
  "error": "Record not found"
}
```

## Status codes

| Code  | Meaning                                               |
| ----- | ----------------------------------------------------- |
| `200` | Success                                               |
| `201` | Created (new record or API key)                       |
| `400` | Bad request — missing or invalid parameters           |
| `403` | Forbidden — invalid or missing auth token             |
| `404` | Not found — record, template, or key doesn't exist    |
| `409` | Conflict — record already owned (adopt)               |
| `429` | Rate limited — slow down                              |
| `500` | Internal server error                                 |
| `503` | Service unavailable — Web3 or database not configured |

## Common errors

### Missing image on record creation

```json theme={null}
{
  "error": "Image is required"
}
```

Ensure you're sending the image as a multipart file or base64 string in the `image` field.

### Invalid auth token

```json theme={null}
{
  "error": "Invalid or expired token"
}
```

Check that your API key is active and correctly formatted in the `Authorization: Bearer` header.

### Record already minted

```json theme={null}
{
  "error": "Record is already minted"
}
```

You can only mint once per record. Use the `/claim` endpoint to transfer ownership.
