Skip to content

History

The record's history file: every entry with its status and each committed entry's receipt. records.history in the SDKs, GET .../history on the wire. The file an outside evaluator checks without PacSpace.

HTTP
GET /api/v1/records/{recordType}/{record}/history

The history is the record as a file: every entry with its status, and for each committed entry its receipt. records.check and the standalone checker run on it, and it is the file to hand to anyone who will check the record without PacSpace, such as an outside evaluator or an auditor. It is the first thing to read after a write, and it is what the docs tell you to poll.

Call

Read evaluation run 4417 after the harness has written its entries, and see which have committed.

TypeScript
const history = await pac.records.history({ record: 'eval-run-4417' });
for (const row of history.entries ?? []) {
  // seq is the wire's count, from 0: seq 0 is Entry 1.
  console.log(row.seq, row.status, row.code ?? '', row.sentence ?? '');
}

What comes back

The body is the history file itself, exactly as the checker reads it, so the SDKs return it whole rather than reshaping it. The parts you read from code:

FieldWhat it is
schemaThe file's form: record-history-bundle/v2 for a record whose fields are sealed one by one, record-history-bundle/v1 for an older record.
recordKeyThe record's fixed key.
entries[]Every entry in order, each with seq, status (queued, committed, or failed), and receiptId. A failed entry carries code and a plain sentence. A queued entry carries the number it is expected to take. seq is the wire's count, from 0; the pages and the SDKs count the same entry from 1, so seq: 0 is Entry 1. An attempt (an entry the record's rules did not allow, such as one sent after closed) and a failure record are committed entries too, each with its receipt; its sealed record carries attemptedTarget or failureClass.
receipts[]One receipt per committed entry: the sealed record as it was committed, its seal, and what the check needs. See Receipts.
bundleDigestThe file's own fingerprint. A copy that was changed after export no longer produces it.
exportedAtWhen this file was produced.

The rest of the file is what the check needs and is read by the checker, the Shared Record, and records.check.

Paging

A history returns up to 5,000 committed entries at a time. fromSeq and toSeq bound the page on the wire, counted from 0; the SDKs take fromEntry and toEntry, counted from 1, and convert. When more remain, the answer carries the next start in the X-Next-From-Seq header, which the SDKs read into nextFromSeq, a wire number.

TypeScript
let fromEntry = 1;
do {
  const page = await pac.records.history({ record: 'eval-run-4417', fromEntry });
  // page.entries
  // the header is a wire number
  fromEntry = page.nextFromSeq == null ? 0 : page.nextFromSeq + 1;
} while (fromEntry > 0);

Download

Send Accept: application/octet-stream and the answer arrives as an attachment named record-history-{recordType}-{record}.json, which is the file to hand to someone who will check it without PacSpace.

Who can read it

Your workspace's key. Or a grant token, sent as ?grant=, with no key: a grant lets software on the other side, such as an outside evaluator's tooling, read this one record's receipts and history. It is made with POST .../grants; see Software on the other side. A person on the other side does not need either; they open the share link.

When the call is refused

On the wire each code is at error.code in the answer's body. In the SDKs a 404 arrives as NotFoundError, carrying the API's message; the other codes arrive as a PacSpaceError with the code below.

CodeThe rule
RECORD_NOT_FOUND (404)No record exists for this id in your workspace.
RECORD_ENTRY_NOT_FOUND (404)This record has no committed entries in the requested range.
RECORD_BUNDLE_RANGE_INVALID (400)fromSeq and toSeq are whole numbers and toSeq is not below fromSeq.
RECORD_BUNDLE_GRANT_REQUIRED (403)Reading a history takes your workspace's key or a grant for this record.