# dev.tsunagite.createGame

> Published by [tsunagite.dev](https://lexicon.garden/identity/did:plc:pz4sp2vf5w26wnaee253gfms)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.createGame)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.createGame/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pz4sp2vf5w26wnaee253gfms/dev.tsunagite.createGame/examples)

## Definitions

### `dev.tsunagite.createGame`

**Type**: `procedure`

Create a record for a game that will host leaderboards via Tsunagite. If the game already exists, update its data.

#### Input

**Encoding**: `text/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` (record-key) | Yes | The ID of this game. Should only include [a-zA-Z0-9-]. |
| `game` | `ref` → `dev.tsunagite.game` | Yes |  |

#### Output

**Encoding**: `text/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | No | The URI pointing to the game's newly-created record. |
| `profileKey` | `string` (nsid) | No | The record key that should be used for this game's player profiles. |

## Raw Schema

```json
{
  "id": "dev.tsunagite.createGame",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "id",
            "game"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "record-key",
              "description": "The ID of this game. Should only include [a-zA-Z0-9-]."
            },
            "game": {
              "ref": "dev.tsunagite.game",
              "type": "ref"
            }
          }
        },
        "encoding": "text/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "The URI pointing to the game's newly-created record."
            },
            "profileKey": {
              "type": "string",
              "format": "nsid",
              "description": "The record key that should be used for this game's player profiles."
            }
          }
        },
        "encoding": "text/json"
      },
      "description": "Create a record for a game that will host leaderboards via Tsunagite. If the game already exists, update its data."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
