Skip to contentSkip to page list

Docs

Enable or disable a monitor

Enable or disable a monitor

POST/api/v1/monitors/{id}/toggle
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/monitors/<id>/toggle"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",  "enabled": false}
api-reference/monitors/action-toggle

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

idstringrequired

The monitor id.

At least 1 character

Request body

application/json · Required

enabledbooleanrequired

Responses

200

Success

application/json

idstringrequired
enabledbooleanrequired
404

Not Found

application/json

errorstringrequired
messagestring

Documentation