VocalDocscontracts 1.65.0

Stream the Organization events

GET /v1/events/stream

PropertyValue
Operationstream_events
GroupEvents
Scopeevents:read
Route classread
IdempotencyNo Idempotency-Key
AuditNot audited: Vocal's types carry identifiers, status, codes and instants only (ADR 0051 rule 4); from 1.62.0 a custom event carries the customer's own data, which travels empty in PHI mode.
Released in1.52.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Answers text/event-stream: every record event of the credential's environment as it is relayed, at least once, each an EventStreamMessage whose SSE id is the event id. types, families and filter_id select as on the log. Resume with Last-Event-ID or after (the header wins), or start from since, within 72 hours (a target); an older resume point is sent one resume_gap first, and the client pages GET /v1/events. since beside either resume point is invalid_request. Up to three connections per credential (a target); a fourth answers 429 stream_limit_reached. A keepalive comment line every 15 seconds (a target).

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the events:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -N "$VOCAL_API/v1/events/stream" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Accept: text/event-stream"

Parameters

NameInTypeRequiredDescription
typesqueryarray of EventTypeNamenoOnly these types, comma-separated; OR with families. Trace types reach the log and the stream only inside call.trace.ready, so naming one selects nothing.
familiesqueryarray of EventFamilynoOnly the types of these families, comma-separated.
filter_idqueryEventFilterIdnoNarrow the selection with this event filter; a filter that is not the Organization's answers not_found.
afterqueryEventIdnoResume after this event, as Last-Event-ID does; the header wins when both are sent.
sincequeryRequestTimestampnoStart from the first event created at or after this instant, within 72 hours (a target); refused beside after or Last-Event-ID.
acceptheaderstringyesMust accept text/event-stream.
last-event-idheaderEventIdnoThe id of the last event the client received, which an SSE client sends itself.

Responses

StatusContent typeShapeError codes
200text/event-streamstring: A text/event-stream body: lines id:, event: and data: per message and a blank line between messages, each message an EventStreamMessage, with comment lines (:) as keepalives.
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
429application/jsonErrorEnvelopestream_limit_reached, rate_limited
500application/jsonErrorEnvelopeinternal_error