Join us May 13th & May 14th at Interrupt, the Agent Conference by LangChain. Buy tickets >
curl --request POST \
--url https://api.example.com/threads/{thread_id}/stream/events \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"values"
],
"namespaces": [
[
"<string>"
]
],
"depth": 1,
"since": 1
}
'"<string>"Open a connection-scoped SSE event stream for a thread. The request body is a ProtocolEventStreamRequest carrying channel and namespace filters; the server replies with Content-Type: text/event-stream and pushes matching ProtocolEvent frames for the lifetime of the connection. Closing the connection unsubscribes — no state is persisted server-side.
Reconnect: clients pass the last seq they received as since in the body. Buffered events with seq > since are replayed before the stream goes live. The endpoint is POST-only, so browser-native EventSource auto-resume (Last-Event-ID) does not apply — clients drive resume explicitly via the body.
curl --request POST \
--url https://api.example.com/threads/{thread_id}/stream/events \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"values"
],
"namespaces": [
[
"<string>"
]
],
"depth": 1,
"since": 1
}
'"<string>"Documentation Index
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
Use this file to discover all available pages before exploring further.
The ID of the thread to observe.
Body of POST /threads/{thread_id}/stream/events. Filters the connection-scoped SSE stream.
Channels to subscribe to for the lifetime of this connection.
1Subscribable event channel. One of the eight fixed channels or a user-defined custom:<name> namespaced custom channel emitted by a stream transformer. debug and checkpoints were removed from the protocol in @langchain/protocol@0.0.10 — task-level debug info now flows on the tasks channel, and checkpoint pointers ride on values events as an attached checkpoint envelope.
values, updates, messages, tools, lifecycle, input, tasks, custom Prefix-match filter. An event matches if its namespace starts with any of these prefixes. Omit for all namespaces.
Hierarchical path identifying a position in the agent tree. Empty array denotes the root agent; each segment names a nested subgraph.
Max depth below the namespace prefix. Omit for unbounded depth.
x >= 0Replay events with seq greater than this value before streaming live events.
x >= 0SSE event stream
Stream of ProtocolEvent frames. Each SSE frame uses the event's method as the event: field and a JSON-encoded ProtocolEvent as the data: field; id: is set to the event's seq.
Example frame:
id: 42
event: messages
data: {"type":"event","event_id":"42","seq":42,"method":"messages","params":{"namespace":[],"timestamp":1700000000000,"data":{...}}}
Was this page helpful?