> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nohead.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Drafts

> Changes to a record that wait until they are merged into it, now or later.

Every command also takes the [global options](https://docs.nohead.io/cli/commands/global-options.md), such as `--json`.

## `nohead drafts list`

List a collection's drafts, most recently changed first.

```bash theme={null}
nohead drafts list [options] <collection>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |

| Option | |
| - | - |
| `--record <id>` | This record's draft instead, whatever its collection. |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every draft. |

## `nohead drafts get`

Show a draft, with the record's values as they read after the merge.

```bash theme={null}
nohead drafts get [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |

| Option | |
| - | - |
| `--expand <fields>` | Relation fields whose records to embed (comma-separated) |

## `nohead drafts create`

Start a record's draft from its values (the given fields over them), or from an earlier revision.

```bash theme={null}
nohead drafts create [options] <record>
```

| Argument | |
| - | - |
| `<record>` | Record ID. |

| Option | |
| - | - |
| `--from-revision <n>` | Start from this revision's values instead of the record's. |
| `--set <key=value>` | Set a field (key=text or key:=json); repeatable. |
| `--data <json>` | Record data as a JSON object. |
| `--data-file <path>` | Read record data from a JSON file (- for stdin) |

## `nohead drafts update`

Change a draft; only the given fields change (null clears one)

```bash theme={null}
nohead drafts update [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |

| Option | |
| - | - |
| `--if-revision <n>` | Fail with 412 unless the draft is still at this revision. |
| `--set <key=value>` | Set a field (key=text or key:=json); repeatable. |
| `--data <json>` | Record data as a JSON object. |
| `--data-file <path>` | Read record data from a JSON file (- for stdin) |

## `nohead drafts merge`

Apply a draft to its record now, as one revision (the record stays live or not)

```bash theme={null}
nohead drafts merge [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |

| Option | |
| - | - |
| `--if-revision <n>` | Fail with 412 unless the draft is still at this revision. |

## `nohead drafts discard`

Delete a draft for good (the record is unchanged)

```bash theme={null}
nohead drafts discard [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |

| Option | |
| - | - |
| `--if-revision <n>` | Fail with 412 unless the draft is still at this revision. |
| `--yes` | confirm: a discarded draft cannot be restored. |

## `nohead drafts schedule`

Merge a draft later (within a minute of the time)

```bash theme={null}
nohead drafts schedule [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |

| Option | |
| - | - |
| `--merge-at <time>` | ISO 8601 time, or +2h / +3d. |

## `nohead drafts unschedule`

Cancel a draft's scheduled merge.

```bash theme={null}
nohead drafts unschedule [options] <draft>
```

| Argument | |
| - | - |
| `<draft>` | Draft ID (drf\_...) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.