---
title: "Stream your changes"
method: GET
path: "/stream/changes"
tags: ["Stream"]
---

# Stream your changes

`GET /stream/changes`

## Request

- Base URL: `https://gorest.co.in/public/v3`
- URL: `https://gorest.co.in/public/v3/stream/changes`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `ticket`

Every create, update and delete in your own v3 data, as Server-Sent Events (`text/event-stream`), within about a second of the commit. Sample rows never change, so they send nothing. Each event has an `id`, an `event` name and one `data` line of JSON:

- `ready`: the stream is open. Read the data you show now; every change from here on comes as an event.
- `change`: one row was created, updated or deleted. `data` is a `ChangeEvent`; read the row at `href` for its new state.
- `reset`: your data changed as a whole (a reset of your data) or the stream lost its place. Read the data you show again.

A comment line `: heartbeat` comes every 25 seconds. The stream ends after 30 minutes, at the token's end, when the token is revoked, or when the server restarts; connect again after `retry` milliseconds and send the last `id` you got as `Last-Event-ID`. Within 5 minutes you get the events you missed, else `reset`. An event may come twice after a reconnect; drop one you have seen by its `id`. At most 3 streams per token and 10 per account on each server.

A browser `EventSource` cannot send a header: get a ticket from `POST /stream/tickets` and open `?ticket=<ticket>`, with `&last-event-id=<id>` to resume. A ticket works once, also when the connect is refused (a 429, for one), so get a new one before every connect.

## Query parameters

- `last-event-id` string

## Headers

- `Last-Event-ID` string

## Response `200`

The stream. Each event is `id:`, `event:` and `data:` lines and a blank line; `data` of `change` is a `ChangeEvent`, of `ready` and `reset` `{}`.

## Other responses

- `400`: A parameter is wrong, unknown or out of range.
- `401`: No token, or the token is wrong, expired or revoked.
- `403`: The token lacks the scope this operation needs.
- `429`: Over the rate limit; wait `Retry-After` seconds.
- `500`: Something failed on the server.
- `503`: The API cannot answer right now; wait `Retry-After` seconds.

---

[API](https://skmtc.dev/gorest/apis/gorest-api-v3.md) - [All operations](https://skmtc.dev/gorest/apis/gorest-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/gorest/apis/gorest-api-v3/revisions/89aa429755a6?raw)
