# Errors & limits

How the API reports problems, the shape of an error answer, and how many requests you can make. Handle errors by their HTTP status and `error` code, and back off when you hit a rate limit.

## HTTP status codes

| Code | Meaning |
|---|---|
| 200 | Success |
| 201 / 202 | Created / accepted (for example an update waiting for review) |
| 400 | Validation error — a required parameter is missing or malformed |
| 401 | Invalid or missing API key |
| 403 | The token does not have the permission this endpoint needs |
| 404 | Resource not found (also returned for an invalid purchase code) |
| 409 | Conflict — for example an update of this item is already waiting for review |
| 422 | The request was understood but refused — the `error` field says why |
| 429 | Rate limit exceeded — wait and retry |

## Error shape

```json
{
  "status": "error",
  "error": "pending_update",
  "msg": "This item already has an update waiting for review."
}
```

Older read endpoints return only `status` and `msg`. Write endpoints add a machine-readable `error` code — branch on it, never on the message text.

## Rate limits

| Scope | Limit |
|---|---|
| Every token | 60 requests per minute |
| Write calls (`PATCH` items, changelogs, start / complete uploads) | 30 per minute |
| Upload parts | 240 part URLs or 120 relay chunks per minute |
| Licence endpoints | see [Licence activation](https://sellmycode.net/api-docs/licence-activation.md#limits) |
| Toolkit endpoints | 60 per minute |

Invalid keys share one bucket per IP address (30 per 10 minutes) — a script that keeps sending a wrong key is blocked for a while.

---
Source: https://sellmycode.net/api-docs/errors
