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.
Delete all events
Archive simulation runs. Pass exactly one of scenarioSetId (archives every run in the set; scenarioSetId=default targets the implicit default set) or scenarioRunId (archives that one run).
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/scenario-events"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.delete( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/scenario-events";const response = await fetch(url, { method: "DELETE", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request DELETE \ --url 'https://app.langwatch.ai/api/v1/scenario-events' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project.Request: DELETE https://app.langwatch.ai/api/v1/scenario-eventsReference: https://langwatch.ai/docs/api-reference/scenario-events/delete-scenario-events.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
{ "archived": 0, "failed": 0, "scenarioSetId": "string", "hasMore": false, "scenarioRunId": "string"}Missing or invalid scope parameter
application/json · Generated from schema
{ "error": "string"}Unauthorized
application/json · Generated from schema
{ "error": "string", "message": "string"}Scenario run not found in this project
application/json · Generated from schema
{ "error": "string"}Unprocessable Entity
application/json · Generated from schema
{ "error": "string", "message": "string"}Internal Server Error
application/json · Generated from schema
{ "error": "string", "message": "string"}Query parameters
scenarioSetIdstringscenarioRunIdstringResponses
200Success
application/json
archivedintegerrequiredfailedintegerrequiredscenarioSetIdstringhasMorebooleanscenarioRunIdstring400Missing or invalid scope parameter
application/json
errorstringrequired401Unauthorized
application/json
errorstringrequiredmessagestring404Scenario run not found in this project
application/json
errorstringrequired422Unprocessable Entity
application/json
errorstringrequiredmessagestring500Internal Server Error
application/json
errorstringrequiredmessagestring