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.
Update a trigger
Update an automation. Every field is optional and what is left out is left alone, except actionParams, which replaces the delivery configuration as a whole. The delivery channel and an alert's graph cannot be changed.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The trace query this automation is about, in the syntax the traces view uses. When set it supersedes `filters`.
The graph this alert watches, which an update cannot change. Accepted so that writing the read response back works; a different graph is refused. Create an alert on the other graph and delete this one.
Replaces the delivery configuration as a whole rather than merging into it: send the fields this automation should have from now on, and anything left out is removed. The one exception is a credential the read hid: send back the `[redacted]` placeholder and the stored credential is kept (a Slack automation not yet on a connection has its stored secret moved into one), so reading an automation, changing one field and writing the whole object back is safe. Only this channel's fields are accepted; anything else is refused rather than dropped, and the rule this automation fires by belongs in `graphAlert` or `report`.
The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel.
How often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace.
How long to wait for a trace to settle before the conditions are read.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/triggers/<triggerId>"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = { "report": { "schedule": {}, },}response = requests.patch( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/triggers/<triggerId>";const response = await fetch(url, { method: "PATCH", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ "report": { "schedule": {} } }),});const data = await response.json();curl --request PATCH \ --url 'https://app.langwatch.ai/api/v1/triggers/<triggerId>' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"report":{"schedule":{}}}'Call the LangWatch API from this project.Request: PATCH https://app.langwatch.ai/api/v1/triggers/<triggerId>Reference: https://langwatch.ai/docs/api-reference/triggers/update-triggers.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{ "report": { "schedule": {} }}```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", "action": "SEND_EMAIL", "actionParams": {}, "graphAlert": { "threshold": 0, "operator": "gt", "timePeriod": 1, "seriesName": "string" }, "report": { "source": { "kind": "dashboard", "dashboardId": "string" }, "schedule": { "cron": "string", "timezone": "string" }, "compareToPrevious": false }, "filters": {}, "filterQuery": "string", "kind": "AUTOMATION", "customGraphId": "string", "notificationCadence": "string", "traceDebounceMs": 0, "templates": { "slackTemplateType": "string", "slackTemplate": "string", "emailSubjectTemplate": "string", "emailBodyTemplate": "string" }, "active": false, "message": "string", "alertType": "CRITICAL", "createdAt": "string", "updatedAt": "string", "platformUrl": "string"}Not Found
application/json · Generated from schema
{ "error": "string", "message": "string"}Path parameters
triggerIdstringrequiredRequest body
application/json
namestringactivebooleanmessagestring | nullalertTypestring | nullfiltersobjectfilterQuerystring | nullThe trace query this automation is about, in the syntax the traces view uses. When set it supersedes filters.
actionstring"SEND_EMAIL""ADD_TO_DATASET""ADD_TO_ANNOTATION_QUEUE""SEND_SLACK_MESSAGE""SEND_WEBHOOK"customGraphIdstring | nullThe graph this alert watches, which an update cannot change. Accepted so that writing the read response back works; a different graph is refused. Create an alert on the other graph and delete this one.
actionParamsobjectReplaces the delivery configuration as a whole rather than merging into it: send the fields this automation should have from now on, and anything left out is removed. The one exception is a credential the read hid: send back the [redacted] placeholder and the stored credential is kept (a Slack automation not yet on a connection has its stored secret moved into one), so reading an automation, changing one field and writing the whole object back is safe. Only this channel's fields are accepted; anything else is refused rather than dropped, and the rule this automation fires by belongs in graphAlert or report.
graphAlertobjectThe rule this alert fires by. Only for an automation that is one.
reportobjectWhat this report renders and when. Only for one that is a report.
templatesobjectThe Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel.
notificationCadencestringHow often a notification automation is allowed to send. A new one starts on a five-minute digest, which is what keeps a broad condition from sending a message per matching trace.
"immediate""5min_digest""15min_digest""hourly_digest"traceDebounceMsintegerHow long to wait for a trace to settle before the conditions are read.
Responses
200Success
application/json
idstringrequirednamestringrequiredactionstringrequired"SEND_EMAIL""ADD_TO_DATASET""ADD_TO_ANNOTATION_QUEUE""SEND_SLACK_MESSAGE""SEND_WEBHOOK"actionParamsobjectrequiredWhere this automation delivers, with every credential value replaced by the [redacted] placeholder. Which channel is configured, which destination is set and which header names are in play all survive; the values never leave; a Slack automation names its connection by slackIntegrationId and carries no secret. Sending the placeholder back on an update keeps the stored value. The rule this automation fires by is not here: it is stated in graphAlert or report, and sending it in this field is refused.
graphAlertobject | nullrequiredThe rule an alert fires by. Null for anything that is not one.
reportobject | nullrequiredWhat a report renders and when. Null for anything else.
filtersobjectrequiredfilterQuerystring | nullrequiredkindstringrequiredWhat this automation is about: matching traces, a metric crossing a threshold, or a schedule.
"AUTOMATION""ALERT""REPORT"customGraphIdstring | nullrequirednotificationCadencestring | nullrequiredtraceDebounceMsnumber | nullrequiredtemplatesobjectrequiredThe Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel.
activebooleanrequiredmessagestring | nullrequiredalertTypestring | nullrequiredcreatedAtstringrequiredupdatedAtstringrequiredplatformUrlstring (uri)required404Not Found
application/json
errorstringrequiredmessagestring