Skip to contentSkip to page list

Docs

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.

POST/api/v1/test-suites
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/test-suites"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {}​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "name": "string",  "slug": "string",  "scenarioIds": [    "string"  ],  "scenarioCount": 0,  "fields": [    {      "identifier": "string",      "type": "text"    }  ],  "evaluators": [    {      "id": "string",      "evaluatorId": "string",      "required": false,      "mappings": {}    }  ],  "archivedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "platformUrl": "string"}
api-reference/test-suites/create-test-suites

Authorization

X-Auth-Tokenstringheaderrequired

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.

Request body

application/json · Required

namestringrequired

The test suite name, as it reads in the platform.

At least 1 characterUp to 200 characters
fieldsobject[]

The 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.

identifierstringrequired

The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter.

At least 1 characterUp to 64 charactersPattern ^[a-z][a-z0-9_]*$
typestringrequired

The value type every scenario carries for this field.

One of"text""number""boolean"
evaluatorsobject[]

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.

idstringrequired

The attachment id. Stable across edits of the attachment.

At least 1 characterUp to 64 characters
evaluatorIdstringrequired

The id of the saved evaluator this attachment runs.

At least 1 character
requiredbooleanrequired

Whether a failing result fails the scenario. A score-only evaluator reports and never gates.

mappingsobjectrequired

Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run.

Responses

201

Success

application/json

idstringrequired

The test suite id.

namestringrequired

The test suite name.

slugstringrequired

The suite's address in the platform. It is kept when the suite is renamed.

scenarioIdsstring[]required

The scenarios filed in this suite, in the order it shows them.

scenarioCountnumberrequired

How many scenarios are filed in it.

fieldsobject[]

The fields the test suite declares. Absent on servers that predate fields on this family.

identifierstringrequired

The field name, as scenarios and evaluator mappings address it. Lowercase letters, digits and underscores, starting with a letter.

At least 1 characterUp to 64 charactersPattern ^[a-z][a-z0-9_]*$
typestringrequired

The value type every scenario carries for this field.

One of"text""number""boolean"
evaluatorsobject[]

The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.

idstringrequired

The attachment id. Stable across edits of the attachment.

At least 1 characterUp to 64 characters
evaluatorIdstringrequired

The id of the saved evaluator this attachment runs.

At least 1 character
requiredbooleanrequired

Whether a failing result fails the scenario. A score-only evaluator reports and never gates.

mappingsobjectrequired

Where each evaluator input reads its value, keyed by input name. Inputs left out are unmapped; a required input left unmapped refuses the run.

archivedAtstring | nullrequired

When the suite was archived, or null while it is active.

createdAtstringrequired

When the suite was created.

updatedAtstringrequired

When the suite was last written.

platformUrlstring (uri)required

Where to open this test suite in the LangWatch platform.

Documentation