id that is monotonic within the session.
Common envelope
Every historical event has this shape:id, type, and time.
Session lifecycle
session.ready
Sent when the opening media is ready to play.
playback.url. The playback URL is for this session; do not construct it yourself.
session.ending
Sent when a closing instruction or another terminal condition has started.
session.ended
Sent when the session is terminal.
reason values are stopped, duration_limit, disconnect_timeout, and error.
Instruction lifecycle
instruction.received
instruction.scheduled
instruction.scheduled event can revise it.
instruction.started
instruction.completed
instruction.cancelled and instruction.failed
Asset events
assets.added
assets.failed
State events
state.updated
Sent when one or more state changes become effective. The state object is the complete current state.
changes can include client_request_id and/or instruction_id for correlation. It does not include internal processing source information.
state.snapshot
Returned only to the connection that sent state.get. It is not part of the event history and has no id.
error
Errors are returned on the control channel as events and include the request id when one was supplied.
error.code for application behavior. Messages are short user-facing explanations and may change.
Ordering and reconnects
- Process historical events in ascending
idorder. - Save the last processed id after handling an event.
- Reconnect with
?last_event_id=<id>to receive events after that cursor. - Use
state.snapshot.last_event_idto align a point-in-time state read with later events. - Unknown event types should be ignored safely so a client can remain forward compatible.