Sign inGet Started

Publish a batch of Realtime events

POST
/v1/realtime/apps/{realtime_app_id}/batch-events
await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
  events: [
    { event: "order.created", channel: "orders", data: { id: 1 } },
    { event: "order.updated", channel: "orders", data: { id: 2 } },
  ],
});
Response200
{
  "data": [
    {
      "channel": "orders-42"
    }
  ]
}

Publishes up to 10 events (each to one channel) in a single request.

Parameters

realtime_app_idstring

ID of the Realtime app (rap_ prefix), as returned when the app was created.

Request Payload

events
array of object
required

Up to 10 events per batch.

Show child parameters

Response Payload

data
array of object

Per-event channel attributes at publish time, present only when at least one event asked for them via include. Positional: one item per event, in request order.

Show child attributes
data.member_count
integer

Distinct members (presence channels only; requires include=member_count).

data.connection_count
integer

Connections currently subscribed to this channel (requires include=connection_count and the app's connection-counting flag). Channel-scoped: distinct from the app-wide peak connections metric.

data.channel
string
required

A Realtime channel name. Only letters, digits, and _ - = @ , . ; Prefix with private- or presence- for authenticated channels, or private-encrypted- for channels whose payloads are end-to-end encrypted with a key only you hold.

Continue with the documentation, guides and examples for this topic.