# Configure the database (persisted in metastore.yaml `config:`): `root` (rename the database

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

Configure the database (persisted in metastore.yaml `config:`): `root` (rename the database
folder; links follow; revert by renaming back), `default_catalog`, `default_schema`,
`default_partition` ("" = flat) and `default_filename` (date formats for new time-based tables),
`archive_folder`, `timezone` (IANA; completes date-times written without offset), `history`
(transaction log for every table: true in a database the engine creates, false when
`config` lacks it, as in a metastore from before 3.0.0; change it only on the user's request), `autolink` (the text a write
puts in a body links the notes it mentions; on by default). Returns describe_database.
Renaming `root` moves the folder (links to its notes are rewritten; the tables' archive and
`exclude` folders inside it follow); the move is listed in the journal as `move_database` (undo
and time travel read older entries with the new paths) and cannot be undone. Settings changes are
not journaled (no `migration_id`, nothing for undo_migration): to revert, call it again with the
previous values.

The metastore changes only through operations: never edit metastore.yaml by hand (no validation).

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

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `root` | `string \| null` | no | `null` |  |
| `default_catalog` | `string \| null` | no | `null` |  |
| `default_schema` | `string \| null` | no | `null` |  |
| `default_partition` | `string \| null` | no | `null` |  |
| `default_filename` | `string \| null` | no | `null` |  |
| `archive_folder` | `string \| null` | no | `null` |  |
| `timezone` | `string \| null` | no | `null` |  |
| `history` | `boolean \| null` | no | `null` |  |
| `autolink` | `boolean \| null` | no | `null` | Automatic links: the text a write puts in a note's body links the notes it mentions by name (on by default). A write's own `autolink` overrides it. |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Done. | `DatabaseDescription` (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) |
| 500 | Unexpected error. | `Error` (application/json) |

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