Hanzo AI
OpenapiAgents

Create events

Records one turn of a session's transcript and answers 201 with it.

POST /v1/agents/sessions/{id}/events

Addresshttps://api.hanzo.ai/v1/agents/sessions/{id}/events
MethodPOST
Operationpost_agents_sessions_by_id_events
AuthAuthorization: Bearer $HANZO_API_KEY

Records one turn of a session's transcript and answers 201 with it.

A progress turn additionally MOVES THE SESSION'S PROGRESS, marked as the run's own word rather than an estimate, and pushes the updated session onto the live stream — so a board's bar follows the run without polling and without a second write path. See progress.go.

THE TURN IS SCANNED BEFORE IT IS STORED. The same engine the code-security surface runs reads the payload at this boundary, and a credential in it refuses the append with 422 rather than redacting it — a redacted transcript is one that still had the secret in it once, and this way the author learns which value to rotate. The refusal carries every finding: the rule, the severity, the line, a MASKED preview and the fingerprint. The secret is never in the answer.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyesID is the session to append to, from the path.
actorbodystringActor is who produced the turn. Empty takes the validated caller, which is what an agent writing its own transcript wants; naming one is for a surface…
idbodystringID is the session to append to, from the path.
kindbodystringKind is what this turn IS: message, tool-call, spawn, log, status, control or progress.
payloadbodyanyPayload is the turn's own body, any valid JSON up to 64 KiB.

Response

StatusBodyMeaning
201eventViewcreated

201 body — 7 fields.

FieldInTypeAlwaysDescription
actorbodystringActor is who produced the turn.
createdAtbodystringCreatedAt is when the turn was recorded, RFC 3339 in UTC to the second.
idbodystringID is the event's own handle, minted as "evt_" + 32 hex characters.
kindbodystringKind is what the turn IS, from a closed six: message (a model turn), tool-call, spawn (a subagent started), log, status, control (a steering command the…
payloadbodyanyPayload is the turn's body, embedded as JSON rather than as a string — whatever the writer sent, up to 64 KiB, checked for well-formedness and scanned for…
seqbodyintegerSeq is the turn's position in this session's log: monotonic from 1, assigned by the store inside the insert, and unique PER SESSION rather than globally.
sessionIdbodystringSessionID is the session this turn belongs to.

Failure carries the platform error shape — see Errors.

Examples

hanzo agents sessions events <id>

Agents API · All Hanzo APIs · Interactive reference

How is this guide?

On this page