Skip to main content
GET
https://{tenantDomain}/api/v2
/
events
Subscribe to events via Server-Sent Events (SSE)
curl --request GET \
  --url https://{tenantDomain}/api/v2/events \
  --header 'Authorization: Bearer <token>'
{
  "type": "group.created",
  "offset": "<string>",
  "event": {
    "specversion": "<string>",
    "type": "group.created",
    "source": "<string>",
    "id": "<string>",
    "time": "2023-11-07T05:31:56Z",
    "data": {
      "object": {
        "id": "<string>",
        "name": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "type": "connection",
        "connection_id": "<string>",
        "external_id": "<string>"
      },
      "context": {
        "tenant": {
          "tenant_id": "<string>"
        },
        "client": {
          "id": "<string>",
          "name": "<string>",
          "metadata": {}
        },
        "connection": {
          "id": "<string>",
          "name": "<string>",
          "strategy": "<string>"
        },
        "request": {
          "geo": {
            "continent_code": "<string>",
            "country_code": "<string>",
            "country_name": "<string>",
            "latitude": 123,
            "longitude": 123,
            "subdivision_code": "<string>",
            "subdivision_name": "<string>",
            "city_name": "<string>",
            "time_zone": "<string>"
          },
          "hostname": "<string>",
          "ip": "<string>",
          "method": "<string>",
          "user_agent": "<string>",
          "custom_domain": "<string>"
        }
      }
    },
    "a0tenant": "<string>",
    "a0stream": "<string>",
    "a0purpose": "test"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

from
string

Opaque token representing position in the stream. If not provided, stream will start from the latest events.

Maximum string length: 1024
from_timestamp
string

RFC-3339 timestamp indicating where to start streaming events from. This should only be used on the initial query when a cursor may not be available. Subsequent requests should use the cursor (from) as it will be more accurate.

Maximum string length: 20
event_type

Event type(s) to listen for. Specify multiple times for multiple types (e.g., ?event_type=user.created&event_type=user.updated). If not provided, all event types will be streamed.

Available options:
group.created,
group.deleted,
group.member.added,
group.member.deleted,
group.role.assigned,
group.role.deleted,
group.updated,
organization.connection.added,
organization.connection.removed,
organization.connection.updated,
organization.created,
organization.deleted,
organization.group.role.assigned,
organization.group.role.deleted,
organization.member.added,
organization.member.deleted,
organization.member.role.assigned,
organization.member.role.deleted,
organization.updated,
user.created,
user.deleted,
user.updated

Response

Event stream successfully established.

The JSON payload delivered in each SSE data line. The type field is injected from the SSE event field by the SDK. Discriminated by type: an event type name for events, "error" for errors, and "offset-only" for cursor-only heartbeats.

type
enum<string>
required

The event type (injected from the SSE event field).

Available options:
group.created
offset
string
required

Opaque cursor representing position in the stream. Pass as the from query parameter to resume.

event
object
required

Represents an event that occurs when a group is created.