# Take rows out of their packs as notes of their own, at their paths, with the text and the modification

`POST /datanotes/operations/unpack_rows/` (operation `unpack_rows`)

Take rows out of their packs as notes of their own, at their paths, with the text and the modification
time they had (the opposite of pack_rows): every pack of the table, the pack of `key`, or only the
rows `where` matches (as select_rows filters). A pack left without rows goes. Links `[[pack#row]]`
from other notes become links to the notes. Needed before alter_table changes the table's `pack`,
`partition`, `filename` or name. Silent for the rows, journaled (undo_migration packs them again).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Datanotes-Actor` | header | `string` | no | JSON: on whose behalf the write is made, recorded in the journal (`harness`, `model`, `session`). |

## Request body

`application/json`, required

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `table` | `string` | yes |  |  |
| `key` | `string \| null` | no | `null` | Only the pack of this key (e.g. "2026-10"). |
| `where` | `object \| null` | no | `null` | Only the rows that match, as select_rows' where. |
| `dry_run` | `boolean` | no | `false` |  |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Done. | `PackRowsResult` (application/json) |
| 400 | Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type. | `Error` (application/json) |
| 401 | Missing or wrong bearer token. | `Error` (application/json) |
| 403 | A named token beyond its permissions (the engine's administration, tables outside its `write` patterns, schema changes without `ddl`). | `Error` (application/json) |
| 404 | Unknown table, view, migration, note or folder. | `Error` (application/json) |
| 409 | Ambiguous table name: it matches several tables (`paths` or `tables` lists them). | `AmbiguousName` (application/json) |
| 500 | Unexpected error. | `Error` (application/json) |

The schemas named here are in [openapi.json](https://datanotes.dev/openapi.json) (`components.schemas`).
