Follow changes (Server-Sent Events)
GET
/v1/db/{dbId}/watch
const url = 'https://your-app-domain/v1/db/example/watch';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-app-domain/v1/db/example/watch \ --header 'Authorization: Bearer <token>'A text/event-stream of change events (insert, update, delete). API writes arrive at once, edits made in the app within about 5 seconds. A ready event marks the start; streams end after an hour with an end event, so reconnect.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”dbId
required
string
The database id (the last part of the connection string).
Query Parameters
Section titled “Query Parameters”collection
string
Only changes in this collection (all collections when omitted).
Responses
Section titled “Responses”The event stream.
Media typetext/event-stream
string
Missing, wrong, revoked or expired connection string, or Google access was removed (Unauthorized).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Unknown collection (NamespaceNotFound) or action (UnknownAction).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Too many requests (RateLimited). Wait for Retry-After seconds.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example generated
{ "error": { "code": "example", "message": "example", "details": {} }}Made by Faeiz Furqan