Events API
The platform domain-event feed and alert surface: list events and alerts, and acknowledge alerts singly or in batch.
4 routes
Response metadata: x-api-version, x-request-id, and traceresponse apply to normal routed responses and are omitted from the per-operation header tables below.
GET/api/events
request access
The operational domain-event feed (#11).
Newest first, with optional event_type / aggregate_id filters. Distinct from the audit feed: this is the operational stream other subsystems consume (alert generation, dashboards). Request-tier read, site/environment-scoped (#2): a scoped principal sees only its own scope's events plus events that are platform-wide (NULL) on BOTH axes. The cross-scope rule is SYMMETRIC: a SITE-ONLY event (concrete site, NULL environment — e.g. a decommission) is NOT visible to an environment-scoped principal, and an ENV-ONLY event (NULL site, concrete environment) is NOT visible to a site-scoped one — in each case the mutating handlers fail closed for that principal, so the feed must not be more permissive. Empty + durable:false when no DB is configured.
Permissions
| Access class | Credential | Scoping |
|---|---|---|
request | An authenticated session or API bearer token is required. | The access class is enforced first; site and environment scopes narrow resources on scoped operations. |
HTTP request
GET https://<your-host>/api/events
Path parameters
This operation has no path parameters.
Query parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
event_type | string | Optional | Filter to one dotted event type, e.g. request.approve. |
aggregate_id | string | Optional | Filter to one aggregate's history (e.g. a request id). |
limit | integer | Optional | Page size (default 50, capped 500). |
Request headers
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed. |
X-Ryuki-Session-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
traceparent | string | Optional | Optional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation. |
Request body
This operation does not accept a request body.
Response
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
events | JSON value | Required | Value of events returned in the response body. |
durable | boolean | Required | Value of durable returned in the response body. |
Errors
JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.
Examples
Request
curl --silent --show-error --globoff \
--request GET \
--header 'Authorization: Bearer <token>' \
'https://<your-host>/api/events'
Schematic response body
Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.
Success status: 200
{
"events": null,
"durable": false
}
GET/api/events/alerts
monitoring.alert.read access
The alert-worthy slice of the domain-event stream (#11 slice 2a).
Reuses the scoped feed but keeps only events the pure event_alerts classifier flags — currently a request reaching a NEGATIVE terminal state: failed=critical, rejected=warning, cancelled=info — annotating each with its severity. The status filter is pushed into SQL (via the engine's authoritative status list) so the page is not short-counted when alerts are rare. The dedicated monitoring-alert read capability is checked before database access; site/environment scope is then applied in SQL. Empty + durable:false no DB.
Permissions
| Access class | Credential | Scoping |
|---|---|---|
monitoring.alert.read | An authenticated session or API bearer token is required. | The access class is enforced first; site and environment scopes narrow resources on scoped operations. |
HTTP request
GET https://<your-host>/api/events/alerts
Path parameters
This operation has no path parameters.
Query parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
event_type | string | Optional | Filter to one dotted event type, e.g. request.approve. |
aggregate_id | string | Optional | Filter to one aggregate's history (e.g. a request id). |
limit | integer | Optional | Page size (default 50, capped 500). |
Request headers
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed. |
X-Ryuki-Session-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
traceparent | string | Optional | Optional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation. |
Request body
This operation does not accept a request body.
Response
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
alerts | JSON value | Required | Value of alerts returned in the response body. |
durable | boolean | Required | Value of durable returned in the response body. |
Errors
JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.
Examples
Request
curl --silent --show-error --globoff \
--request GET \
--header 'Authorization: Bearer <token>' \
'https://<your-host>/api/events/alerts'
Schematic response body
Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.
Success status: 200
{
"alerts": null,
"durable": false
}
POST/api/events/alerts/batch/ack
monitoring.alert.acknowledge access
Acknowledge up to 100 alerts in one call (#19).
Mirrors the requests_batch_* (#17) shape: the dedicated acknowledgement capability is checked up front, ids are deduped + capped at 100, then each id runs the SAME per-item scope/ack core (ack_alert_one) as the single endpoint — so a batch can NEVER ack an out-of-scope alert, and one bad id never aborts the rest. Per-item independent; partial success; HTTP 200 always with {results, succeeded, failed}.
Permissions
| Access class | Credential | Scoping |
|---|---|---|
monitoring.alert.acknowledge | An authenticated session or API bearer token is required. | The access class is enforced first; site and environment scopes narrow resources on scoped operations. |
HTTP request
POST https://<your-host>/api/events/alerts/batch/ack
Path parameters
This operation has no path parameters.
Query parameters
This operation has no query parameters.
Request headers
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed. |
Content-Type | string | Required | Required by the resolved Axum Json<T> request extractor; send application/json. |
X-Ryuki-Session-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
Idempotency-Key | string | Optional | Optional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication. |
traceparent | string | Optional | Optional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation. |
Request body
JSON structure: BatchAlertAckBody.
| Name | Type | Requirement | Description |
|---|---|---|---|
event_ids | array<integer> | Required | Value of event_ids in the JSON request body. |
note | string | Optional | Value of note in the JSON request body. |
Response
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
results | JSON value | Required | Results returned by this operation. |
succeeded | JSON value | Required | Value of succeeded returned in the response body. |
failed | JSON value | Required | Value of failed returned in the response body. |
Errors
JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.
Examples
Request
curl --silent --show-error --globoff \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{"event_ids":[]}' \
'https://<your-host>/api/events/alerts/batch/ack'
Schematic response body
Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.
Success status: 200
{
"results": null,
"succeeded": null,
"failed": null
}
POST/api/events/alerts/{event_id}/ack
monitoring.alert.acknowledge access
Acknowledge an alert (#11 slice 2e).
Marks the alert (a domain_events row) as seen by the acting principal; the feed then shows acknowledged + who/when. Re-acking updates in place. Requires the dedicated monitoring-alert acknowledgement capability. 404 when the event id is unknown, 400 on a control-character note, 503 with no DB.
Permissions
| Access class | Credential | Scoping |
|---|---|---|
monitoring.alert.acknowledge | An authenticated session or API bearer token is required. | The access class is enforced first; site and environment scopes narrow resources on scoped operations. |
HTTP request
POST https://<your-host>/api/events/alerts/{event_id}/ack
Path parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
event_id | integer | Required | Identifier of the target resource in the request path. |
Query parameters
This operation has no query parameters.
Request headers
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed. |
Content-Type | string | Required | Required by the resolved Axum Json<T> request extractor; send application/json. |
X-Ryuki-Session-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
Idempotency-Key | string | Optional | Optional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication. |
traceparent | string | Optional | Optional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation. |
Request body
JSON structure: AlertAckBody.
| Name | Type | Requirement | Description |
|---|---|---|---|
note | string | Optional | Value of note in the JSON request body. |
Response
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
acknowledged | boolean | Required | Value of acknowledged returned in the response body. |
event_id | JSON value | Required | Value of event_id returned in the response body. |
acknowledged_by | JSON value | Required | Value of acknowledged_by returned in the response body. |
Errors
JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.
Examples
Request
curl --silent --show-error --globoff \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}' \
'https://<your-host>/api/events/alerts/<event_id>/ack'
Schematic response body
Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.
Success status: 200
{
"acknowledged": false,
"event_id": null,
"acknowledged_by": null
}