---
title: "Errors"
description: "Problem details and the error codes the API returns."
---

Every error is a JSON **problem details** body (`application/problem+json`) with the HTTP status, a title and a stable `code`. Validation errors add `errors` per field.

```json title="422 response"
{
  "status": 422,
  "title": "The request has invalid fields.",
  "code": "validation",
  "errors": {
    "seats": ["Use a number from 1 to 10000."]
  }
}
```

Branch on `code`, not on the title: titles may be reworded.

## Error codes

| Status | Code | What to do |
| --- | --- | --- |
| 401 | `invalid-token` | The token is missing, expired or not for this API. Get a new one. |
| 401 | `client-not-active` | The client is disabled, deleted or its secret expired. Check it in **API access**. |
| 403 | `scope-required` | Give the client the scope this call needs. |
| 403 | `plan-required` | Your organisation's plan doesn't include this. |
| 403 | `gateway-required` | Call the API at https://vnext-api.cloudlabs.ai. |
| 404 | `not-found` | No such lab, attendee, course or enrollment in your organisation. |
| 409 | `attendee-refused` | The lab can't take this attendee now (full, closed or ended). |
| 409 | `lab-not-ready` | Fix the lab's readiness blockers before publishing (`GET /v1/labs/{labId}/readiness`). |
| 409 | `lab-refused` | The lab can't take this change now. |
| 409 | `idempotency-conflict` | This `Idempotency-Key` was used with a different request. |
| 422 | `validation` | Fix the fields listed in `errors`. |
| 429 | `rate-limited` | Wait for `Retry-After` seconds. See [Rate limits and quotas](/api/rate-limits-and-quotas). |
| 500 | `server-error` | Try again in a minute. |
| 503 | `unavailable` | CloudLabs couldn't check access just now. Try again in a minute. |

:::tip
Log the response's status, `code` and the time of the call. Support can find the request from them.
:::
