csreg

API Reference

The Skills Registry exposes a RESTful API for managing skills, versions, teams, and user accounts programmatically.

Base URL#

All API endpoints are relative to the base URL of your registry host. All request and response bodies are JSON unless otherwise noted.

https://csreg.nexus/api/v1

Example request using curl:

curl -s https://csreg.nexus/api/v1/skills \
  -H "Authorization: Bearer sk_abc123" \
  -H "Content-Type: application/json"

Authentication#

The API supports two authentication methods depending on the client.

Bearer Token (CLI)#

Pass an API token in the Authorization header. Tokens are created at /settings/tokens in the web UI or via the tokens API.

Header
Authorization: Bearer <token>

OAuth Session (Web)#

Cookie-based authentication via NextAuth. This is used automatically when browsing the web UI and requires no additional configuration.

Token Scopes#

API tokens are assigned a hierarchical scope that determines which operations they can perform. Higher scopes include all permissions from lower scopes.

ScopeLevelPermissions
read0Pull skills, browse, search
write1Push versions, create skills, manage channels. Includes read.
admin2Team management, yank versions, delete skills. Includes write + read.

Info

Higher scopes include all lower scope permissions. A token with admin scope can perform any operation that write or read tokens can.

Pagination#

List endpoints use cursor-based pagination. Pass a cursor query parameter to fetch the next page, and an optional limit to control page size. The default limit is 20 and the maximum is 100.

GET /api/v1/skills?cursor=<uuid>&limit=<n>

Paginated responses include a cursor field set to the ID of the last item. If cursor is present, more pages may be available.

Paginated Response
{
  "data": [...],
  "cursor": "uuid-of-last-item"
}

Errors#

Error responses follow the RFC 7807 Problem Details format. Every error includes a machine-readable type URI, a human-readable title, the HTTP status code, a detail message, and the request instance path.

Error Response
{
  "type": "https://csreg.nexus/errors/version-conflict",
  "title": "Conflict",
  "status": 409,
  "detail": "Version 1.2.0 of @backend/code-reviewer already exists.",
  "instance": "/api/v1/skills/backend/code-reviewer/versions"
}

The following error types may be returned by the API:

StatusTypeDescription
400validation-errorRequest body or query parameters failed validation.
401authentication-requiredNo valid authentication credentials provided.
403insufficient-permissionsToken scope or role is insufficient for this operation.
404not-foundThe requested resource does not exist.
409version-conflictA resource with the same identifier already exists.
413archive-too-largeThe uploaded archive exceeds the maximum allowed size.
422manifest-invalidThe skill manifest is malformed or missing required fields.
429rate-limit-exceededToo many requests. Retry after the reset window.
500internal-errorAn unexpected server error occurred.

Rate Limiting#

Rate limiting is planned for a future release. The error type rate-limit-exceeded (429) is defined and will be used when rate limiting is enforced. Currently, there are no per-client rate limits.