Skip to main content
API reference sections

Schema

Envelope

One event on the local bus.

Type object

Shape

FieldTypeDescription
event_idrequiredEventId
namerequiredEventName

A registry-validated dotted event name, e.g. document.created.

Construct literals through [crate::event_name!], which fails the build on a name missing from the registry; a runtime-built name is refused by [crate::validate] at the boundary instead.

versionrequiredinteger (uint16, >= 0, <= 65535)

The (name, version) pair identifies the payload shape. Bumped per event name on breaking change only; additive attrs do not bump it, and a pair is never reused with a different meaning.

occurred_at_msrequiredinteger (int64)

Wall clock, epoch ms UTC. Display and bucketing ONLY - never ordering.

actorrequiredActor

Who caused an event.

originrequiredOrigin

Where the event was minted.

scopeScope

Where in the data model the event applies. The profile is usually implicit (the journal is profile-local today); it is carried so a multi-profile device can tell its own events apart.

subjectSubject or null
correlation_idEventId or null

The chain root. None means this event is its own root - readers use [Envelope::chain_root], never the raw field.

causation_idEventId or null

The immediate parent event.

attrsmap of string to AttrValue
Example
{
  "event_id": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "version": 0,
  "occurred_at_ms": 0,
  "actor": {
    "kind": "user",
    "id": "00000000-0000-4000-8000-000000000000",
    "token": "string"
  },
  "origin": {
    "device_id": "00000000-0000-4000-8000-000000000000",
    "session_id": {}
  },
  "scope": {
    "profile_id": "00000000-0000-4000-8000-000000000000",
    "workspace_id": "00000000-0000-4000-8000-000000000000"
  },
  "subject": {
    "kind": "workspace",
    "id": "string",
    "version": 0
  },
  "correlation_id": "00000000-0000-4000-8000-000000000000",
  "causation_id": "00000000-0000-4000-8000-000000000000",
  "attrs": {
    "key": {
      "t": "id",
      "v": "00000000-0000-4000-8000-000000000000"
    }
  }
}

The contract has no example values, so example bodies are generated from each schema: every field is shown with a placeholder of its type.

Generated from contract version 1. Last updated .

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.