Skip to main content
The REST API supports Server-Sent Events (SSE) for real-time streaming. Send a GET request with Accept: text/event-stream and Lark pushes data changes to you as they happen.

Starting a stream

The -N flag disables curl’s output buffering so events appear immediately.

Event format

Events follow the SSE specification. Each event has a type and a JSON data payload:

Event types

Initial data

The first event on any stream is a put containing the complete current value at the path:
After that, you receive incremental put and patch events as data changes.

Path semantics

The path field in each event is relative to the path you subscribed to. If you stream /players, a put works like this:
  • {"path":"/","data":{...}} means the entire /players subtree changed.
  • {"path":"/alice/score","data":300} means only /players/alice/score changed.
  • {"path":"/carol","data":{"name":"Carol","score":0}} means a new child /players/carol was added.
A patch lists the children that changed. {"path":"/alice","data":{"score":300}} sets /players/alice/score and leaves the rest of /players/alice alone. If an update touches several parents, you get one patch per parent: a multi-path update to alice/score and bob/score sends a patch at /alice and another at /bob. Streams leave priorities out too.

Using SSE in code

Browser (EventSource)

Node.js

Use any SSE client library, or read the stream manually:

When to use streaming

SSE streaming is useful when you need real-time updates but can’t use a WebSocket-based SDK:
  • Watching for changes from a backend service.
  • Streaming events to a log or monitoring pipeline.
  • Simple web clients where EventSource (built into every browser, no dependencies) is enough.
For most client-side applications, the Lark SDK or Firebase SDKs provide a better developer experience with automatic reconnection, local caching, and typed snapshots.