# Endpoints

> Skills, versions, downloads, resolving, publishers, tokens, trusted publishing, reports and keys.

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

For agents: Endpoints: GET /skills?q=&kind=&label=&publisher=; GET|PATCH|DELETE /skills/{publisher}/{name}; GET /skills/{p}/{n}/versions; POST /skills/{p}/{n}/versions (package tar.gz, query visibility/tag → 202 {version, state}); GET /skills/{p}/{n}/versions/{v} (manifest, hash, signature, provenance, review, state); GET .../{v}/download (302 to immutable CDN URL); GET .../{v}/files/{path} (one file as text); POST .../{v}/yank {reason}, POST .../{v}/unyank; GET /skills/{p}/{n}/diff?from=&to=; POST /resolve {skills {id: range}} → versions + needs; POST /check (package → findings, stored nothing); GET|POST /publishers, GET|PATCH /publishers/{handle}, members; GET|POST /publishers/{handle}/tokens, DELETE /tokens/{id}; GET|POST /skills/{p}/{n}/trusted, DELETE .../trusted/{id}; POST /trusted/token (OIDC exchange); POST /reports; GET /keys (public signing keys); GET /skills/{p}/{n}/stats.

## Skills and versions

| Method and path                                                  | Does                                                                              |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `GET /skills?q=&kind=&label=&publisher=`                         | Search                                                                            |
| `GET /skills/{publisher}/{name}`                                 | The skill: publisher, labels, versions, last review                               |
| `PATCH /skills/{publisher}/{name}`                               | Change its description, homepage or visibility (`listed`, `unlisted`, `private`)  |
| `DELETE /skills/{publisher}/{name}`                              | Delete a skill no one else ever installed; otherwise yank its versions            |
| `GET /skills/{publisher}/{name}/versions`                        | Every version and its state                                                       |
| `POST /skills/{publisher}/{name}/versions?visibility=&tag=`      | Publish: the package as `application/gzip` → `202 { version, state: "checking" }` |
| `GET /skills/{publisher}/{name}/versions/{version}`              | Manifest, hash, signature, provenance, review, state                              |
| `GET /skills/{publisher}/{name}/versions/{version}/download`     | `302` to the version's immutable package                                          |
| `GET /skills/{publisher}/{name}/versions/{version}/files/{path}` | One file of the version, as text                                                  |
| `POST /skills/{publisher}/{name}/versions/{version}/yank`        | `{ reason }`; `POST …/unyank` brings it back                                      |
| `GET /skills/{publisher}/{name}/diff?from=&to=`                  | What changed in the steps, files and `touches`                                    |
| `GET /skills/{publisher}/{name}/stats`                           | Installs per day for the last 90 days                                             |

## Resolving and checking

| Method and path | Does                                                                                                  |
| --------------- | ----------------------------------------------------------------------------------------------------- |
| `POST /resolve` | `{ skills: { "sypnia/sypnia-design-guide": "^1.4.0" } }` → the versions, their hashes and their needs |
| `POST /check`   | A package → its findings; nothing is stored                                                           |

## Publishers and tokens

| Method and path                                                                                  | Does                                                  |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| `GET /publishers/{handle}`, `POST /publishers`                                                   | A publisher; create one for an organization           |
| `PATCH /publishers/{handle}`                                                                     | Its name, links and verified domain                   |
| `GET\|POST /publishers/{handle}/members`, `DELETE /publishers/{handle}/members/{account}`        | Who has the publisher role                            |
| `GET\|POST /publishers/{handle}/tokens`, `DELETE /tokens/{id}`                                   | Tokens, with scopes and expiry                        |
| `GET\|POST /skills/{publisher}/{name}/trusted`, `DELETE /skills/{publisher}/{name}/trusted/{id}` | Repositories allowed to publish                       |
| `POST /trusted/token`                                                                            | Exchange a CI identity for a token that lasts minutes |

## Reports and keys

| Method and path | Does                                                      |
| --------------- | --------------------------------------------------------- |
| `POST /reports` | `{ skill, version?, reason }`                             |
| `GET /keys`     | The registry's public signing keys, current and announced |

The OpenAPI document is in the engine's repository, at `spec/openapi.yaml`.
