# Errors (/growseller/docs/developers/errors)

The error format and the error codes of the API.

**What it's for:** knowing what went wrong and what to do next, from `error_code` and `details`.

Every error has the same JSON shape:

```json
{
  "success": false,
  "error": "The API shows at most 5 pages of 100 rows for one search. Narrow it with filters or search.",
  "error_code": "PAGE_LIMIT",
  "details": { "rows": 100, "pages": 5 },
  "timestamp": "2026-11-21T09:00:00Z"
}
```

`error_code` is what to write your code against. `error` is for people and may change. `details` is there when there is more to say.

## Error codes [#error-codes]

Every error's `details.docs_url` points to the section that explains it.

| HTTP | `error_code` | When |
| --- | --- | --- |
| 401 | `API_KEY_INVALID` | No credential, an unknown or deleted API key, or an expired OAuth token. |
| 403 | `PLAN_REQUIRED` | Your subscription has ended. |
| 403 | `SCOPE` | An OAuth token with the `read` scope tried to change something. |
| 403 | `FORBIDDEN` | No access to this store, or an action only its owner may do. |
| 404 | `NOT_IN_API` | The route stays in the dashboard (connecting stores and connectors, captchas, API keys, webhooks, exports, deleting stores, checkout): open `details.dashboard_url`. |
| 404 | `NOT_FOUND` | The thing does not exist or is not yours (an invitation's creator it does not hold too). |
| 409 | `INVALID_STATE`, `RUNNING` | The current state does not allow it: a job that is not running, a broadcast that is. |
| 422 | `PAGE_LIMIT` | A list past 5 pages or 100 rows, or an id range past 10,000 ids or row 50,000. |
| 422 | `VALIDATION_ERROR` | The request is not valid; `details.errors` names the fields. |
| 424 | `TIKTOK_ERROR` | TikTok refused or failed the call; `error` gives TikTok's reason. |
| 424 | `META_ERROR` | Meta (WhatsApp) refused the call, with Meta's reason and code. |
| 429 | `RATE_LIMITED` | A rate limit is reached; `details.limit` says which (`requests`, `rows`, `store`). See [Rate limits](/growseller/docs/developers/rate-limits). |
| 500 | `INTERNAL_ERROR` | Something went wrong on our side. Try again later. |

Feature routes answer their own codes too, such as `TRIAL_SEND_LIMIT` when a trial's sends of the day are used up.

## Validation [#validation]

A request is checked before anything runs, and refused with `422 VALIDATION_ERROR` when it is not what the route takes:

- A query parameter the route does not take, or a body field its model does not have, is refused (`details.unknown`, and `details.allowed` for query parameters: pick from it). A typo never widens what a call does.
- Ids (stores, templates, sets, creators' `creator_account_ids`) are UUIDs. Anything else is refused, in a path too.
- Fixed values (statuses, `mode`, `type`, `sort`, `scope`, `content_type`, job `kind`…) are matched in any case; any other value is refused with the allowed ones in `details.allowed` (and in the field's `details.errors[].ctx.allowed`).
- A selector is never widened by leaving it empty: `ids: []`, `platforms: []` or no `shop_id` on a store unblock is refused unless the body says `all: true`.
- Numbers in filters are at least 0, a `min_*` is never above its `max_*`, and flags are `true` or `false`.

A route that makes something answers `201`, one that starts a job `202`. A path that is no route answers `404 NOT_FOUND`, a method the route does not take `405 METHOD_NOT_ALLOWED`, and a conflict with the current state (a name already taken, a broadcast already running) `409`.

`details` is always an object. A request that does not pass the route's checks has `details.errors` (one entry a field: `loc`, `msg`, `type`, `ctx`), `details.docs_url`, and `details.allowed` or `details.unknown` when a value is not one the field takes or a field is not one the route has:

```json
{
  "success": false,
  "error": "Sort by must be one of: gmv_desc, gmv_asc, ….",
  "error_code": "VALIDATION_ERROR",
  "details": {
    "errors": [{ "type": "gs_choice", "loc": ["query", "sort_by"], "msg": "…", "ctx": { "allowed": ["gmv_desc", "…"] } }],
    "allowed": ["gmv_desc", "…"],
    "docs_url": "https://growpaces.com/growseller/docs/developers/errors#validation"
  }
}
```

## What to retry [#what-to-retry]

- `429`: wait `Retry-After` seconds, then retry.
- `424` and `500`: retry later, with backoff.
- `400`, `401`, `403`, `404`, `422`: the same request gets the same answer; change it first.