---
title: "Create testset rows"
method: POST
path: "/api/testsets/{testset_id}/rows/"
tags: ["testsets"]
---

# Create testset rows

`POST /api/testsets/{testset_id}/rows/`

Create or upsert one or more rows in a testset. Send the rows in the required `testset_rows` envelope.

## Path parameters

- `testset_id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `testset_rows` ApiTestsetsTestsetIdRowsPostRequestBodyContentApplicationJsonSchemaTestsetRowsItems[], required
    - `row_index` number, double — Optional target row index. If omitted, the row is appended.
    - `row_data` object, required — Row payload keyed by testset column field.

## Response `200`

Rows created or upserted.

- ApiTestsetsTestsetIdRowsPostResponsesContentApplicationJsonSchemaItems[]
  - `row_index` number, double, required — Row index; decimal values can appear after reordering.
  - `testset_id` string, required — Parent testset ID.
  - `row_data` object, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Missing/invalid authentication
- `404` — Not Found

## Changes

- **2026-08-13** `4e064cf81dae` — 2 breaking, 3 warning, 4 info
  - added the new required request property `testset_rows`
  - removed the success response with the status `201`
  - removed the request property `row_data`
  - removed the request property `row_index`
  - …5 more
- **2026-07-31** `c26d550029f8` — 4 breaking, 11 info
  - added the new required request property `testset_sheet`
  - removed `#/components/schemas/TestsetsCreateTestsetRowsRequest0, #/components/schemas/TestsetsCreateTestsetRowsRequest1` from the request body `oneOf` list
  - the request's body type/format changed from ``/`` to `object`/``
  - the response's body type/format changed from ``/`` to `object`/`` for status `201`
  - …11 more

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/testsets/:testset_id/rows/post.md)

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/c61efaf24756/schema)
