The OpenAPI pin
The API contract is pinned twice, and CI enforces that the two are a byte-identical pair:
packages/sdk/openapi.json— the snapshot@marula-core/sdkis generated fromfixtures/openapi/v1/openapi.json
The compact rule (DX12)
Both pins are compact single-line minified JSON. The API serves
pretty-printed JSON, so after curl /openapi.json > packages/sdk/openapi.json
you must run pnpm --filter @marula-core/sdk generate (it minifies the
snapshot in place) before committing. Never commit the ~43k-line pretty
form; scripts/check-openapi-pins.sh fails it in CI.
What the pin guarantees
- The generated typed SDK client and this docs site's API reference are generated from the same committed snapshot, so they cannot drift from what the server serves.
- Path-versioned (
/api/v1…): a supported API version never breaks inside its support window; new versions are added alongside, never swapped in place (policy §2).
Machine scopes
Interactive sessions authorize by role. API keys authorize by scope, and the document names them.
x-scope-catalog(top level) lists every scope an organization can write onto a key and the permissions it grants. The key-creation endpoint validates against the same list.x-api-key-scopeson an operation names the scopes that satisfy it. Any one is enough. An operation without the extension is not reachable by any scope in the catalog.components.securitySchemesdefinesbearer(JWT) andapi_key(anx-api-keyheader). OpenAPI 3.1 has no scope field on an API key scheme, so the vocabulary lives in the two extensions instead of being described as an OAuth2 flow.
Holding a scope is not enough on its own. Handlers still apply their own permission and record-level checks.
How this reference is generated
docs/site/scripts/generate-api-reference.mjs
parses the compact pin (it never reads or pastes the pretty form) and emits
reference/api.md. Regenerate after any OpenAPI regen:
node docs/site/scripts/generate-api-reference.mjs