Skip to main content
PATCH
/
api
/
testsets
/
{testset_id}
/
rows
/
{row_index}
{
  "row_data": {
    "name": "Alice",
    "variable1": "",
    "first_name": "raymond",
    "object_var": { "some_key": "some_var" },
    "variable_1": "the_row_with_object"
  }
}
{
  "row_index": 0,
  "row_data": {
    "name": "Alice",
    "first_name": "raymond"
  }
}
Update a specific row in a testset.

Authentication

  • API key: Authorization: Bearer <API key>

Path Parameters

testset_id
string
required
The ID of the testset.
row_index
integer
required
The index of the row to update.

Request Body

{
  "row_data": {
    "name": "Alice",
    "variable1": "",
    "first_name": "raymond",
    "object_var": { "some_key": "some_var" },
    "variable_1": "the_row_with_object"
  }
}

Examples

import requests

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

data = {
    "row_data": {
        "name": "Alice",
        "first_name": "raymond"
    }
}

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

Response

{
  "row_index": 0,
  "row_data": {
    "name": "Alice",
    "first_name": "raymond"
  }
}