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.
Rename a test suite
Edit a test suite: its name, the fields it declares, the evaluators attached to it. Send only what changes. The slug is kept on a rename, so links and run history stay where they are.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The test suite id.
The new name. The slug is kept.
The full list of fields the suite declares. A field an attached evaluator still reads cannot be removed: answers 422 suite_field_in_use.
The full list of evaluators attached to the suite. An evaluator the project does not hold answers 422 suite_evaluator_not_found; a mapping the run cannot read answers 422 suite_evaluator_mapping_invalid.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/test-suites/<id>"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.patch( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/test-suites/<id>";const response = await fetch(url, { method: "PATCH", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request PATCH \ --url 'https://app.langwatch.ai/api/v1/test-suites/<id>' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project.Request: PATCH https://app.langwatch.ai/api/v1/test-suites/<id>Reference: https://langwatch.ai/docs/api-reference/test-suites/update-test-suites.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.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"}Not Found
application/json · Generated from schema
{ "error": "string", "message": "string", "code": "string"}Path parameters
idstringrequiredThe test suite id.
Request body
application/json
namestringThe new name. The slug is kept.
fieldsobject[]The full list of fields the suite declares. A field an attached evaluator still reads cannot be removed: answers 422 suite_field_in_use.
evaluatorsobject[]The full list of evaluators attached to the suite. An evaluator the project does not hold answers 422 suite_evaluator_not_found; a mapping the run cannot read answers 422 suite_evaluator_mapping_invalid.
Responses
200Success
application/json
idstringrequiredThe test suite id.
namestringrequiredThe test suite name.
slugstringrequiredThe suite's address in the platform. It is kept when the suite is renamed.
scenarioIdsstring[]requiredThe scenarios filed in this suite, in the order it shows them.
scenarioCountnumberrequiredHow many scenarios are filed in it.
fieldsobject[]The fields the test suite declares. Absent on servers that predate fields on this family.
evaluatorsobject[]The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.
archivedAtstring | nullrequiredWhen the suite was archived, or null while it is active.
createdAtstringrequiredWhen the suite was created.
updatedAtstringrequiredWhen the suite was last written.
platformUrlstring (uri)requiredWhere to open this test suite in the LangWatch platform.
404Not Found
application/json
errorstringrequiredmessagestringcodestringrequired