Skip to contentSkip to page list

Docs

Apply a suite template

Create a test suite from a template, with one scenario per template scenario filled from the fit: the agent's name, its tools and what it must never do. The suite name defaults to the template title. An unknown template id answers 404 suite_template_not_found.

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

Success

application/json · Generated from schema

{  "suiteId": "string",  "slug": "string",  "name": "string",  "scenarioIds": [    "string"  ]}
api-reference/test-suites/apply-a-suite-template

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.

Path parameters

templateIdstringrequired
Up to 80 charactersPattern ^[a-z0-9]+(-[a-z0-9]+)*$

Request body

application/json · Required

fitobjectrequired
agentNamestringrequired
At least 1 characterUp to 120 characters
toolsstring[]
Default: []
mustNeverstring[]
Default: []
namestring
At least 1 characterUp to 200 characters

Responses

201

Success

application/json

suiteIdstringrequired
At least 1 character
slugstringrequired
At least 1 character
namestringrequired
At least 1 character
scenarioIdsstring[]required
404

Not Found

application/json

errorstringrequired
messagestring
codestringrequired

Documentation