---
title: Errors
section: API
order: 9
---

# Errors

Every error from `/api/v1` is an RFC 9457 problem document with the content type
`application/problem+json`:

```json
{
  "type": "https://gridtac.com/docs/api/errors#mfa_required",
  "title": "Two-factor sign-in required",
  "status": 403,
  "detail": "API keys need an account with two-factor authentication on, …",
  "code": "mfa_required"
}
```

Branch on `code`. `title` and `detail` are for people and may be reworded.

## Codes

| Code | Status | Meaning |
|---|---|---|
| `key_required` | 401 | No `Authorization: Bearer gt_…` header. |
| `invalid_key` | 401 | The key is wrong, malformed or does not exist. |
| `key_revoked` | 401 / 409 | The key was revoked. |
| `key_expired` | 401 | The key's game ended more than 24 hours ago, or the key has passed its expiry. |
| `rate_limited` | 429 | Over this key's per-minute budget for this kind of call. `Retry-After` and `retryAfterSec` say when the window resets. |
| `key_paused` | 403 | Paused automatically, for example after too many requests. `retryAfterSec` says for how long. |
| `key_blocked` | 403 | Blocked by an administrator. |
| `mfa_required` | 403 | The key's owner has no second factor (see [Authentication](authentication.md)). |
| `key_owner_lost` | 403 | The person who made the key no longer holds the place that gave it its powers: moved to another side, no longer commander or game master, kicked, or suspended. It works again if that changes back. |
| `unauthorized` | 401 | Managing keys needs a signed-in session. |
| `reauth_required` | 401 | Creating or rotating a key needs a sign-in from the last 15 minutes. |
| `invalid_body` | 400 | The request body is wrong; `issues` lists each problem with its `path`. |
| `wrong_key_kind` | 403 | This call needs another kind of key (for example the dashboard needs `gt_dash_`). |
| `kind_not_creatable` | 400 | Prop and gateway keys come from pairing a device, and spectator links from the game page, not from this call. |
| `team_required` | 400 | A team key needs a `teamId`. |
| `game_not_found` | 404 | No such game. |
| `team_not_found` | 404 | No such team in this game. |
| `key_not_found` | 404 | No such key, or not one you may manage. |
| `forbidden` | 403 | You may not create this kind of key in this game. |
| `not_in_game` | 403 | A player key needs you to play in the game, or the player behind the key has left it. |
| `player_devices_off` | 403 | The game master has turned off player devices for this game. Reading still works. |
| `unavailable` | 503 | The live link is briefly unavailable; try again in a few seconds. |
| `no_side` | 409 | The player behind this key is not on a side yet. |
| `marks_not_allowed` | 403 | The game's marker rule does not let this player place marks (the game master chooses who may). |
| `not_your_mark` | 403 | That mark belongs to someone else; you may change or remove only your own. |
| `order_not_found` | 404 | No such order for this player: it does not exist, or it was not sent to you. |
| `game_ended` | 409 | The game has ended: keys cannot be created for it, and players cannot write to it. |
| `game_key_limit` | 409 | The game already has 10 team and dashboard keys; revoke one first. |
| `too_many_keys` | 429 | More than 10 new keys in an hour. `retryAfterSec` says when to try again. |
| `webhook_not_found` | 404 | No such webhook for this key: it does not exist, was removed, or another key made it. |
| `webhook_limit` | 409 | This key already has 5 webhooks; remove one first. |
| `url_not_allowed` | 400 | The webhook URL is not `https://` on the public internet (`detail` says why). |
| `device_not_found` | 404 | No such device among yours or your clubs'. |
| `device_key_scope` | 403 | A beacon's own key sends position, status and SOS only: it cannot read the player view, place marks or acknowledge orders. |
| `too_many_devices` | 429 | At most 10 new devices an hour per account. |
| `device_limit` | 409 | At most 20 devices per account, 200 per club; unpair one first. |
| `beacon_limit` | 409 | That player already has a beacon in this game; take the other one out first. |
| `game_device_limit` | 409 | At most 100 props in one game; take one out first. |
| `pairing_not_found` | 404 | No pairing with that code: mistyped, already used, or never started. |
| `pairing_expired` | 410 | The pairing code is older than 10 minutes; start pairing again on the device. |
| `not_your_player` | 403 | Your own beacon is for you; a club beacon is lent only to a member of the club. |
