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

# Stream live events

> A WebSocket that tells you about each new webhook event.

```text theme={null}
GET wss://hooksnode.com/api/v1/projects/{projectId}/listen
```

Open a WebSocket with your API key in the `Authorization` or `X-API-Key` header. hooksnode sends one message for each new event that a webhook or WhatsApp source receives:

```json theme={null}
{
  "type": "new_event",
  "project_id": "2mJ8kQ4vXw9aB3cD5eF7gH1iK0L",
  "event": {
    "id": 1042,
    "status": "received",
    "method": "POST",
    "endpoint": "/p/2mJ8kQ4vXw9aB3cD5eF7gH1iK0L",
    "source_id": "2mJ8kQ4vXw9aB3cD5eF7gH1iK0L",
    "created_at": "2026-09-24T10:15:02Z"
  }
}
```

The message has no body. To get the headers and body, call [Get the raw request](/api-reference/endpoints/get-event-request) with `event.id`.

## Notes

* Mail and polled events are not streamed.
* The stream is live only. Events that arrive while you are not connected are not sent later. Use [List events](/api-reference/endpoints/list-events) to catch up.
* `status` is `buffered` for a buffered event.

## Example

```javascript Node.js theme={null}
import WebSocket from "ws";

const base = "https://hooksnode.com";
const project = process.env.HOOKSNODE_PROJECT;
const headers = { Authorization: `Bearer ${process.env.HOOKSNODE_API_KEY}` };

const ws = new WebSocket(`wss://hooksnode.com/api/v1/projects/${project}/listen`, { headers });

ws.on("message", async (data) => {
  const msg = JSON.parse(data);
  if (msg.type !== "new_event") return;
  const res = await fetch(`${base}/api/v1/projects/${project}/events/${msg.event.id}/request`, { headers });
  const req = await res.json();
  console.log(req.method, req.path, req.body);
});
```

The [CLI](/cli/listen) does this for you.
