# API reference

> The Design API: addresses, authentication, errors and limits.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/api/

For agents: Design API at https://design.api.sypnia.com/v1 (engine: <base URL>/v1). Auth: Authorization: Bearer <Sypnia session or token>; token scopes read, write (drafts, proposals, renders, exports), admin (keys, repository link); approving proposals and screens needs a person's session (tokens get 403 person_required). Error shape {error {code, message}}; 400 invalid_request/invalid_file, 401 unauthorized, 403 forbidden/person_required, 404 not_found, 409 conflict/out_of_date (guide version moved), 413 too_large, 415 type_not_allowed, 422 check_failed/contrast_failed/unsafe_svg/font_licence_missing, 429 rate_limited (retry-after), 402 insufficient_credits.

API: `https://design.api.sypnia.com/v1` **\[Cloud]**, or your engine's address **\[Engine]**.

## Authentication

`Authorization: Bearer <session or token>`. Tokens belong to a project and have scopes: `read` (guide, gallery, screens, checks), `write` (drafts, proposals, renders, exports, uploads), `admin` (tokens and the repository link). **Approving** a proposal or a screen needs a person's session; a token gets `403 person_required`.

## Errors

```json
{ "error": { "code": "contrast_failed", "message": "color.ink-quiet on color.surface is 3.9:1; text needs 4.5:1." } }
```

| Status | Codes                                                                   |
| ------ | ----------------------------------------------------------------------- |
| 400    | `invalid_request`, `invalid_file`                                       |
| 401    | `unauthorized`                                                          |
| 402    | `insufficient_credits`                                                  |
| 403    | `forbidden`, `person_required`                                          |
| 404    | `not_found`                                                             |
| 409    | `conflict`, `out_of_date` (the guide moved on since your proposal)      |
| 413    | `too_large`                                                             |
| 415    | `type_not_allowed`                                                      |
| 422    | `check_failed`, `contrast_failed`, `unsafe_svg`, `font_licence_missing` |
| 429    | `rate_limited` (with `retry-after`)                                     |

Limits are on [Limits](https://design.docs.sypnia.com/reference/limits).

- [Endpoints](/api/endpoints/): Guide, proposals, assets, icons, gallery, screens, renders, exports, checks and tokens.
