Skip to contentSkip to page list

Docs

Update a monitor

Update a monitor (name, enabled state, settings, etc.)

PATCH/api/v1/monitors/{id}
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/monitors/<id>"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {    "mappings": {        "expansions": [],    },}​response = requests.patch(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "name": "string",  "slug": "string",  "checkType": "string",  "enabled": false,  "executionMode": "ON_MESSAGE",  "sample": 0,  "level": "string",  "evaluatorId": "string",  "preconditions": null,  "parameters": null,  "mappings": null,  "threadIdleTimeout": 0,  "createdAt": "string",  "updatedAt": "string",  "autoPausedAt": "string",  "autoPausedReason": "string",  "evaluatorLabel": "string",  "createdById": "string",  "updatedById": "string",  "platformUrl": "string"}
api-reference/monitors/update-monitors

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

namestring
At least 1 character
enabledboolean
checkTypestring
executionModestring
One of"ON_MESSAGE""AS_GUARDRAIL""MANUALLY"
preconditionsany[]
parametersobject
mappingsobject | null
Option 1object
mappingobjectrequired
expansionsstring[]required
Option 2null
samplenumber
Minimum 0Maximum 1
evaluatorIdstring | null
Option 1string
Option 2null
levelstring
One of"trace""thread"
threadIdleTimeoutinteger | null
Option 1integer
Option 2null
evaluatorLabelstring | null

Run the evaluator at this deploy label, such as production; null runs the latest.

Option 1string
Option 2null

Responses

200

Success

application/json

idstringrequired
namestringrequired
slugstringrequired
checkTypestringrequired
enabledbooleanrequired
executionModestringrequired
One of"ON_MESSAGE""AS_GUARDRAIL""MANUALLY"
samplenumberrequired
levelstringrequired
evaluatorIdstring | nullrequired
preconditionsanyrequired
parametersanyrequired
mappingsany | nullrequired
Option 1any
Option 2null
threadIdleTimeoutnumber | nullrequired
createdAtstringrequired
updatedAtstringrequired
autoPausedAtstring | nullrequired

When the monitor paused itself because its evaluations mostly failed.

autoPausedReasonstring | nullrequired

Why the monitor paused itself.

evaluatorLabelstring | nullrequired

The evaluator deploy label the monitor runs; null runs the latest version.

createdByIdstring | nullrequired

The user who created the monitor, when recorded.

updatedByIdstring | nullrequired

The user who changed the monitor last.

platformUrlstring (uri)required
404

Not Found

application/json

errorstringrequired
messagestring

Documentation