---
title: "Insert Rows"
method: POST
path: "/api/v1/tables/{tableId}/rows"
tags: ["Tables"]
---

# Insert Rows

`POST /api/v1/tables/{tableId}/rows`

Insert one or more rows into a table. For a single row, pass a `data` object. For batch insert, pass a `rows` array (up to 1000 rows).

## Path parameters

- `tableId` string, required

## Request body

- union
  - object — Single row insert.
    - `workspaceId` string, required — The workspace that owns the table.
    - `data` object, required — Key-value pairs matching the table schema.
    - `position` integer — Position index for the row. If omitted, the row is appended at the end of the table.
  - object — Batch insert (up to 1000 rows).
    - `workspaceId` string, required — The workspace that owns the table.
    - `rows` object[], required — Array of row objects to insert. Each object contains key-value pairs matching the table schema.
    - `positions` integer[] — Array of position indices for each row. Must be the same length as the rows array and must not contain duplicates. If omitted, rows are appended in order.

## Response `200`

Row(s) inserted successfully.

- object
  - `success` boolean — Indicates whether the request was successful.
  - `data` object — Response payload.
    - `row` TableRow — A single row in a table.
      - `id` string — Unique row identifier.
      - `data` object — Row data as key-value pairs matching the table schema.
      - `position` integer — Row's position/order in the table.
      - `createdAt` string, date-time — ISO 8601 timestamp when the row was created.
      - `updatedAt` string, date-time — ISO 8601 timestamp when the row was last modified.
    - `rows` TableRow[] — Array of inserted rows (present for batch inserts).
      - `id` string — Unique row identifier.
      - `data` object — Row data as key-value pairs matching the table schema.
      - `position` integer — Row's position/order in the table.
      - `createdAt` string, date-time — ISO 8601 timestamp when the row was created.
      - `updatedAt` string, date-time — ISO 8601 timestamp when the row was last modified.
    - `insertedCount` integer — Number of rows successfully inserted.
    - `message` string — Confirmation message.

## Other responses

- `400` — Invalid request parameters. Check the details array for specific validation errors.
- `401` — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.
- `403` — Access denied. You do not have permission to access this resource. For audit log endpoints, this requires an Enterprise subscription and organization admin/owner role.
- `404` — The requested resource was not found. Verify the ID is correct and belongs to your workspace.
- `429` — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying. The X-RateLimit-* headers accompany every response from an authenticated v1 request — success and error alike — and are omitted only when the request fails authentication, since no rate-limit bucket is consulted in that case.

---

[API](https://skmtc.net/simstudioai/apis/sim-api.md) · [All operations](https://skmtc.net/simstudioai/apis/sim-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/simstudioai/sim-api/versions/66a471c5b1df/schema)
