import requests
url = "https://app.langwatch.ai/api/v1/test-suites"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/test-suites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/test-suites \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"scenarioIds": [
"<string>"
],
"scenarioCount": 123,
"archivedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>",
"fields": [
{
"identifier": "<string>",
"type": "text"
}
],
"evaluators": [
{
"id": "<string>",
"evaluatorId": "<string>",
"required": true,
"mappings": {}
}
]
}Create a test suite
Create a test suite. It starts empty: scenarios join it by being filed into it, and the targets a run goes against are sent with the run. It may declare fields and attach evaluators from the start.
import requests
url = "https://app.langwatch.ai/api/v1/test-suites"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/test-suites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/test-suites \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"scenarioIds": [
"<string>"
],
"scenarioCount": 123,
"archivedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>",
"fields": [
{
"identifier": "<string>",
"type": "text"
}
],
"evaluators": [
{
"id": "<string>",
"evaluatorId": "<string>",
"required": true,
"mappings": {}
}
]
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Body
The test suite name, as it reads in the platform.
1 - 200The fields the test suite declares, in the order the platform shows them. Up to 30. An identifier is lowercase letters, digits and underscores, starting with a letter; the type is text, number or boolean.
30Show child attributes
Show child attributes
The evaluators that run after every scenario run. Up to 20. A required evaluator that fails fails the scenario; a score-only evaluator reports and never gates.
20Show child attributes
Show child attributes
Response
Success
The test suite id.
The test suite name.
The suite's address in the platform. It is kept when the suite is renamed.
The scenarios filed in this suite, in the order it shows them.
How many scenarios are filed in it.
When the suite was archived, or null while it is active.
When the suite was created.
When the suite was last written.
Where to open this test suite in the LangWatch platform.
The fields the test suite declares. Absent on servers that predate fields on this family.
30Show child attributes
Show child attributes
The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.
20Show child attributes
Show child attributes
Was this page helpful?