> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create testset rows

Add rows to a testset.

## Authentication

* API key: `Authorization: Bearer <API key>`

## Path Parameters

<ParamField path="testset_id" type="string" required>
  The ID of the testset to add rows to.
</ParamField>

## Request Body

<RequestExample>
  ```json Request theme={"system"}
  [
    {
      "row_data": {
        "input": "sdf"
      }
    },
    {
      "row_data": {
        "expected_output": "ccc"
      }
    }
  ]
  ```
</RequestExample>

## Examples

<CodeGroup>
  ```python Python theme={"system"}
  import requests

  testset_id = "testset_id_123"
  url = f"https://api.keywordsai.co/api/testsets/{testset_id}/rows"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  data = [
      {
          "row_data": {
              "input": "sdf"
          }
      },
      {
          "row_data": {
              "expected_output": "ccc"
          }
      }
  ]

  response = requests.post(url, headers=headers, json=data)
  print(response.json())
  ```

  ```bash cURL theme={"system"}
  curl -X POST "https://api.keywordsai.co/api/testsets/{testset_id}/rows" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '[
      {
        "row_data": {
          "input": "sdf"
        }
      }
    ]'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={"system"}
  {
    "created": 2,
    "rows": [
      {
        "row_index": 0,
        "row_data": {
          "input": "sdf"
        }
      }
    ]
  }
  ```
</ResponseExample>
