# games.atplay.listInvitations

> Published by [atplay.games](https://lexicon.garden/identity/did:plc:xawtkr77srkxlwhxjf7whbml)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:xawtkr77srkxlwhxjf7whbml/games.atplay.listInvitations)
- [Documentation](https://lexicon.garden/lexicon/did:plc:xawtkr77srkxlwhxjf7whbml/games.atplay.listInvitations/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:xawtkr77srkxlwhxjf7whbml/games.atplay.listInvitations/examples)

## Definitions

### `games.atplay.listInvitations`

**Type**: `query`

List the games a player is part of — ones they started and ones they were invited to — newest first.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of games to return. |
| `cursor` | `string` | No | Pagination cursor. |
| `player` | `string` (did) | No | Whose games to list. Defaults to the authenticated caller. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `games` | `array` | Yes |  |
| `cursor` | `string` | No | Cursor for the next page, absent if no more results. |

### `games.atplay.listInvitations#gameSummary`

**Type**: `object`

One game a player is part of, with just enough to list and rejoin it.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `game` | `ref` → `games.atplay.game.release` | No | The release the invitation named. |
| `pending` | `boolean` | Yes | True while nobody has taken a turn. Acceptance is the invitee's first turn, so an unanswered invitation stays pending (ADR 0031). |
| `players` | `array` | No | The players invited, not counting the initiator. |
| `yourMove` | `boolean` | Yes | True when the latest turn names this player as one of the next to act. |
| `initiator` | `string` (did) | No | Who sent the invitation. |
| `turnCount` | `integer` | Yes | How many turns have been published against this invitation. |
| `invitation` | `string` (at-uri) | Yes | The invitation that started this game. |
| `latestTurn` | `string` (at-uri) | No | The most recent turn, absent while the game is still pending. |

## Raw Schema

```json
{
  "id": "games.atplay.listInvitations",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "games"
          ],
          "properties": {
            "games": {
              "type": "array",
              "items": {
                "ref": "#gameSummary",
                "type": "ref"
              }
            },
            "cursor": {
              "type": "string",
              "maxLength": 512,
              "description": "Cursor for the next page, absent if no more results."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "limit": {
            "type": "integer",
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "description": "Maximum number of games to return."
          },
          "cursor": {
            "type": "string",
            "maxLength": 512,
            "description": "Pagination cursor."
          },
          "player": {
            "type": "string",
            "format": "did",
            "description": "Whose games to list. Defaults to the authenticated caller."
          }
        }
      },
      "description": "List the games a player is part of — ones they started and ones they were invited to — newest first."
    },
    "gameSummary": {
      "type": "object",
      "required": [
        "invitation",
        "turnCount",
        "pending",
        "yourMove"
      ],
      "properties": {
        "game": {
          "ref": "games.atplay.game.release",
          "type": "ref",
          "description": "The release the invitation named."
        },
        "pending": {
          "type": "boolean",
          "description": "True while nobody has taken a turn. Acceptance is the invitee's first turn, so an unanswered invitation stays pending (ADR 0031)."
        },
        "players": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "did"
          },
          "description": "The players invited, not counting the initiator."
        },
        "yourMove": {
          "type": "boolean",
          "description": "True when the latest turn names this player as one of the next to act."
        },
        "initiator": {
          "type": "string",
          "format": "did",
          "description": "Who sent the invitation."
        },
        "turnCount": {
          "type": "integer",
          "minimum": 0,
          "description": "How many turns have been published against this invitation."
        },
        "invitation": {
          "type": "string",
          "format": "at-uri",
          "maxLength": 512,
          "description": "The invitation that started this game."
        },
        "latestTurn": {
          "type": "string",
          "format": "at-uri",
          "maxLength": 512,
          "description": "The most recent turn, absent while the game is still pending."
        }
      },
      "description": "One game a player is part of, with just enough to list and rejoin it."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
