Skip to main content
POST
/
api
/
experiments
/
{experiment_id}
/
rows
{
  "rows": [
    {
      "input": {
        "current_prompt_version": "v2",
        "prompt_versions_diff": "some_other_diff"
      }
    },
    {
      "input": {
        "current_prompt_version": "v3",
        "prompt_versions_diff": "more_diffs"
      }
    }
  ]
}
{
  "added": 2,
  "rows": []
}
Add rows to an experiment.

Authentication

  • API key: Authorization: Bearer <API key>

Path Parameters

experiment_id
string
required
The ID of the experiment to add rows to.

Request Body

{
  "rows": [
    {
      "input": {
        "current_prompt_version": "v2",
        "prompt_versions_diff": "some_other_diff"
      }
    },
    {
      "input": {
        "current_prompt_version": "v3",
        "prompt_versions_diff": "more_diffs"
      }
    }
  ]
}

Examples

import requests

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

data = {
    "rows": [
        {
            "input": {
                "current_prompt_version": "v2"
            }
        }
    ]
}

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

Response

{
  "added": 2,
  "rows": []
}