# ai.newnal.trustsquare.getChatMessages

> Published by [bezalel-newnal.bsky.social](https://lexicon.garden/identity/did:plc:75qhtany5zmo7d3i2ni5d7nf)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:75qhtany5zmo7d3i2ni5d7nf/ai.newnal.trustsquare.getChatMessages)
- [Documentation](https://lexicon.garden/lexicon/did:plc:75qhtany5zmo7d3i2ni5d7nf/ai.newnal.trustsquare.getChatMessages/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:75qhtany5zmo7d3i2ni5d7nf/ai.newnal.trustsquare.getChatMessages/examples)

## Definitions

### `ai.newnal.trustsquare.getChatMessages`

**Type**: `query`

Page through chat messages of a live Square (newest first by default).

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No |  |
| `cursor` | `string` | No |  |
| `square` | `string` (at-uri) | Yes |  |
| `direction` | `string` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No |  |
| `messages` | `array` | Yes |  |

## Raw Schema

```json
{
  "id": "ai.newnal.trustsquare.getChatMessages",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "messages"
          ],
          "properties": {
            "cursor": {
              "type": "string"
            },
            "messages": {
              "type": "array",
              "items": {
                "ref": "ai.newnal.trustsquare.defs#chatMessageView",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "square"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "default": 50,
            "maximum": 200,
            "minimum": 1
          },
          "cursor": {
            "type": "string"
          },
          "square": {
            "type": "string",
            "format": "at-uri"
          },
          "direction": {
            "type": "string",
            "default": "backward",
            "knownValues": [
              "backward",
              "forward"
            ]
          }
        }
      },
      "description": "Page through chat messages of a live Square (newest first by default)."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
