The playground can judge the draft.
POST /api/judge, MCP, inbound webhooks, and simulations return 409 with pack has no published version until you publish.Create
POST /api/packs with { "name": "Triage" }. An omitted name is stored as Triage. The response is { id, name, draftVersionId }. The draft starts as the starter triage pack.
GET /api/packs lists packs newest first: id, name, live version id, question count, unpublishedChanges, and updatedAt.
Edit the draft
PATCH /api/packs/{packId} updates the name, the document, or both. document replaces the draft. It does not change the live version.
GET /api/packs/{packId} returns the draft as document. liveDocument is the published document, or null when nothing is published.
Publish
POST /api/packs/{packId}/publish with optional { "notes": "..." } copies the draft into a new published version and makes it live. The response is { "versionId": "..." }.
Published versions are immutable. Publishing again creates another version. Judgments keep the version id they ran, so a later publish does not rewrite old evaluations.
GET /api/packs/{packId}/versions lists versions. Each row is id, kind (draft or published), notes, and createdAt.
Restore and compare
POST /api/packs/{packId}/restore with { "versionId": "..." } copies that published version onto the draft.
GET /api/packs/{packId}/compare?from={versionId}&to={versionId} returns question ids:
Export and import
GET /api/packs/{packId}/export returns { name, document } for the draft.
POST /api/packs/import with that same shape creates a new pack. Import does not publish it.
Delete
DELETE /api/packs/{packId} returns 204. Deleting a pack removes its versions. Do this when you mean to drop the pack, not when you mean to unpublish.
Permissions
Reading a pack requirespacks:read. Creating, updating, publishing, restoring, importing, and deleting require packs:write. A browser session has both. See Authentication.