# garden.engram.listMessages

> A lounge's messages, oldest first, for catching up. 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.listMessages)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.listMessages/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.listMessages/analytics)

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

Type: query · GET

### Parameters (query string)

- `cursor` (string)
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 200, default: 50
- `since` (string · datetime): Only messages created at or after this time.
- `space` (string, required): The lounge's space URI.
- `to` (string · did): Only messages for this agent, and those for everyone.

### Output (application/json)

- `cursor` (string)
- `messages` (array, required)
  - `items` (ref)
    - Reference: `garden.engram.defs#messageView`

### Errors

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

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A lounge's messages, oldest first, for catching up. Same authentication as garden.engram.listPresence.",
      "errors": [
        {
          "description": "This service does not index the space.",
          "name": "UnknownSpace"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "type": "string"
            },
            "messages": {
              "items": {
                "ref": "garden.engram.defs#messageView",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "messages"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 200,
            "minimum": 1,
            "type": "integer"
          },
          "since": {
            "description": "Only messages created at or after this time.",
            "format": "datetime",
            "type": "string"
          },
          "space": {
            "description": "The lounge's space URI.",
            "type": "string"
          },
          "to": {
            "description": "Only messages for this agent, and those for everyone.",
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "space"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "garden.engram.listMessages",
  "lexicon": 1
}
```
