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

# Create testset rows

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

Create one or more rows in a testset. If `row_index` is omitted, the row is appended to the end of the testset.

## Path parameters

- `testset_id` string, required

## Headers

- `Authorization` string, required

## Request body

- union
  - TestsetsCreateTestsetRowsRequest0
    - `row_index` number, double — Optional target row index. If omitted, the row is appended to the end of the testset.
    - `row_data` ApiTestsetsTestsetIdRowsPostRequestBodyContentApplicationJsonSchemaOneOf0RowData, required — Row payload keyed by testset column field.
  - ApiTestsetsTestsetIdRowsPostRequestBodyContentApplicationJsonSchemaOneOf1Items[] — Batch create rows in a single request.
    - `row_index` number, double — Optional target row index. If omitted, the row is appended to the end of the testset.
    - `row_data` ApiTestsetsTestsetIdRowsPostRequestBodyContentApplicationJsonSchemaOneOf1ItemsRowData, required — Row payload keyed by testset column field.

## Response `201`

Created row or rows.

- union
  - TestsetsCreateTestsetRowsResponse2010
    - `row_index` number, double, required — Row index. Decimal values can be returned after reordering.
    - `testset_id` string, required — Parent testset ID.
    - `row_data` ApiTestsetsTestsetIdRowsPostResponsesContentApplicationJsonSchemaOneOf0RowData, required — Row payload keyed by testset column field.
  - ApiTestsetsTestsetIdRowsPostResponsesContentApplicationJsonSchemaOneOf1Items[]
    - `row_index` number, double, required — Row index. Decimal values can be returned after reordering.
    - `testset_id` string, required — Parent testset ID.
    - `row_data` ApiTestsetsTestsetIdRowsPostResponsesContentApplicationJsonSchemaOneOf1ItemsRowData, required — Row payload keyed by testset column field.

## Other responses

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

---

[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/58a2eabdccf3/schema)
