# org.dotpostcard.postcard

> A postcard. The record key is a TID whose timestamp is the date the postcard was sent (or the date it was uploaded, if that's unknown; 1970-01-01 if it was sent before then), with its remaining bits taken from the image's own hash.

- Kind: record
- Record key: tid
- Authority: dotpostcard.org
- Lexicon: 1
- Published by [dotpostcard.org](https://lexicon.garden/identity/did:web:dotpostcard.org), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:web:dotpostcard.org/org.dotpostcard.postcard)
- [Schema JSON](https://lexicon.garden/lexicon/did:web:dotpostcard.org/org.dotpostcard.postcard/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:web:dotpostcard.org/org.dotpostcard.postcard/analytics)

## Record (`org.dotpostcard.postcard`)

Type: record · key tid

### Properties

- `context` (ref)
  - Reference: `#context`
- `flip` (string, required): The axis the physical postcard flips about, to keep both sides upright.
  - Constraints: maxLength: 100, knownValues: org.dotpostcard.postcard#flipBook | org.dotpostcard.postcard#flipLeftHand | org.dotpostcard.postcard#flipCalendar | org.dotpostcard.postcard#flipRightHand | org.dotpostcard.postcard#flipNone
- `image` (blob, required): A 'web' format postcard image: the front of the postcard above the back (rotated so the specified flip works), with the postcard's XMP metadata embedded.
  - Constraints: accept: image/*
- `locale` (string · language): The language the descriptions and transcriptions are written in, unless annotated otherwise.
- `location` (ref)
  - Reference: `#location`
- `physical` (ref, required)
  - Reference: `#physical`
- `recipient` (ref)
  - Reference: `#person`
- `sender` (ref)
  - Reference: `#person`
- `sentOn` (ref): The date the postcard was sent.
  - Reference: `#date`
- `sides` (array, required): The sides of the postcard, front first. One-sided postcards (flipNone) have a single side.
  - Constraints: minLength: 1, maxLength: 2
  - `items` (ref)
    - Reference: `#side`
- `title` (string): The postcard's human-readable title.
  - Constraints: maxLength: 3000, maxGraphemes: 300

## #annotatedText (`org.dotpostcard.postcard#annotatedText`)

Type: object

### Properties

- `annotations` (array)
  - `items` (ref)
    - Reference: `#annotation`
- `text` (string, required)
  - Constraints: maxLength: 20000

## #annotation (`org.dotpostcard.postcard#annotation`)

Type: object

Marks up a range of the text. Offsets are zero-indexed counts of UTF-8 bytes; the start is inclusive and the end exclusive.

### Properties

- `byteEnd` (integer, required)
  - Constraints: minimum: 0
- `byteStart` (integer, required)
  - Constraints: minimum: 0
- `type` (string, required)
  - Constraints: maxLength: 100, knownValues: em | strong | underline | locale
- `value` (string): For 'locale' annotations, the language tag of the annotated range.
  - Constraints: maxLength: 100

## #context (`org.dotpostcard.postcard#context`)

Type: object

Where this postcard came from, and who is describing it.

### Properties

- `author` (ref)
  - Reference: `#person`
- `description` (string)
  - Constraints: maxLength: 20000

## #date (`org.dotpostcard.postcard#date`)

Type: object

A calendar date, with no time of day or timezone.

### Properties

- `day` (integer, required)
  - Constraints: minimum: 1, maximum: 31
- `month` (integer, required)
  - Constraints: minimum: 1, maximum: 12
- `year` (integer, required)
  - Constraints: minimum: 1

## #flipBook (`org.dotpostcard.postcard#flipBook`)

Type: token

Flips about a vertical axis, like a book.

## #flipCalendar (`org.dotpostcard.postcard#flipCalendar`)

Type: token

Flips about a horizontal axis, like a calendar.

## #flipLeftHand (`org.dotpostcard.postcard#flipLeftHand`)

Type: token

Flips about the up-right diagonal axis, as if flipped with your left hand. The sides have different orientations.

## #flipNone (`org.dotpostcard.postcard#flipNone`)

Type: token

The postcard has only one side.

## #flipRightHand (`org.dotpostcard.postcard#flipRightHand`)

Type: token

Flips about the down-right diagonal axis, as if flipped with your right hand. The sides have different orientations.

## #location (`org.dotpostcard.postcard#location`)

Type: object

### Properties

- `countryCode` (string): ISO 3166-1 alpha-3 country code.
  - Constraints: minLength: 3, maxLength: 3
- `latitude` (string): Decimal degrees, as a string (atproto has no floating point numbers).
  - Constraints: maxLength: 32
- `longitude` (string): Decimal degrees, as a string (atproto has no floating point numbers).
  - Constraints: maxLength: 32
- `name` (string)
  - Constraints: maxLength: 1000

## #person (`org.dotpostcard.postcard#person`)

Type: object

### Properties

- `name` (string)
  - Constraints: maxLength: 1000
- `uri` (string · uri)

## #physical (`org.dotpostcard.postcard#physical`)

Type: object

The physical attributes of the postcard.

### Properties

- `cardColor` (ref): The colour of the card the postcard is made from.
  - Reference: `#rgbColor`
- `frontSize` (ref, required)
  - Reference: `#size`
- `thicknessUm` (integer): The thickness of the postcard, in micrometres.
  - Constraints: minimum: 1

## #point (`org.dotpostcard.postcard#point`)

Type: object

A point on one side of the postcard, in ten-thousandths of that side's width (x, from the left) and height (y, from the top).

### Properties

- `x` (integer, required)
  - Constraints: minimum: 0, maximum: 10000
- `y` (integer, required)
  - Constraints: minimum: 0, maximum: 10000

## #rgbColor (`org.dotpostcard.postcard#rgbColor`)

Type: object

### Properties

- `b` (integer, required)
  - Constraints: minimum: 0, maximum: 255
- `g` (integer, required)
  - Constraints: minimum: 0, maximum: 255
- `r` (integer, required)
  - Constraints: minimum: 0, maximum: 255

## #secret (`org.dotpostcard.postcard#secret`)

Type: object

### Properties

- `points` (array, required): The vertices of the polygon bounding the region.
  - Constraints: minLength: 3
  - `items` (ref)
    - Reference: `#point`
- `prehidden` (boolean): False if this region still shows its private information in the image; regions are assumed to be already obscured.
  - Constraints: default: true

## #side (`org.dotpostcard.postcard#side`)

Type: object

### Properties

- `description` (string): A description of what this side depicts, suitable for use as alt text.
  - Constraints: maxLength: 20000
- `secrets` (array): Regions of this side which hold private information, and should be obscured.
  - `items` (ref)
    - Reference: `#secret`
- `transcription` (ref)
  - Reference: `#annotatedText`

## #size (`org.dotpostcard.postcard#size`)

Type: object

The dimensions of the front of the postcard.

### Properties

- `heightMm` (integer)
  - Constraints: minimum: 1
- `heightPx` (integer, required)
  - Constraints: minimum: 1
- `widthMm` (integer)
  - Constraints: minimum: 1
- `widthPx` (integer, required)
  - Constraints: minimum: 1

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "annotatedText": {
      "properties": {
        "annotations": {
          "items": {
            "ref": "#annotation",
            "type": "ref"
          },
          "type": "array"
        },
        "text": {
          "maxLength": 20000,
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    },
    "annotation": {
      "description": "Marks up a range of the text. Offsets are zero-indexed counts of UTF-8 bytes; the start is inclusive and the end exclusive.",
      "properties": {
        "byteEnd": {
          "minimum": 0,
          "type": "integer"
        },
        "byteStart": {
          "minimum": 0,
          "type": "integer"
        },
        "type": {
          "knownValues": [
            "em",
            "strong",
            "underline",
            "locale"
          ],
          "maxLength": 100,
          "type": "string"
        },
        "value": {
          "description": "For 'locale' annotations, the language tag of the annotated range.",
          "maxLength": 100,
          "type": "string"
        }
      },
      "required": [
        "type",
        "byteStart",
        "byteEnd"
      ],
      "type": "object"
    },
    "context": {
      "description": "Where this postcard came from, and who is describing it.",
      "properties": {
        "author": {
          "ref": "#person",
          "type": "ref"
        },
        "description": {
          "maxLength": 20000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "date": {
      "description": "A calendar date, with no time of day or timezone.",
      "properties": {
        "day": {
          "maximum": 31,
          "minimum": 1,
          "type": "integer"
        },
        "month": {
          "maximum": 12,
          "minimum": 1,
          "type": "integer"
        },
        "year": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "year",
        "month",
        "day"
      ],
      "type": "object"
    },
    "flipBook": {
      "description": "Flips about a vertical axis, like a book.",
      "type": "token"
    },
    "flipCalendar": {
      "description": "Flips about a horizontal axis, like a calendar.",
      "type": "token"
    },
    "flipLeftHand": {
      "description": "Flips about the up-right diagonal axis, as if flipped with your left hand. The sides have different orientations.",
      "type": "token"
    },
    "flipNone": {
      "description": "The postcard has only one side.",
      "type": "token"
    },
    "flipRightHand": {
      "description": "Flips about the down-right diagonal axis, as if flipped with your right hand. The sides have different orientations.",
      "type": "token"
    },
    "location": {
      "properties": {
        "countryCode": {
          "description": "ISO 3166-1 alpha-3 country code.",
          "maxLength": 3,
          "minLength": 3,
          "type": "string"
        },
        "latitude": {
          "description": "Decimal degrees, as a string (atproto has no floating point numbers).",
          "maxLength": 32,
          "type": "string"
        },
        "longitude": {
          "description": "Decimal degrees, as a string (atproto has no floating point numbers).",
          "maxLength": 32,
          "type": "string"
        },
        "name": {
          "maxLength": 1000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "A postcard. The record key is a TID whose timestamp is the date the postcard was sent (or the date it was uploaded, if that's unknown; 1970-01-01 if it was sent before then), with its remaining bits taken from the image's own hash.",
      "key": "tid",
      "record": {
        "properties": {
          "context": {
            "ref": "#context",
            "type": "ref"
          },
          "flip": {
            "description": "The axis the physical postcard flips about, to keep both sides upright.",
            "knownValues": [
              "org.dotpostcard.postcard#flipBook",
              "org.dotpostcard.postcard#flipLeftHand",
              "org.dotpostcard.postcard#flipCalendar",
              "org.dotpostcard.postcard#flipRightHand",
              "org.dotpostcard.postcard#flipNone"
            ],
            "maxLength": 100,
            "type": "string"
          },
          "image": {
            "accept": [
              "image/*"
            ],
            "description": "A 'web' format postcard image: the front of the postcard above the back (rotated so the specified flip works), with the postcard's XMP metadata embedded.",
            "type": "blob"
          },
          "locale": {
            "description": "The language the descriptions and transcriptions are written in, unless annotated otherwise.",
            "format": "language",
            "type": "string"
          },
          "location": {
            "ref": "#location",
            "type": "ref"
          },
          "physical": {
            "ref": "#physical",
            "type": "ref"
          },
          "recipient": {
            "ref": "#person",
            "type": "ref"
          },
          "sender": {
            "ref": "#person",
            "type": "ref"
          },
          "sentOn": {
            "description": "The date the postcard was sent.",
            "ref": "#date",
            "type": "ref"
          },
          "sides": {
            "description": "The sides of the postcard, front first. One-sided postcards (flipNone) have a single side.",
            "items": {
              "ref": "#side",
              "type": "ref"
            },
            "maxLength": 2,
            "minLength": 1,
            "type": "array"
          },
          "title": {
            "description": "The postcard's human-readable title.",
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          }
        },
        "required": [
          "image",
          "flip",
          "sides",
          "physical"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "person": {
      "properties": {
        "name": {
          "maxLength": 1000,
          "type": "string"
        },
        "uri": {
          "format": "uri",
          "type": "string"
        }
      },
      "type": "object"
    },
    "physical": {
      "description": "The physical attributes of the postcard.",
      "properties": {
        "cardColor": {
          "description": "The colour of the card the postcard is made from.",
          "ref": "#rgbColor",
          "type": "ref"
        },
        "frontSize": {
          "ref": "#size",
          "type": "ref"
        },
        "thicknessUm": {
          "description": "The thickness of the postcard, in micrometres.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "frontSize"
      ],
      "type": "object"
    },
    "point": {
      "description": "A point on one side of the postcard, in ten-thousandths of that side's width (x, from the left) and height (y, from the top).",
      "properties": {
        "x": {
          "maximum": 10000,
          "minimum": 0,
          "type": "integer"
        },
        "y": {
          "maximum": 10000,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "x",
        "y"
      ],
      "type": "object"
    },
    "rgbColor": {
      "properties": {
        "b": {
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "g": {
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "r": {
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "r",
        "g",
        "b"
      ],
      "type": "object"
    },
    "secret": {
      "properties": {
        "points": {
          "description": "The vertices of the polygon bounding the region.",
          "items": {
            "ref": "#point",
            "type": "ref"
          },
          "minLength": 3,
          "type": "array"
        },
        "prehidden": {
          "default": true,
          "description": "False if this region still shows its private information in the image; regions are assumed to be already obscured.",
          "type": "boolean"
        }
      },
      "required": [
        "points"
      ],
      "type": "object"
    },
    "side": {
      "properties": {
        "description": {
          "description": "A description of what this side depicts, suitable for use as alt text.",
          "maxLength": 20000,
          "type": "string"
        },
        "secrets": {
          "description": "Regions of this side which hold private information, and should be obscured.",
          "items": {
            "ref": "#secret",
            "type": "ref"
          },
          "type": "array"
        },
        "transcription": {
          "ref": "#annotatedText",
          "type": "ref"
        }
      },
      "type": "object"
    },
    "size": {
      "description": "The dimensions of the front of the postcard.",
      "properties": {
        "heightMm": {
          "minimum": 1,
          "type": "integer"
        },
        "heightPx": {
          "minimum": 1,
          "type": "integer"
        },
        "widthMm": {
          "minimum": 1,
          "type": "integer"
        },
        "widthPx": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "widthPx",
        "heightPx"
      ],
      "type": "object"
    }
  },
  "description": "A digitised physical postcard: an image of its side(s), and the metadata describing it.",
  "id": "org.dotpostcard.postcard",
  "lexicon": 1
}
```
