# Events

> The Events operations of the Hub REST API (2 operations).

URL: https://docs.synap.live/docs/reference/hub-api/events · Generated from Synap-core/backend@c31e261ab (main)

Paths are relative to `/api/hub` on a pod.

## GET /events

List recent events for a user

Returns events from the event log filtered by type/subject/window, and optionally by producer: `agentUserId` (everything one agent did), `isAgent` (agent- vs human-produced) and `correlationId` (one request chain). Default window is 7 days; default limit is 50, hard-capped at 200.

Parameters:

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `userId` | query | string | yes |  |
| `type` | query | string |  |  |
| `subjectType` | query | string |  |  |
| `subjectId` | query | string |  |  |
| `fromDate` | query | string |  | ISO timestamp. Defaults to 7 days ago. |
| `limit` | query | string |  | Default 50, hard-capped at 200. |
| `ungoverned` | query | "true" \| "false" |  | When 'true', return only 'ungoverned AI writes' — agent writes that EXECUTED with no proposal behind them (is_agent = true AND proposal_id IS NULL, on the .completed event). Governed (auto-approved or approved) agent writes carry a proposal id and are excluded. |

Responses:

- `200`: Events array (newest first)
- `400`: Bad request
- `403`: Forbidden
- `500`: Internal error

## GET /events/stream

SSE stream of new events

Long-lived Server-Sent Events stream. Emits `event` and `heartbeat` frames. Consumers must dedupe by event id (at-least-once across catch-up).

Responses:

- `200`: Success
- `401`: Unauthorized
- `403`: Forbidden — missing scope
- `500`: Internal error
