Skip to content
PacSpace
Talk to us

Event types

The events a records workspace receives: record.committed, record.failed, and webhook.test. What each one means and what to do when it arrives.

Every event arrives in the same envelope, { "event", "timestamp", "data" }, signed the same way. The event name is in the body and in the X-Webhook-Event header.

record.committed

An entry is in the record. Anyone you give the link to can check it without asking PacSpace. Once committed, no one can change this record, PacSpace included.

data.records[] names the entry: recordType, entityId (your record, such as eval-run-4417), seq (the entry's position on the wire, from 0; Entry 1 on the pages), and referenceId (your idempotency key). records[].kind is transition for an ordinary entry and attempt for a write the record's lifecycle did not allow, such as an entry sent after the record was closed, which was recorded as an attempt and left the record's state as it was; applied says which. This kind is a different word from the kind you send inside an entry.

What to do: read seq and store it against the write. It is the position the receipt path and the history use, and the write's own answer did not carry it. To fetch the receipt through an SDK, pass entry: seq + 1:

typescript
// A record.committed delivery named seq 2 of eval-run-4417: that is Entry 3.
const receipt = await pac.records.receipt({ record: 'eval-run-4417', entry: 2 + 1 });

record.failed

A queued entry could not be committed. Nothing was written, and the record's earlier entries are unchanged.

data carries recordType, entityId, seq, code, and sentence. The code is the registry's name for the rule that was not met; the sentence states the rule in plain words. For example, if an incident report's record incident-0923 is opened with an entry sent as closed, the write is queued and then fails with RECORD_GENESIS_MISMATCH: "A record opens with recorded; amended and closed come after it." The same entry shows status: failed with the same code in the history.

What to do: fix what the sentence names and send the entry again with a new idempotency key. A key that was already answered returns that first answer again, so the new write needs a new key.

webhook.test

You pressed "Send a test event" on the Webhooks page. data carries webhookId and message: "A test event from PacSpace.". It takes the same delivery path as a real event, so a test that arrives and verifies means real events will.

Events your handler does not know

The endpoint is subscribed to every event PacSpace sends, and some of those belong to features these pages do not cover. Treat an event your handler does not know as one to log and skip, never as an error. New event names may be added.