# API reference

> The Skills API: addresses, authentication, scopes, errors and limits.

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

For agents: Skills API https://skills.api.sypnia.com/v1 (self-hosted: <registry>/v1). Public reads need no auth. Authorization: Bearer <token>: a Sypnia session (CLI/console), a token with scopes read (private skills of an org), publish (one skill or a publisher), admin (publisher settings, tokens, trusted publishers), or a short-lived trusted-publishing token. Agent tokens: 403 person_required for public listing, majors, yank, visibility changes. Errors {error {code, message, findings?}}: 400 invalid_request, invalid_package; 401 unauthorized; 403 forbidden, person_required; 404 not_found; 409 version_exists, name_taken; 410 removed; 413 too_large; 422 check_failed (findings), touches_need_major, name_reserved, name_confusable; 429 rate_limited (retry-after); 402 insufficient_credits. Pagination cursor + limit (max 100).

API: `https://skills.api.sypnia.com/v1` **\[Cloud]**, or `<your registry>/v1` **\[Engine]**.

## Authentication

Reading public skills needs nothing. Everything else takes `Authorization: Bearer <token>`:

| Token                      | Can                                                                                      |
| -------------------------- | ---------------------------------------------------------------------------------------- |
| A Sypnia session           | what the signed-in person can do: the CLI after `npx @sypnia/app login`, and the console |
| `read`                     | read and download an organization's private skills                                       |
| `publish`                  | publish versions of one skill, or of every skill of a publisher                          |
| `admin`                    | change a publisher's settings, members, tokens and trusted publishers                    |
| A trusted-publishing token | publish one skill from its linked repository; lasts minutes                              |

Tokens are created with an expiry. Some actions need a **person**: listing a skill publicly, publishing a new major of a public skill, yanking and changing visibility. A token used by an agent gets `403 person_required` for those.

## Errors

```json
{ "error": { "code": "check_failed", "message": "1 check failed. Run: skills check ./espiga-pos-import", "findings": [{ "check": "manifest", "file": "scripts/clean.sh", "message": "not declared in touches.scripts" }] } }
```

| Status | Codes                                                                    |
| ------ | ------------------------------------------------------------------------ |
| 400    | `invalid_request`, `invalid_package`                                     |
| 401    | `unauthorized`                                                           |
| 402    | `insufficient_credits`                                                   |
| 403    | `forbidden`, `person_required`                                           |
| 404    | `not_found`                                                              |
| 409    | `version_exists`, `name_taken`                                           |
| 410    | `removed`                                                                |
| 413    | `too_large`                                                              |
| 422    | `check_failed`, `touches_need_major`, `name_reserved`, `name_confusable` |
| 429    | `rate_limited` (with `retry-after`)                                      |

## Lists

Lists take `limit` (up to 100, default 20) and `cursor`, and answer `{ items, next }`. Limits are on [Limits](https://skills.docs.sypnia.com/reference/limits).

- [Endpoints](/api/endpoints/): Skills, versions, downloads, resolving, publishers, tokens, trusted publishing, reports and keys.
