> ## 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.

# Records

> Manage records and their history.

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

## `nohead records list`

List records (newest first by default)

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

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

| Option | |
| - | - |
| `--status <status>` | Only records with this status. One of `published`, `unpublished`. |
| `--filter <expression>` | Filter, e.g. price\<50, released>=today, "category in shoes,bags", "cover exists", "published\_at exists"; repeatable. |
| `--deleted` | List deleted records instead. |
| `--sort <sort>` | created\_at, updated\_at, published\_at, id or a field; prefix - for descending. |
| `--expand <fields>` | Relation fields whose records to embed (comma-separated) |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every record. |

## `nohead records bulk`

Publish, unpublish, delete, restore or update many records; each gets its own revision.

```bash theme={null}
nohead records bulk [options] <action> <collection> [ids...]
```

| Argument | |
| - | - |
| `<action>` | What to do to the records. One of `publish`, `unpublish`, `delete`, `restore`, `update`. |
| `<collection>` | Collection slug or ID. |
| `[ids...]` | Record IDs (or select with --status/--filter/--every) |

| Option | |
| - | - |
| `--status <status>` | Select records with this status. One of `published`, `unpublished`. |
| `--filter <expression>` | Select records by filter, as in records list; repeatable. |
| `--deleted` | Select deleted records (for restore) |
| `--every` | Select every record in the collection. |
| `--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 records get`

Show a record.

```bash theme={null}
nohead records get [options] <id>
```

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

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

## `nohead records create`

Create an unpublished record.

```bash theme={null}
nohead records create [options] <collection>
```

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

| Option | |
| - | - |
| `--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 records update`

Update a record; only the given fields change (null clears one)

```bash theme={null}
nohead records update [options] <id>
```

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

| Option | |
| - | - |
| `--if-revision <n>` | Fail with 412 unless the record 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 records publish`

Publish a record.

```bash theme={null}
nohead records publish [options] <id>
```

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

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

## `nohead records unpublish`

Unpublish a record.

```bash theme={null}
nohead records unpublish [options] <id>
```

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

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

## `nohead records schedule`

Publish or unpublish a record later (the change happens within a minute of the time)

```bash theme={null}
nohead records schedule [options] <id>
```

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

| Option | |
| - | - |
| `--publish-at <time>` | ISO 8601 time, +2h / +3d, or none; left out, it stays as it is. |
| `--unpublish-at <time>` | ISO 8601 time, +2h / +3d, or none; left out, it stays as it is. |

## `nohead records unschedule`

Cancel a record's scheduled publish and unpublish.

```bash theme={null}
nohead records unschedule [options] <id>
```

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

## `nohead records scheduled`

List a collection's scheduled publishes, unpublishes and draft merges, soonest first.

```bash theme={null}
nohead records scheduled [options] <collection>
```

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

| Option | |
| - | - |
| `--sort <sort>` | at: soonest first (the default); -at: latest first. One of `at`, `-at`. |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every change. |

## `nohead records delete`

Delete a record (values and history are kept)

```bash theme={null}
nohead records delete [options] <id>
```

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

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

## `nohead records restore`

Restore a deleted record.

```bash theme={null}
nohead records restore [options] <id>
```

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

## `nohead records history`

Show a record's revisions, newest first.

```bash theme={null}
nohead records history [options] <id>
```

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

| Option | |
| - | - |
| `--operation <op>` | Only this operation (update, publish, ...) |
| `--actor <id>` | Only changes by this user (usr\_...) or API key (key\_...) |
| `--since <time>` | Only changes at or after this ISO 8601 time. |
| `--until <time>` | Only changes before this ISO 8601 time. |
| `--limit <n>` | Page size (1-100, default 100) |
| `--cursor <cursor>` | Continue from a previous page's next\_cursor. |
| `--all` | Follow cursors and return every revision. |

## `nohead records revision`

Show one revision: the record as it was, and what changed.

```bash theme={null}
nohead records revision [options] <id> <revision>
```

| Argument | |
| - | - |
| `<id>` | Record ID. |
| `<revision>` | Revision number. |

## `nohead records diff`

Compare two revisions.

```bash theme={null}
nohead records diff [options] <id>
```

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

| Option | |
| - | - |
| `--from <revision>` | Older revision. |
| `--to <revision>` | Newer revision. |

## `nohead records revert`

Revert a record to an earlier revision (writes a new revision)

```bash theme={null}
nohead records revert [options] <id> <revision>
```

| Argument | |
| - | - |
| `<id>` | Record ID. |
| `<revision>` | Revision to revert to. |

| Option | |
| - | - |
| `--dry-run` | Show what would change without writing. |
| `--if-revision <n>` | Fail with 412 unless the record is still at this revision. |

## `nohead records export`

Export records as JSON Lines (one API record per line)

```bash theme={null}
nohead records export [options] <collection>
```

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

| Option | |
| - | - |
| `--output <path>` | Write to a file instead of stdout. |
| `--status <status>` | Only records with this status. One of `published`, `unpublished`. |
| `--deleted` | Export deleted records instead. |

## `nohead records import`

Create records from JSON Lines (API records or plain data objects); - reads stdin.

```bash theme={null}
nohead records import [options] <collection> <file>
```

| Argument | |
| - | - |
| `<collection>` | Collection slug or ID. |
| `<file>` | JSON Lines file, or - for stdin. |

| Option | |
| - | - |
| `--publish` | Publish records whose line is an exported record with published\_at. |


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