Stream reconnectable durable-run events
curl --request GET \
--url https://api.praxa.io/v1/runs/{id}/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.praxa.io/v1/runs/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.praxa.io/v1/runs/{id}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)id: 1
event: run.accepted
data: {"apiVersion":"v1","run_id":"018f0000-0000-7000-8000-000000000001","sequence":1,"at":"2026-08-13T12:00:00.000Z","type":"run.accepted","replayed":false}
Tasks, runs & usage
Stream reconnectable durable-run events
Stream ordered Praxa run events over SSE, persist the numeric cursor, and resume safely after a disconnect.
GET
/
v1
/
runs
/
{id}
/
events
Stream reconnectable durable-run events
curl --request GET \
--url https://api.praxa.io/v1/runs/{id}/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.praxa.io/v1/runs/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.praxa.io/v1/runs/{id}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)id: 1
event: run.accepted
data: {"apiVersion":"v1","run_id":"018f0000-0000-7000-8000-000000000001","sequence":1,"at":"2026-08-13T12:00:00.000Z","type":"run.accepted","replayed":false}
Stream ordered Praxa run events over SSE, persist the numeric cursor, and resume safely after a disconnect.
Availability: Production partner preview. Required scope:
runs:read.Authenticate safely
Create a disposable personal workspace API key with exactlyruns:read. Send it as Authorization: Bearer $PRAXA_API_KEY. A Gateway OAuth token, Supabase JWT, provider credential, or organization memory key is not interchangeable with this key.
The hosted playground sends the credential from your browser session to the documented API through the configured playground proxy. Use test data, never share the key, and revoke it when the check ends.
Request fields
string
required
id path parameter.
integer
Resume strictly after this task_run_events sequence.
Runnable request examples
curl --fail-with-body --no-buffer -X GET 'https://api.praxa.io/v1/runs/018f0000-0000-7000-8000-000000000001/events' \
-H "Authorization: Bearer $PRAXA_API_KEY" \
-H "Last-Event-ID: 0" \
-H "Accept: text/event-stream"
const response = await fetch("https://api.praxa.io/v1/runs/018f0000-0000-7000-8000-000000000001/events", {
"method": "GET",
"headers": {
"Authorization": `Bearer ${process.env.PRAXA_API_KEY}`,
"Last-Event-ID": "0",
"Accept": "text/event-stream"
}
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
if (!response.body) throw new Error("SSE response had no body");
const decoder = new TextDecoder();
let buffer = "";
for await (const chunk of response.body) {
buffer = (buffer + decoder.decode(chunk, { stream: true })).replaceAll("\r\n", "\n");
for (;;) {
const boundary = buffer.indexOf("\n\n");
if (boundary < 0) break;
const frame = buffer.slice(0, boundary);
buffer = buffer.slice(boundary + 2);
if (frame && !frame.startsWith(":")) console.log(frame);
}
}
import json
import os
from urllib import error, request
req = request.Request(
"https://api.praxa.io/v1/runs/018f0000-0000-7000-8000-000000000001/events",
method="GET",
headers={
"Authorization": f"Bearer {os.environ['PRAXA_API_KEY']}",
"Last-Event-ID": "0",
"Accept": "text/event-stream"
},
)
try:
with request.urlopen(req, timeout=30) as response:
frame_lines = []
for raw_line in response:
line = raw_line.decode("utf-8").rstrip("\r\n")
if line:
if not line.startswith(":"):
frame_lines.append(line)
elif frame_lines:
print("\n".join(frame_lines), flush=True)
frame_lines.clear()
if frame_lines:
print("\n".join(frame_lines), flush=True)
except error.HTTPError as exc:
raise RuntimeError(f"{exc.code}: {exc.read().decode()}") from exc
What success means
A200 response opens an SSE stream. Completion is proven only by a terminal event or authoritative run readback.
Successful response
200 — SSE frames include matching numeric id and payload sequence. Comment heartbeats may appear. During uncertain-outcome reconciliation, the run remains non-terminal and keeps the stream open. A completed, failed, or cancelled run closes it.id: 1
event: run.accepted
data: {"apiVersion":"v1","run_id":"018f0000-0000-7000-8000-000000000001","sequence":1,"at":"2026-08-13T12:00:00.000Z","type":"run.accepted","replayed":false}
Handle failures
| Response | Meaning | Safe action |
|---|---|---|
400 invalid_request | The method, path, headers, query, or body failed strict validation. | Correct the request; do not retry unchanged input. |
401 authentication_failed | The bearer key is missing, malformed, expired, or revoked. | Stop and replace the key through the authenticated console. |
403 authorization_failed | The authenticated key lacks scope or tenant authority. | Request only the missing least-privilege scope; never substitute another tenant ID. |
429 rate_limited | The principal exceeded a bounded rate. | Honor retryAfterMs or Retry-After, add jitter, and cap attempts. |
retryable 5xx | The server could not confirm a final response. | Reconcile reads or replay the exact keyed mutation before creating new work. |
Example problem
{
"type": "https://docs.praxa.io/problems/authorization-failed",
"title": "Authorization failed",
"status": 403,
"code": "authorization_failed",
"detail": "The API key does not grant the required scope.",
"retryable": false
}
Verify the result
- Require each event
idto match its payload sequence. - Reconnect with
Last-Event-IDand reject sequence regression. - Treat EOF before a terminal event as incomplete.
Retry, cleanup, and production use
- Treat
401,403, and409as authority or state signals, not generic retry prompts. - For
429or retryable 5xx responses, follow server retry guidance and keep a bounded attempt budget. - Move the request into a trusted application backend before production; never ship the Praxa key in browser or mobile code.
- Revoke the disposable key, disable test webhooks, and erase disposable candidate data after validation.
Last modified on August 14, 2026