# Update a database property

`PATCH /v1/database-properties/{id}`

Replaces the property's configuration and/or its key. A new key moves every row's value to it (one undo step).

Scope: `docs:write`. Undoable.

## Request

```bash
curl -X PATCH "https://api.lydie.co/v1/database-properties/01JCQ3V5MZ8G4ZK2X7T9R6N1PB" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Path parameters

- `id` (ULID, required)

## Body

- `key` (string, optional): (1–128 chars)
- `config` (PropertyConfigSpecInput, optional)
  - `options` (object[], optional): select, multiSelect, status
    - `id` (ULID, optional)
    - `name` (string, required): (1–200 chars)
    - `color` (string, optional): One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`. Default: `"default"`.
    - `group` (string, optional): One of: `todo`, `inProgress`, `complete`.
  - `numberFormat` (string, optional): One of: `number`, `integer`, `commas`, `percent`, `currency`.
  - `decimals` (integer, optional): (0–10)
  - `currency` (string, optional): ISO 4217 code, with numberFormat currency (3–3 chars)
  - `includeTime` (boolean, optional): date: values carry a time
  - `range` (boolean, optional): date: values may carry an end (start/end)
  - `relation` (RelationConfigInput, optional)
    - `databaseId` (ULID, required): The database whose rows this relation points at.
    - `twoWay` (boolean, optional): Default: `false`.
    - `reversePropertyId` (ULID, optional, nullable): The synced property on the other database (two-way relations). Default: `null`.
    - `limit` (string, optional): One of: `one`, `many`. Default: `"many"`.
  - `rollup` (RollupConfigInput, optional)
    - `relationPropertyId` (ULID, required)
    - `targetPropertyId` (ULID, required): A property of the related database.
    - `function` (string, required): One of: `showOriginal`, `showUnique`, `count`, `countValues`, `countUnique`, `countEmpty`, `countNotEmpty`, `percentEmpty`, `percentNotEmpty`, `sum`, `average`, `median`, `min`, `max`, `range`, `earliest`, `latest`, `checked`, `unchecked`, `percentChecked`, `percentUnchecked`.
  - `expression` (string, optional): formula: an Obsidian Bases expression
  - `prefix` (string, optional): uniqueId: shown before the number ("LYD" → LYD-12) (≤ 16 chars)
  - `extra` (object, optional)

## Response

- `id` (ULID, required)
- `workspaceId` (string, required): (1–64 chars)
- `databaseId` (ULID, required)
- `name` (string, required): Display name (Bases displayName). (1–200 chars)
- `type` (string, required): One of: `title`, `text`, `number`, `select`, `multiSelect`, `status`, `date`, `checkbox`, `url`, `email`, `phone`, `person`, `files`, `relation`, `rollup`, `formula`, `uniqueId`, `createdTime`, `updatedTime`, `createdBy`, `updatedBy`.
- `key` (string, required): Stored types: the frontmatter key holding the value. Formulas, rollups, createdBy and updatedBy: the formula name in the .base file. Unused for title and created/updated time. (1–128 chars)
- `config` (PropertyConfig, required)
  - `options` (SelectOption[], optional): select, multiSelect, status
    - `id` (ULID, required)
    - `name` (string, required): (1–200 chars)
    - `color` (string, required): One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`. Default: `"default"`.
    - `group` (string, optional): One of: `todo`, `inProgress`, `complete`.
  - `numberFormat` (string, optional): One of: `number`, `integer`, `commas`, `percent`, `currency`.
  - `decimals` (integer, optional): (0–10)
  - `currency` (string, optional): ISO 4217 code, with numberFormat currency (3–3 chars)
  - `includeTime` (boolean, optional): date: values carry a time
  - `range` (boolean, optional): date: values may carry an end (start/end)
  - `relation` (RelationConfig, optional)
    - `databaseId` (ULID, required): The database whose rows this relation points at.
    - `twoWay` (boolean, required): Default: `false`.
    - `reversePropertyId` (ULID, required, nullable): The synced property on the other database (two-way relations). Default: `null`.
    - `limit` (string, required): One of: `one`, `many`. Default: `"many"`.
  - `rollup` (RollupConfig, optional)
    - `relationPropertyId` (ULID, required)
    - `targetPropertyId` (ULID, required): A property of the related database.
    - `function` (string, required): One of: `showOriginal`, `showUnique`, `count`, `countValues`, `countUnique`, `countEmpty`, `countNotEmpty`, `percentEmpty`, `percentNotEmpty`, `sum`, `average`, `median`, `min`, `max`, `range`, `earliest`, `latest`, `checked`, `unchecked`, `percentChecked`, `percentUnchecked`.
  - `expression` (string, optional): formula: an Obsidian Bases expression
  - `prefix` (string, optional): uniqueId: shown before the number ("LYD" → LYD-12) (≤ 16 chars)
  - `extra` (object, optional)
- `sortKey` (string, required): (1–256 chars)
- `createdAt` (timestamp, required)
- `updatedAt` (timestamp, required)
- `deletedAt` (timestamp, required, nullable)
- `createdBy` (string, optional, nullable): (≥ 1 chars)
- `updatedBy` (string, optional, nullable): (≥ 1 chars)

```json
{
  "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
  "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
  "databaseId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
  "name": "Notes",
  "type": "title",
  "key": "string",
  "config": {
    "options": [
      {
        "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
        "name": "Notes",
        "color": "default",
        "group": "todo"
      }
    ],
    "numberFormat": "number",
    "decimals": 0,
    "currency": "string",
    "includeTime": false,
    "range": false,
    "relation": {
      "databaseId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "twoWay": false,
      "reversePropertyId": null,
      "limit": "one"
    },
    "rollup": {
      "relationPropertyId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "targetPropertyId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "function": "showOriginal"
    },
    "expression": "string",
    "prefix": "string",
    "extra": {}
  },
  "sortKey": "a0",
  "createdAt": "2026-11-12T09:30:00.000Z",
  "updatedAt": "2026-11-12T09:30:00.000Z",
  "deletedAt": null,
  "createdBy": null,
  "updatedBy": null
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
