Write an entry
The one write call: records.emit in the SDKs, POST /api/v1/records/{recordType}/{record}/transitions on the wire. Shown with an evaluation harness recording what the agent under test did.
POST /api/v1/records/{recordType}/{record}/transitionsOne call writes one entry. The first entry creates the record. The answer comes back as QUEUED; the entry is committed when it shows committed in the history or when record.committed reaches your webhook.
Call
An evaluation harness writes the entry where it already logs what the agent under test did. Here, in evaluation run 4417, agent 7 has just opened a connection outside the test environment. ref is the fingerprint of that tool call and its output, made with fingerprint. The harness holds the key; the agent never sees it.
const entry = await pac.records.emit({
record: 'eval-run-4417',
title: 'Agent 7 opened a connection outside the test environment',
kind: 'network-egress',
occurredAt: '2026-09-23T14:09:48Z',
actorId: 'agent-7',
instructedBy: 'eval-harness',
payloads: [ref],
description: 'A shell command in sandbox 12 reached an address outside the test environment.',
idempotencyKey: 'eval-run-4417:evt-0193',
});entry = pac.records.emit(
record="eval-run-4417",
title="Agent 7 opened a connection outside the test environment",
kind="network-egress",
occurred_at="2026-09-23T14:09:48Z",
actor_id="agent-7",
instructed_by="eval-harness",
payloads=[ref],
description="A shell command in sandbox 12 reached an address outside the test environment.",
idempotency_key="eval-run-4417:evt-0193",
)curl -X POST https://app.pacspace.io/api/v1/records/machine-action-record/eval-run-4417/transitions \
-H "x-api-key: $PACSPACE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lifecycle": "recorded",
"content": {
"title": "Agent 7 opened a connection outside the test environment",
"kind": "network-egress",
"occurredAt": "2026-09-23T14:09:48Z",
"actorId": "agent-7",
"instructedBy": "eval-harness",
"payloads": [{ "alg": "hmac-sha-256", "digest": "97e3f57b44dad1d1380f913d039de81240ccff5339d7d3f03d0f834a3a3be551", "byteLength": "1843" }],
"description": "A shell command in sandbox 12 reached an address outside the test environment."
},
"referenceId": "eval-run-4417:evt-0193"
}'Fields
The SDKs speak in the words on this page: record is your id for the record and entry is an entry's number, counted from 1 as every page counts it. On the wire the route keeps its own names, entityId and seq, in the path, the answer, and the webhook payloads, and seq counts the same positions from 0; the SDKs map between the two.
| SDK field | Wire | Required | What it is |
|---|---|---|---|
record | path {record} (entityId) | yes | Your id for the record: letters, digits, _ - . :, 1 to 255 characters. Every entry about the same thing uses the same id, such as one id per evaluation run or per agent session. |
recordType | path {recordType} | no | The entry's shape. Defaults to machine-action-record, the general shape; you name a record type only when we have given you a different one. |
title | content.title | yes | What this entry records, in your words. At most 120 characters. The first entry's title is also the record's name. |
occurredAt | content.occurredAt | yes | When it happened, RFC 3339 in UTC, ending in Z: when the agent acted. The time of your call is recorded on its own, as receivedAt in the answer. |
actorId | content.actorId | yes | Who or what did it, named by you: an agent, a person, a monitor, a pipeline. |
payloads | content.payloads | yes | The fingerprints of the files this entry is about, each { alg, digest, byteLength } from fingerprint. At least one. |
kind | content.kind | no | Your own word for the sort of thing this is, in lower case letters and digits joined by hyphens, such as tool-call or approval-given. |
instructedBy | content.instructedBy | no | Who told the actor to do it: the harness that gave the task, or the person who approved the action. |
description, note | content.description, content.note | no | Text sealed with the entry. |
references | content.references | no | Entries of other records this one refers to, each { recordKey, entry } (seq on the wire, entry - 1), such as a monitor's entry naming the agent's call it stopped. Each must already be committed in your workspace. |
amends | content.amends | no | The committed entry this one corrects, { recordKey, entry } (seq on the wire), sent with lifecycle: amended. In the same record it must already be committed. An entry of another record can be corrected from a new record once that record is closed; the correction then also names the entry in references. See Correcting an entry. |
lifecycle | lifecycle | no | recorded, amended, or closed. The SDKs send recorded; send amended with amends. See Lifecycle. |
idempotencyKey | referenceId | no, and you should | One key is one write. Use a new key for every entry, such as the harness's own event id, and reuse one only to retry the same entry. Letters, digits, _ - . :, up to 255 characters. Never the same as record. Left out, the key is made from the body, so the same body sent twice is one write. |
Everything under content is sealed. The SDKs send a file's fingerprint and size, never the file, its name, or where it is kept. What you write in title, description, or note is sealed as written.
Answer
{
"success": true,
"data": {
"intakeId": "rit_1h8Uu9evAnxcvZ-N",
"receiptId": "anc_01j7z3k9m2q4",
"recordType": "machine-action-record",
"entityId": "eval-run-4417",
"recordKey": "0x5e1f...c3a9",
"lifecycle": "recorded",
"status": "QUEUED",
"referenceId": "eval-run-4417:evt-0193",
"receivedAt": "2026-09-23T14:09:48.612Z",
"message": "Transition queued. The record is committed when the entry appears in your webhook or the record's history; store receiptId to retrieve the receipt."
}
}The answer also carries a few fields your code does not need. It carries no entry number, because the number is assigned when the entry is committed. Read it from records[].seq in the record.committed webhook or from the history, and fetch the receipt with it. A repeat of a finished idempotency key returns this same answer with "idempotent": true (the TypeScript SDK does not pass that field on).
Attempts
A record opens with recorded. closed is final: an entry sent after the record is closed is recorded as an attempt, marked so, and the record's state does not move. The attempt is in the history like any entry, so the record shows that something tried to write after the close. Close an agent's run when it ends, and a write that comes later shows on the record.
When the call is refused
On the wire each code is at error.code in the answer's body. In the SDKs a refusal with status 400, 403, 409, or 422 arrives as a PacSpaceError whose code is the code below. A 401, 402, 412, or 429 arrives as its own error class, listed under Errors, and a 429 or 500 is sent again first. Each sentence states the rule.
| Code | The rule | What to do |
|---|---|---|
| 401, no code | A key is one your workspace lists under Settings, Developer, API keys, sent as x-api-key. | Check that the key is set and has not been disabled. The SDKs raise InvalidApiKeyError. |
INVALID_REQUEST (400) | A record id is letters, digits, _ - . :, 1 to 255 characters. | Fix the id in the path. |
RECORDS_API_NOT_ENABLED (403) | Records are written from a records workspace. | Pick the records option at signup, or ask us to switch the workspace. |
RECORD_LAYOUT_UNKNOWN (400) | A record type is one of the published names. | Use machine-action-record, or leave recordType out. |
RECORD_LAYOUT_NOT_ADMITTED (422) | The record type is published but not yet admitted for writes in this environment. Nothing was queued. | It becomes writable when the registration runs. |
RECORD_LAYOUT_MISMATCH (409) | A record keeps the record type it started with. | Use a new record id for the new record type. |
RECORD_STATE_UNKNOWN (400) | A state comes from the record type's declared list. | Use recorded, amended, or closed. |
RECORD_CONTENT_INVALID (400) | The sealed record carries the fields the record type names, each in its declared form. | Fix the field the message names and send again. |
RECORD_PAYLOAD_ALG_UNSUPPORTED (400) | A fingerprint is made with sha-256 or hmac-sha-256. | Fingerprint the file with the helper and send again. |
RECORD_BLINDING_INCLUDED (400) | A payload carries a fingerprint's alg, digest and byteLength only; the blinding file stays with you. Nothing was queued. | Send the fingerprint's ref as the payload, and keep the blinding file beside the file. |
RECORD_PAYLOADS_REQUIRED (422) | Every record carries at least one fingerprint. | Fingerprint the file or the payload and put the result in payloads. |
RECORD_TITLE_TOO_LONG (422) | A title fits in 120 characters. | Shorten the title; the rest belongs in description. |
RECORD_REFERENCE_NOT_FOUND (422) | A reference names an entry that is already committed in your workspace. | Check the record key and entry number, or wait for that entry to reach committed. |
RECORD_AMENDS_NOT_ADMITTED (422) | Amendments are published but not yet admitted for writes in this environment. Nothing was queued. | Ask us whether amendments are on for your environment. |
RECORD_AMENDS_NOT_FOUND (422) | An amendment names a committed entry in the same record, or in a closed record this entry references. Nothing was queued. | Check the record key and the entry number; on the wire it is seq, counted from 0. |
RECORD_AMENDS_NOT_PRECEDING (422) | An amendment comes after the entry it amends. Nothing was queued. | Wait for the entry to commit, or name the entry you meant. |
RECORDS_CONTRACT_UNAVAILABLE (412) | A workspace writes once its recording environment is active for the environment the key names. | Check that the environment is active in the dashboard, or use the key for the one that is. |
RECORDS_CONTRACT_NOT_READY (412) | A workspace writes once its recording environment is ready. | Wait for the dashboard to show ready, then send again. |
PLAN_LIMIT_REACHED (402) | A Free workspace writes 100 entries a month. Nothing was queued. | Move to a paid plan, then send again with the same idempotency key. See Plan and usage. |
PAID_ENTITLEMENT_REQUIRED (402) | A paid workspace writes while its plan's payment is settled. Nothing was queued. | Check the plan's payment in the dashboard, then send again with the same idempotency key. |
RECORD_INTAKE_FAILED (500) | A write that did not land is always reported. | Send the same request again with the same idempotency key. |
IDEMPOTENCY_PENDING (202) | One idempotency key is one write; a repeat waits for the first to finish. | Wait retryAfterSeconds, then send the same request again. The SDKs return this rather than throwing. |
IDEMPOTENCY_CONFLICT (409) | One idempotency key is one write; a different body under the same key is a different write. | Send the new entry with a new key. |
A body the route cannot read at all, such as an idempotencyKey with a space in it, answers 400 with no code and a message that names the field. The SDKs raise ValidationError.
One failure arrives after QUEUED rather than in the answer. RECORD_GENESIS_MISMATCH: a record opens with recorded; amended and closed come after it. If a record's first entry is sent as closed, the write is queued and then fails to commit. The failure reaches you as record.failed at your webhook and as status: failed with the code in the history. Send the first entry as recorded, then the entry you meant, with a new idempotency key.
Limits
A workspace writes up to 120 entries a minute. Every answer under the limit carries X-RateLimit-Remaining. Past it, the answer is 429 RATE_LIMIT_EXCEEDED with retryAfterSeconds in the body and the same number in a Retry-After header. The SDKs wait exactly that long and send again, up to their retry count; see Retries and timeouts. From your own code, send again after that many seconds with the same idempotency key.