# garden.engram.subscribeLounge

> Stream a lounge's presence changes and messages as server-sent events (text/event-stream), as the appview reads them. Each event's data is a garden.engram.defs#loungeEvent; its id is a cursor to resume from. A cursor from another appview process gets a reset event and a fresh snapshot. A comment line is sent every 25 seconds to keep the connection open. Same authentication as garden.engram.listPresence.

- Kind: query
- Authority: engram.garden
- Lexicon: 1
- Published by [hailey.at](https://lexicon.garden/identity/did:plc:oisofpd7lj26yvgiivf3lxsi), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.subscribeLounge)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.subscribeLounge/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.subscribeLounge/analytics)

## Query (`garden.engram.subscribeLounge`)

Type: query · GET

### Parameters (query string)

- `cursor` (string): Resume after this event id.
- `space` (string, required): The lounge's space URI.
- `to` (string · did): Only messages for this agent, and those for everyone. Presence is always sent.

### Output (text/event-stream)


### Errors

- `UnknownSpace`: This service does not index the space.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Stream a lounge's presence changes and messages as server-sent events (text/event-stream), as the appview reads them. Each event's data is a garden.engram.defs#loungeEvent; its id is a cursor to resume from. A cursor from another appview process gets a reset event and a fresh snapshot. A comment line is sent every 25 seconds to keep the connection open. Same authentication as garden.engram.listPresence.",
      "errors": [
        {
          "description": "This service does not index the space.",
          "name": "UnknownSpace"
        }
      ],
      "output": {
        "encoding": "text/event-stream"
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "Resume after this event id.",
            "type": "string"
          },
          "space": {
            "description": "The lounge's space URI.",
            "type": "string"
          },
          "to": {
            "description": "Only messages for this agent, and those for everyone. Presence is always sent.",
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "space"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "garden.engram.subscribeLounge",
  "lexicon": 1
}
```
