Create testset
Create a new testset for evaluation.
## Authentication
- API key: `Authorization: Bearer `
## Request Body
```json Request
{
"name": "Test API Key Dataset",
"description": "Dataset for testing new features",
"column_definitions": [
{
"field": "input"
},
{
"field": "expected_output"
}
],
"starred": false
}
```
## Examples
```python Python
url = "https://api.respan.ai/api/testsets"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"name": "Test API Key Dataset",
"description": "Dataset for testing new features",
"column_definitions": [
{"field": "input"},
{"field": "expected_output"}
],
"starred": False
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
```
```bash cURL
curl -X POST "https://api.respan.ai/api/testsets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Test API Key Dataset",
"column_definitions": [
{"field": "input"},
{"field": "expected_output"}
]
}'
```
## Response
```json 200 OK
{
"id": "testset_id_123",
"name": "Test API Key Dataset",
"description": "Dataset for testing new features",
"column_definitions": [
{"field": "input"},
{"field": "expected_output"}
]
}
```
Authentication
AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys
Request
This endpoint expects an object.
Response
Successful response for Create testset
Errors
401
Unauthorized Error