---
title: "Stream live events with SSE"
method: GET
path: "/api/sites/{siteId}/stream"
tags: ["Real time"]
---

# Stream live events with SSE

`GET /api/sites/{siteId}/stream`

## Request

- Base URL: `https://slimlytics.com`
- URL: `https://slimlytics.com/api/sites/{siteId}/stream`
- Auth: API key in query parameter `token`

Native EventSource authentication uses the short-lived session JWT in the token query parameter because EventSource cannot set an Authorization header. Personal API tokens are intentionally rejected here and must never be placed in URLs.

## Path parameters

- `siteId` string, uuid, required

## Query parameters

- `token` string
- `lastEventId` integer

## Response `200`

Server-sent event stream

## Other responses

- `400`: Invalid request
- `401`: Authentication required or invalid/expired credential
- `403`: Credential lacks permission
- `404`: Resource not found
- `500`: Internal service error

---

[API](https://skmtc.dev/slimlytics/apis/slimlytics-api.md) · [All operations](https://skmtc.dev/slimlytics/apis/slimlytics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/slimlytics/apis/slimlytics-api/revisions/f9a26641a254?raw)
