> ## Documentation Index
> Fetch the complete documentation index at: https://supahooks.ar27111994.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /log-stream — Server-Sent Events live feed

> Stream live webhook events in real time using GET /log-stream. Covers the SSE wire format, heartbeats, the 100-client limit, and client-side filtering.

`GET /log-stream` opens a persistent Server-Sent Events (SSE) connection that delivers webhook capture events as they are ingested. This lets you watch live traffic without polling `/logs`.

**Authentication:** Required when `authKey` is configured.

## Connection behavior

* Compression is **disabled** on this route to ensure SSE frames are flushed immediately.
* The server enforces a maximum of **100 concurrent SSE clients**. When this limit is reached, new connection attempts receive `503 Service Unavailable`.
* There is **no server-side `webhookId` filter**. All events from all active webhooks are streamed to every connected client. Filter by `webhookId` in your client code.

## Wire format

The stream uses standard SSE `data:` frames for event payloads and SSE comment frames (`: ...`) for connection and keepalive traffic. There is no named `event:` field in the current implementation.

```text theme={null}
: connected

data: {"id":"evt_123","webhookId":"wh_abc123","method":"POST","statusCode":200}

: heartbeat
```

* `: connected` — sent immediately after the connection is established.
* `data: {...}` — a JSON object containing the live ingestion event.
* `: heartbeat` — sent every **30 seconds** as a keepalive comment to prevent proxy and load balancer timeouts.

<Note>
  The streamed event shape is the live ingestion payload produced by the middleware, not the paginated DuckDB response shape returned by `GET /logs`.
</Note>

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl -N \
    -H "Authorization: Bearer your-shared-secret" \
    "https://<run-id>.runs.apify.net/log-stream"
  ```

  ```javascript EventSource (browser) theme={null}
  const source = new EventSource(
    'https://<run-id>.runs.apify.net/log-stream?key=your-shared-secret'
  );

  source.onmessage = (event) => {
    const data = JSON.parse(event.data);

    // Filter client-side by webhookId if needed
    if (data.webhookId === 'wh_abc123') {
      console.log('New event:', data);
    }
  };

  source.onerror = (err) => {
    console.error('SSE connection error', err);
  };
  ```
</CodeGroup>

## 503 when client limit is reached

```json theme={null}
{
  "status": 503,
  "error": "Service Unavailable",
  "message": "Maximum concurrent SSE client limit reached"
}
```
