vitna.ai/docs/api/v1/engine/decision-pack Machine view
Raw .md llms.txt
> Source: https://vitna.ai/docs/api/v1/engine/decision-pack
> Raw Markdown: https://vitna.ai/docs/api/v1/engine/decision-pack.md
> Corpus index: https://vitna.ai/llms.txt

# Decision pack

One accepted or recorded decision as a standalone, signed audit pack: the
decision, the exact price periods and evidence it read, the observation leaves
with their Merkle hashes, and the canonical digest of the whole, so the pack
can be verified offline without the record.

```
GET /api/v1/decisions/{id}/pack
```

```bash
curl -O -J https://vitna.ai/api/v1/decisions/42/pack
```

The answer is served as a file (`Content-Disposition: attachment`), named
`vitna-decision-{id}-pack.json`, and is cacheable: a pack is assembled from
append-only rows, so the same id answers the same pack.

## Path parameters

| Parameter | Meaning |
|---|---|
| `id` | The decision's id, up to eighteen digits, as `/decisions/{id}` prints it |

## Who can read one

Only a decision belonging to an organisation whose feed is public. A decision
of an organisation with a private feed answers `404 not_found`, identically to
an id that was never issued, so the endpoint cannot be used to enumerate
tenants. An id that is not digits answers the same `404` without touching the
record.

## What the pack carries

- The decision itself, and the provenance absences saying what was not
  recorded.
- The `witness.price_period` rows the decision read, and the observation
  leaves behind them with their Merkle leaf hashes.
- The `aperture.evidence` measurements it read, with their SHA-256 digests.
- `digest`: the SHA-256 of the pack's canonical payload, which is the pack with
  its `signature`, `statement`, `digest` and `signerPublicKey` fields stripped
  and the rest serialised canonically.

## Errors

| Status | Code | Cause |
|---|---|---|
| 404 | `not_found` | No decision of a public feed has that id: never issued, not digits, or a private feed's |
| 503 | `record_unavailable` | This instance has no record, or the record could not be read for this pack |

Errors are `no-store`. A `503` carries no pack at all: when a read of the
record fails, nothing is assembled in its place.

The same pack, signed by the authority's Ed25519 key, is what
`npm run aperture:decision:pack` writes, and `--verify` checks a written pack
against a public key with no network and no database. The concept page,
[Decisions](../../../concepts/decision.md), says what a decision is and how
one is accepted.
Human Machine Shift+M