Skip to main content
API reference sections

HTTP API reference

Events

The event journal: publish, read pages after a cursor, activity, and a server-sent stream.

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

Read one page of the journal after a cursor

GET/v1/events

Authorization
Bearer token, any scope

Responses

StatusDescriptionBody
200

Read one page of the journal after a cursor

EventPage
Example 200 response
{
  "events": [
    {
      "seq": 0,
      "recorded_at_ms": 0,
      "envelope": {
        "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"
          }
        }
      }
    }
  ],
  "next_after": 0
}
Example request
curl "http://127.0.0.1:$PORT/v1/events" \
  -H "Authorization: Bearer $KORU_TOKEN"

Publish a batch of events; idempotent by event_id

POST/v1/events

Authorization
Bearer token, any scope

Request body

application/json EventBatch

FieldTypeDescription
eventsrequiredarray of Envelope
Example request body
{
  "events": [
    {
      "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"
        }
      }
    }
  ]
}

Responses

StatusDescriptionBody
200

Publish a batch of events; idempotent by event_id

AppendReceipt
Example 200 response
{
  "accepted": 0,
  "duplicates": 0,
  "rejected": [
    {
      "index": 0,
      "event_id": "string",
      "code": "string",
      "message": "string"
    }
  ],
  "last_seq": 0
}
Example request
curl -X POST "http://127.0.0.1:$PORT/v1/events" \
  -H "Authorization: Bearer $KORU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "events": [
    {
      "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"
        }
      }
    }
  ]
}'

One subject's activity, bounded and paged; never a journal scan

GET/v1/events/activity

Authorization
Bearer token, any scope

Parameters

NameInTypeDescription
kindrequiredquery"workspace" | "document" | "task"

The subject kind: workspace, document or task.

idrequiredquerystring

The subject's id as the store spells it; a task is the four-segment task:<workspace>:<document>:<node> reference.

afterqueryinteger (int64, >= 0)

Journal cursor; 0 or absent starts at the oldest event still retained.

limitqueryinteger (>= 1, <= 200)

Rows per page; clamped server-side.

Default 50

Responses

StatusDescriptionBody
200

One subject's activity, bounded and paged; never a journal scan

ActivityPage
400

The subject kind is not one of the closed set, or the id is empty

Example 200 response
{
  "entries": [
    {
      "seq": 0,
      "name": "string",
      "occurred_at_ms": 0,
      "actor": {},
      "actor_token": "string",
      "correlation_id": {},
      "attrs": {
        "key": {
          "t": "id",
          "v": "00000000-0000-4000-8000-000000000000"
        }
      }
    }
  ],
  "next_after": 0,
  "retention_days": 0
}
Example request
curl "http://127.0.0.1:$PORT/v1/events/activity?kind=$KIND&id=$ID" \
  -H "Authorization: Bearer $KORU_TOKEN"

Server-sent events from a cursor; id = seq, Last-Event-ID resumes

GET/v1/events/stream

Authorization
Bearer token, any scope

Responses

StatusDescriptionBody
200

Server-sent events from a cursor; id = seq, Last-Event-ID resumes

Example request
curl "http://127.0.0.1:$PORT/v1/events/stream" \
  -H "Authorization: Bearer $KORU_TOKEN"

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.