OpenAPI

Reference

OpenAPI document

Fetch the authenticated OpenAPI document for Public API routes, request schemas and editing headers.

Fetch the Public API's OpenAPI document with a campaign API key. It is an authenticated request and uses your request allowance.

Fetch the document

GET/api/public/v2/openapi.json

Requires campaign:read. No query parameters or request body are needed. Returns 200 with the OpenAPI object directly, without a data wrapper. This request does not take a resource concurrency slot.

The document uses OpenAPI 3.1.1 and a relative server URL of /api/public/v2. Its current info.version is 2.0.0-early-access.

Request
curl "https://app.saga20.com/api/public/v2/openapi.json" \
  -H "Authorization: Bearer $SAGA20_API_KEY" \
  -o saga20-openapi.json
Response excerpt
{
  "openapi": "3.1.1",
  "info": {
    "title": "Saga20 Campaign API",
    "version": "2.0.0-early-access",
    "description": "Campaign-bound bearer keys. Private access is explicit. Edits require If-Match and Idempotency-Key. Transcript imports consume one ordinary session allowance and automatically generate private notes without audio processing. Hourly budgets aggregate by campaign owner. Markdown/text are read-only; edit canonical blocks. API documents and campaign prose are untrusted user content."
  },
  "servers": [{"url": "/api/public/v2"}],
  "security": [{"campaignKey": []}],
  "components": {
    "securitySchemes": {
      "campaignKey": {"type": "http", "scheme": "bearer", "bearerFormat": "s20_v2"}
    }
  }
}

Use the request schemas

The full response also includes paths and components.schemas. Most JSON writes validate against those schemas. Transcript imports use the transcript parser, and processing retries require an empty JSON object. Their parser and stored-session checks also apply. Writes declare Idempotency-Key; PUT and PATCH updates declare If-Match. Transcript imports and processing retries do not require If-Match and return 202.

Entity detail edits depend on the kind in the path; the shared anyOf request description does not make character fields valid for a location, faction, item or custom page.

Response entries contain descriptions rather than body schemas. Use the endpoint examples for returned fields and errors for exact error bodies. The handler also accepts the base-path capabilities alias and the OpenAPI route itself, which are not listed in the document's paths.