# us.polhem.skywrite.draft

> A Skywrite draft, in the account's us.polhem.skywrite.drafts space: a record that isn't published yet, or changes to one that is. The record key is derived from the collection and id, so every device writes a draft to the same record; read those fields rather than the key.

- Kind: record
- Record key: any
- Authority: skywrite.polhem.us
- Lexicon: 1
- Published by [skywrite.polhem.us](https://lexicon.garden/identity/did:plc:prku2qgbkcu2tkjimf7zqfpz), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:prku2qgbkcu2tkjimf7zqfpz/us.polhem.skywrite.draft)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:prku2qgbkcu2tkjimf7zqfpz/us.polhem.skywrite.draft/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:prku2qgbkcu2tkjimf7zqfpz/us.polhem.skywrite.draft/analytics)

## Record (`us.polhem.skywrite.draft`)

Type: record · key any

### Properties

- `collection` (string · nsid, required): The collection the draft's record is published to.
- `createdAt` (string · datetime, required): When the draft was started.
- `id` (string · record-key, required): Names the draft in its collection: the published record's key for changes to it, or a TID made up for a new record.
- `rkey` (string): For a new record: the record key typed in so far, which may not be a valid key yet.
  - Constraints: maxLength: 512
- `subject` (ref): For changes to a published record: the record, and the version the changes started from. A new record's draft has none.
  - Reference: `com.atproto.repo.strongRef`
- `updatedAt` (string · datetime, required): When the draft was last saved, on any device.
- `value` (unknown, required): The record as drafted. Files it uses are blobs this record references, which keeps them on the PDS.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A Skywrite draft, in the account's us.polhem.skywrite.drafts space: a record that isn't published yet, or changes to one that is. The record key is derived from the collection and id, so every device writes a draft to the same record; read those fields rather than the key.",
      "key": "any",
      "record": {
        "properties": {
          "collection": {
            "description": "The collection the draft's record is published to.",
            "format": "nsid",
            "type": "string"
          },
          "createdAt": {
            "description": "When the draft was started.",
            "format": "datetime",
            "type": "string"
          },
          "id": {
            "description": "Names the draft in its collection: the published record's key for changes to it, or a TID made up for a new record.",
            "format": "record-key",
            "type": "string"
          },
          "rkey": {
            "description": "For a new record: the record key typed in so far, which may not be a valid key yet.",
            "maxLength": 512,
            "type": "string"
          },
          "subject": {
            "description": "For changes to a published record: the record, and the version the changes started from. A new record's draft has none.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "updatedAt": {
            "description": "When the draft was last saved, on any device.",
            "format": "datetime",
            "type": "string"
          },
          "value": {
            "description": "The record as drafted. Files it uses are blobs this record references, which keeps them on the PDS.",
            "type": "unknown"
          }
        },
        "required": [
          "collection",
          "id",
          "value",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "us.polhem.skywrite.draft",
  "lexicon": 1
}
```
