# Create a database row

`POST /v1/databases/{databaseId}/rows`

Creates a row (a document under the database). Values implied by the view's filter and by the group (group/subGroup keys) are filled in, as in Notion; values override them. With templateId, the template's properties and body are copied first. uniqueId properties get the next number unless values gives one (12 or "LYD-12").

Scope: `docs:write`. Undoable.

## Request

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

## Path parameters

- `databaseId` (ULID, required)

## Body

- `id` (ULID, optional)
- `title` (string, optional): Default: `"Untitled"`. (1–255 chars)
- `values` (object, optional): Default: `{}`.
- `viewId` (ULID, optional)
- `group` (string, optional, nullable)
- `subGroup` (string, optional, nullable)
- `templateId` (ULID, optional)
- `afterId` (ULID, optional)
- `beforeId` (ULID, optional)

## Response

- `id` (ULID, required)
- `workspaceId` (string, required): (1–64 chars)
- `parentId` (ULID, required, nullable)
- `title` (string, required): (1–255 chars)
- `sortKey` (string, required): (1–256 chars)
- `properties` (object, required)
- `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",
  "parentId": null,
  "title": "Meeting notes",
  "sortKey": "a0",
  "properties": {
    "status": "draft"
  },
  "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.
