# cards.openstacks.mtg.deck

> Published by [openstacks.cards](https://lexicon.garden/identity/did:plc:w34fhwhm4pcgw6k6at6cd3qf)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:w34fhwhm4pcgw6k6at6cd3qf/cards.openstacks.mtg.deck)
- [Documentation](https://lexicon.garden/lexicon/did:plc:w34fhwhm4pcgw6k6at6cd3qf/cards.openstacks.mtg.deck/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:w34fhwhm4pcgw6k6at6cd3qf/cards.openstacks.mtg.deck/examples)

## Definitions

### `cards.openstacks.mtg.deck`

**Type**: `record`

A Magic: The Gathering deck

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Deck name |
| `format` | `string` | No | Deck format |
| `createdAt` | `string` (datetime) | Yes | When this deck was created |
| `mainboard` | `array` | No | Main deck cards |
| `sideboard` | `array` | No | Sideboard cards |
| `sourceUrl` | `string` (uri) | No | Original source URL if imported (e.g., Moxfield link) |
| `updatedAt` | `string` (datetime) | No | When this deck was last updated |
| `commanders` | `array` | No | Commander(s) for Commander format |
| `companions` | `array` | No | Companion(s) |
| `maybeboard` | `array` | No | Cards being considered |
| `description` | `string` | No | Deck description / primer |

### `cards.openstacks.mtg.deck#deckEntry`

**Type**: `object`

A card in a deck with quantity

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `card` | `string` (at-uri) | Yes | AT URI reference to a card record |
| `quantity` | `integer` | Yes | Number of copies |

## Raw Schema

```json
{
  "id": "cards.openstacks.mtg.deck",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 256,
            "description": "Deck name"
          },
          "format": {
            "type": "string",
            "description": "Deck format",
            "knownValues": [
              "standard",
              "modern",
              "legacy",
              "vintage",
              "pioneer",
              "commander",
              "pauper",
              "brawl",
              "historic",
              "alchemy",
              "oathbreaker",
              "premodern",
              "casual"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this deck was created"
          },
          "mainboard": {
            "type": "array",
            "items": {
              "ref": "#deckEntry",
              "type": "ref"
            },
            "description": "Main deck cards"
          },
          "sideboard": {
            "type": "array",
            "items": {
              "ref": "#deckEntry",
              "type": "ref"
            },
            "description": "Sideboard cards"
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri",
            "description": "Original source URL if imported (e.g., Moxfield link)"
          },
          "updatedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this deck was last updated"
          },
          "commanders": {
            "type": "array",
            "items": {
              "ref": "#deckEntry",
              "type": "ref"
            },
            "description": "Commander(s) for Commander format"
          },
          "companions": {
            "type": "array",
            "items": {
              "ref": "#deckEntry",
              "type": "ref"
            },
            "description": "Companion(s)"
          },
          "maybeboard": {
            "type": "array",
            "items": {
              "ref": "#deckEntry",
              "type": "ref"
            },
            "description": "Cards being considered"
          },
          "description": {
            "type": "string",
            "maxLength": 5000,
            "description": "Deck description / primer"
          }
        }
      },
      "description": "A Magic: The Gathering deck"
    },
    "deckEntry": {
      "type": "object",
      "required": [
        "card",
        "quantity"
      ],
      "properties": {
        "card": {
          "type": "string",
          "format": "at-uri",
          "description": "AT URI reference to a card record"
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "Number of copies"
        }
      },
      "description": "A card in a deck with quantity"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
