Events (server-sent events)
Stream live browser, sync, job and RPA events from the Quin Local API over server-sent events, filter them and resume after a disconnect.
Trang này chưa có bản tiếng Việt. Nội dung tiếng Anh được hiển thị bên dưới.
GET /api/v1/events is a server-sent events stream (text/event-stream). It tells your script
what happens without polling: browsers starting and closing, navigations, actions, Quin Cloud saves,
lease and proxy problems, job and RPA progress. There is no WebSocket endpoint.
Connect
Any valid token can connect; you receive only the events your token's scopes allow.
curl -N http://127.0.0.1:50380/api/v1/events?kinds=browser.*,job.updated \
-H "Authorization: Bearer $QUIN_API_TOKEN" -H "Accept: text/event-stream"| Query / header | Notes |
|---|---|
kinds | Comma-separated kinds. An entry matches the exact kind or any kind starting with it; a trailing * is allowed (browser.*) |
last_event_id (query) or Last-Event-ID (header) | Resume after this event id. Without either, the stream starts with new events only |
Wire format
: connected
id: 412
event: navigation
data: {"ts": "2026-11-02T09:21:03", "session_id": "s_3f9c1d2e8a7b6c5d", "profile_id": "AbCd1234", "cloud_id": null, "event": "navigation", "tab": "t1", "url": "https://example.com/"}
id: 413
event: job.updated
data: {"ts": "2026-11-02T09:21:05", "job_id": "job_8c41d0e2b9a3", "state": "COMPLETED"}
: keep-aliveidincreases by one per event;eventis the kind;datais one JSON object starting withts.- A comment line
: keep-aliveis sent after 15 seconds without events. - Event data never contains tokens, passwords, cookie values or typed secret values.
Resuming and history
Quin keeps the last 1,000 events in memory. Reconnect with the last id you processed to receive
what you missed. If you fell further behind than the history, the stream says so before continuing:
event: reset
data: {"reason": "history_exceeded"}History starts empty when Quin starts; event ids are not preserved across restarts.
Revocation
An open stream re-checks its token and the signed-in account every 30 seconds. When the token was revoked or expired, or the account is no longer allowed, the stream sends a final event and ends:
event: account.revoked
data: {"code": "token_revoked"}The stream also ends when the Local API is turned off or Quin closes. A connection without a valid
token is refused with 401.
Event kinds
| Kind | Scope needed | Data (besides ts) |
|---|---|---|
browser.starting | browser:open | Session fields; also sent while a Quin Cloud lease is acquired |
browser.started | browser:open | Session fields |
browser.failed | browser:open | Session fields and error, or profile_id and state after a crash |
browser.closed | browser:open | Session fields and final state |
session.control_released | browser:open | Session fields and reason (for example taken_over, closing) |
tab.opened, tab.closed | browser:open | Session fields and tab |
navigation | browser:open | Session fields, tab, url |
action.started | browser:control | Session fields, action_id, action |
action.completed | browser:control | Session fields, action_id, action, duration_ms |
action.failed | browser:control | Session fields, action_id, action, code |
recorder.started | browser:control | Session fields |
runtime.download_progress | profiles:read | profile_id, state, message, progress |
sync.started, sync.completed, sync.failed | profiles:read | profile_id, state, message, progress |
lease.lost | profiles:read | profile_id, state, message |
proxy.failed | profiles:read | profile_id and state/message or reason |
recovery.required | profiles:read | profile_id, state, message |
job.updated | jobs:read | job_id, state |
task.updated, task.finished, run.updated, step.updated | rpa:read | Task, run or step progress |
account.revoked | any token | reason or code |
"Session fields" are session_id, profile_id (the local profile id), cloud_id and event.
sync.completed means Quin Cloud committed the profile's revision (SYNCED).
With the SDKs
Both SDKs reconnect automatically with Last-Event-ID and filter by kind on the client as well.
for ev in client.events(kinds=["browser.*", "job.updated"]):
print(ev.id, ev.kind, ev.data)for await (const ev of client.events({ kinds: ["sync.completed"] })) {
console.log(ev.id, ev.kind, ev.data);
}quin events --kind run.updated --kind task.finishedThe Python generator reconnects after 75 seconds without data (read_timeout), with exponential
backoff up to 30 seconds; authorization errors (401/403) are raised, not retried.