---
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

---

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