> ## Documentation Index
> Fetch the complete documentation index at: https://judged.systems/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Packs

> Edit a draft, publish an immutable version, and move documents in and out.

Packs is where the questions and thresholds live. Callers judge a **published** version. You edit the **draft**.

<Info>
  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.
</Info>

## 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](/docs/guides/questions).

`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:

```json theme={null}
{ "added": ["priority"], "removed": [], "changed": ["urgency"] }
```

A changed id means the question object differs. The comparison is by id, so renaming an id looks like a removal plus an addition.

## 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 requires `packs:read`. Creating, updating, publishing, restoring, importing, and deleting require `packs:write`. A browser session has both. See [Authentication](/docs/guides/authentication).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.