Log streams
A log stream forwards the events on one trail to one destination outside Santati. Santati
matches every ingested event against the stream's rules and, when it matches, queues a
delivery that is sent to the destination out of band from the read API: a stream pushes,
while GET /api/v0/events/ pulls. Delivery is
at-least-once, so a destination should deduplicate. Log streams are
included with the Enterprise plan.
A stream is three things: the trail it follows, the destination it writes to, and the
match_rules that decide which of that trail's events qualify. The destination is stored
with the stream, so one trail can feed several destinations by having several streams.
Endpoints
| Operation | Path | Scope | Reference |
|---|---|---|---|
| List streams | GET /api/v0/streams/ | any key | streams_list |
| Create a stream | POST /api/v0/streams/ | manage | streams_create |
| Retrieve one stream | GET /api/v0/streams/{id}/ | any key | streams_retrieve |
| Edit a stream | PATCH /api/v0/streams/{id}/ | manage | streams_update |
| Delete a stream | DELETE /api/v0/streams/{id}/ | manage | streams_destroy |
| Read a stream's signing secret | GET /api/v0/streams/{id}/signing-secret/ | manage | streams_signing_secret_retrieve |
| Rotate a stream's signing secret | POST /api/v0/streams/{id}/signing-secret/rotate/ | manage | streams_signing_secret_rotate |
{id} is the stream's numeric id. PUT is deliberately not part of the surface and
returns 405; PATCH edits a stream in place. Reads need any team API key, writes and the
signing secret need one with the manage scope — see Authentication.
The list is cursor-paginated (next, previous, results, no count), newest first,
with limit defaulting to 100 and capped at 1000. Deleting a stream also deletes its
destination and its delivery history.
A write reaches the delivery service before it commits. When the service is unreachable or
refuses the change, the write rolls back and the request answers 503, so a stream you can
read is a stream the delivery service has.
Create a stream
curl -X POST https://api.santati.io/api/v0/streams/ \
-H "Authorization: Api-Key $SANTATI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "invoice-audit-siem",
"trail": "production",
"destination_type": "https",
"config": {
"url": "https://siem.example.com/ingest/santati",
"content_type": "ndjson",
"timeout_seconds": 15
},
"auth": {
"header_name": "X-Ingest-Token",
"header_value": "REPLACE_WITH_YOUR_TOKEN"
},
"match_rules": {
"actions": ["invoice.*"],
"actor_types": ["user", "system"],
"metadata": [{"key": "amount_cents", "op": "eq", "value": "4200"}]
},
"status": "active"
}'
The response is 201 with the read shape. The destination's auth is not echoed:
{
"id": "0192f6b1-7a40-7d3c-b5e8-1c2f9a0d4e63",
"name": "invoice-audit-siem",
"trail": "production",
"status": "active",
"match_rules": {
"actions": ["invoice.*"],
"actor_types": ["user", "system"],
"metadata": [{"key": "amount_cents", "op": "eq", "value": "4200"}]
},
"consecutive_failures": 0,
"last_error": "",
"last_error_at": null,
"resume_cursor": null,
"destination": {
"name": "invoice-audit-siem",
"destination_type": "https",
"config": {
"url": "https://siem.example.com/ingest/santati",
"content_type": "ndjson",
"timeout_seconds": 15
}
},
"created_at": "2026-09-30T09:41:12.884013Z",
"updated_at": "2026-09-30T09:41:12.884033Z"
}
Write fields
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | At most 64 characters and unique per team; a duplicate is a 400 field error. |
trail | string | Yes | Name of the trail whose events this stream forwards. |
destination_type | string | Yes | https. See Destinations. |
config | object | No | The destination's non-secret settings. Validated against the plugin's own fields, so the accepted keys depend on destination_type. |
auth | object | No | The destination's secret material. Never returned by any read endpoint. |
match_rules | object | No | Which events to forward. Defaults to {}, which matches everything. |
status | string | No | active, inactive, error or invalid. Defaults to active on create. |
On PATCH, a field that is absent keeps its stored value. That matters most for auth
and config: omitting auth keeps the stored secret, and sending one replaces it. A
secret that is kept must still validate, so a PATCH against a destination whose stored
credential has been cleared is refused with a 400 field error on auth (on status instead when the request itself sets status to active).
Read fields
| Field | Type | Notes |
|---|---|---|
id | string (UUID) | Stream id, used in the path of every per-stream operation. |
name | string | Stream name. |
trail | string | Trail this stream follows. |
status | string | Current state; see Stream states. |
match_rules | object | The stored rules, in the same shape they were written. |
consecutive_failures | integer | Failed batches in a row. Read-only. |
last_error | string | Most recent failure message, up to 500 characters. Read-only. |
last_error_at | string or null | When last_error was recorded. Read-only. |
resume_cursor | string or null | occurred_at of the newest event this stream has delivered. Read-only, and it only moves forward. |
destination | object | name, destination_type and config. Never includes auth. |
created_at | string | When the stream was created. |
updated_at | string | When the stream was last modified. |
Match rules
Rules are evaluated per event as clause AND, value OR: every clause present must
be satisfied, and inside a list-valued clause one matching value is enough. An absent or
empty clause is skipped, so {} matches every event on the trail.
{
"actions": ["invoice.*", "user.login"],
"actor_types": ["user", "system"],
"organization_ids": ["org_acme_logistics"],
"metadata": [
{"key": "amount_cents", "op": "eq", "value": "4200"},
{"key": "source_ip", "op": "prefix", "value": "203.0.113."}
]
}
| Clause | Shape | Matching | Limits |
|---|---|---|---|
actions | array of strings | Case-sensitive glob against the event's event name, so invoice.* matches invoice.created. | At most 50 entries, each at most 255 characters. |
actor_types | array of strings | Exact match against actor.type (user, system, agent, anonymous). | Each entry must be a non-empty string of at most 255 characters. |
organization_ids | array of strings | Exact match against the event's organization_id. | At most 50 entries, each at most 255 characters. |
metadata | array of {key, op, value} | Every clause must match; op is eq, prefix or contains. | At most 20 clauses. Each clause carries exactly key, op and value; key and value are strings of at most 255 characters. |
Metadata values are compared as strings, a clause whose key is absent from the event
never matches, and there is no nesting, negation or per-clause combinator. The four
clause names are the only accepted keys: anything else is refused (400 on the write).
Stream states
| State | Meaning |
|---|---|
active | Delivering. Matching events are queued and sent. |
inactive | Stopped on purpose: the stream is pushed to the delivery service with paused: true. |
error | Paused by delivery failures — five consecutive failed batches, or a batch the destination asked to retry later than five minutes. Events are held in the stream's own queue, and one trial batch probes the endpoint; a success returns the stream to active and the held events follow, oldest first. |
invalid | A permanent failure, such as a redirect, a 410, a refused credential, an outbound-policy rejection, or 72 hours of continuous failure. Nothing is delivered until someone fixes the destination and activates the stream. |
resume_cursor is the occurred_at of the newest event the stream has delivered, and it
only ever moves forward. It is informational: what a stream still owes a destination
lives in that stream's queue in the delivery service, which is why pausing, failing and
resuming never lose or resend an event beyond the batch that was in flight.
Signing secrets
Every stream has a whsec_ signing secret, and every request to its destination is signed
with it — see Verifying a delivery. The
secret is a credential: it is returned by its own endpoint rather than by the stream read
shape, and that endpoint needs the manage scope.
curl https://api.santati.io/api/v0/streams/0192f6b1-7a40-7d3c-b5e8-1c2f9a0d4e63/signing-secret/ \
-H "Authorization: Api-Key $SANTATI_API_KEY"
{
"signing_secret": "whsec_REPLACE_WITH_YOUR_SECRET",
"previous_signing_secret_expires_at": null
}
Rotating mints a new secret and moves the current one into the overlap slot, for 24 hours:
curl -X POST https://api.santati.io/api/v0/streams/0192f6b1-7a40-7d3c-b5e8-1c2f9a0d4e63/signing-secret/rotate/ \
-H "Authorization: Api-Key $SANTATI_API_KEY"
{
"signing_secret": "whsec_REPLACE_WITH_YOUR_NEW_SECRET",
"previous_signing_secret_expires_at": "2026-10-01T09:44:31.201774Z"
}
While the overlap is open, webhook-signature carries two entries and either verifies, so
you can update your verifier without a delivery gap; once it closes, only the new secret
signs. A rotation that the delivery service refuses is rolled back and answers 503, so
the secret you read back is always the secret that signs. In the app, the stream's page
shows the secret (admins only, hidden behind a reveal toggle) and a Rotate signing
secret button that does the same thing.
Delivery behaviour
- Batching. A request carries at most 100 events and at most 900,000 bytes. A batch is sent as soon as it reaches either limit, or shortly after the first event of a partial batch. An event larger than 900,000 bytes is sent on its own.
- Order. Each stream delivers in the order its events were ingested. Two streams on the same trail are independent.
- At-least-once. A batch is settled only after a
2xx. A timeout, a crash or a redeploy requeues everything that batch held, so a destination may see the same batch twice: deduplicate onwebhook-id— deterministic for a given stream and set of events, so a retried batch repeats it — and on the eventid. - Retries. A retryable failure is retried with exponential backoff and jitter, and a
Retry-Afterheader (seconds or an HTTP date, capped at 24 hours) is honoured. - Circuit breaker. Five consecutive failed batches, or one long
Retry-After, opens the breaker and moves the stream toerror: its events pile up in its own queue, so one broken endpoint cannot slow down any other stream. After a delay that grows with each attempt (30 seconds up to 30 minutes) a single trial batch probes the endpoint. - Permanent failures (a redirect,
410, a refused credential, any other4xxexcept408,425and429) are not retried and move the stream toinvaliduntil it is activated again. So does 72 hours of continuous failure. - Expiry and replay. An event that sits undelivered for 7 days moves to the stream's dead-letter queue, and is kept there for 7 more days. The stream's page in the app can move up to 1,000 dead-lettered events back onto the queue (Replay).
- What it is not. Orders across streams are not defined, redirects are never followed, and there is no per-event retry budget: a transient failure holds the stream's queue rather than dropping events.
Plan limits
Log streams are available on the Enterprise plan, which also sets the stream ceiling. A team
whose plan has no log streams is refused with 400 and code quota_exceeded and the message
Your plan does not include log streams. They start on the Enterprise plan.; a team at its
ceiling is refused the same way:
{
"error": {
"code": "quota_exceeded",
"message": "This team has reached its log stream limit (25).",
"field": null
}
}
See pricing for what Enterprise includes. Available destination types are also plan-gated, and requesting one the plan does not include is refused the same way. See Errors for the shared error envelope.
Edit a stream
A PATCH may change only the rules, only the status, or only the destination config.
This example narrows the rules and the stored auth header is left untouched:
curl -X PATCH https://api.santati.io/api/v0/streams/0192f6b1-7a40-7d3c-b5e8-1c2f9a0d4e63/ \
-H "Authorization: Api-Key $SANTATI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"match_rules": {
"actions": ["invoice.*", "user.login"],
"organization_ids": ["org_acme_logistics"]
}
}'
{
"id": "0192f6b1-7a40-7d3c-b5e8-1c2f9a0d4e63",
"name": "invoice-audit-siem",
"trail": "production",
"status": "active",
"match_rules": {
"actions": ["invoice.*", "user.login"],
"organization_ids": ["org_acme_logistics"]
},
"consecutive_failures": 0,
"last_error": "",
"last_error_at": null,
"resume_cursor": "2026-09-30T09:44:31.201774Z",
"destination": {
"name": "invoice-audit-siem",
"destination_type": "https",
"config": {
"url": "https://siem.example.com/ingest/santati",
"content_type": "ndjson",
"timeout_seconds": 15
}
},
"created_at": "2026-09-30T09:41:12.884013Z",
"updated_at": "2026-09-30T09:52:07.145520Z"
}
Streams are managed in the app under Audit Log → Log streams.