---
title: "Create a row"
method: POST
path: "/api/workspaces/{slug}/rows"
tags: ["Rows"]
---

# Create a row

`POST /api/workspaces/{slug}/rows`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/rows`
- Auth: HTTP bearer

Add a new row to a table surface. `data` keys must match column ids on the surface; values are coerced to the column type. Multi-surface workspaces accept `surface` (slug) or `surfaceId` to pick which sheet the row lands on; omit both to fall through to the workspace's primary table surface.

## Path parameters

- `slug` string, required

## Request body

- object
  - `data` object, required
  - `position` integer
  - `auto_create_columns` boolean
  - `surfaceId` string
  - `surface` string
  - `surface_slug` string

## Response `200`

Created.

- object
  - `row` object, required
    - `id` string, required
    - `surfaceId` string, required
    - `position` integer, required
    - `data` object, required: Cell values keyed by column id. Types match the column schema.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `createdBy` string, required: Principal id (user OR agent).
    - `updatedBy` string, required

## Other responses

- `400`: Invalid body.
- `402`: Row cap reached for the current plan.
- `403`: Forbidden.

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
