Skip to main content
POST
Python

Authorizations

X-Auth-Token
string
header
required

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.

Body

application/json
action
string
required
Allowed value: "SEND_EMAIL"
actionParams
object
required

Email delivery.

name
string
required
Minimum string length: 1
filters
object
filterQuery
string | null

The trace query this automation is about, in the syntax the traces view uses. When set it supersedes filters.

message
string
alertType
enum<string>
Available options:
CRITICAL,
WARNING,
INFO
customGraphId
string

Set to make this an alert on that graph. graphAlert and alertType are then required.

graphAlert
object

The rule an alert fires by: series, operator, threshold, window.

report
object

What a scheduled report renders and when it sends.

templates
object

The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel.

notificationCadence
enum<string>

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.

Available options:
immediate,
5min_digest,
15min_digest,
hourly_digest
traceDebounceMs
integer

How long to wait for a trace to settle before the conditions are read.

Required range: 0 <= x <= 600000

Response

Trigger created

id
string
required
name
string
required
action
enum<string>
required
Available options:
SEND_EMAIL,
ADD_TO_DATASET,
ADD_TO_ANNOTATION_QUEUE,
SEND_SLACK_MESSAGE,
SEND_WEBHOOK
actionParams
object
required

Where 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.

graphAlert
object | null
required

The rule an alert fires by. Null for anything that is not one.

report
object | null
required

What a report renders and when. Null for anything else.

filters
object
required
filterQuery
string | null
required
kind
enum<string>
required

What this automation is about: matching traces, a metric crossing a threshold, or a schedule.

Available options:
AUTOMATION,
ALERT,
REPORT
customGraphId
string | null
required
notificationCadence
string | null
required
traceDebounceMs
number | null
required
templates
object
required

The Liquid templates this automation's message is rendered from. Absent fields render the LangWatch default for the channel.

active
boolean
required
message
string | null
required
alertType
enum<string> | null
required
Available options:
CRITICAL,
WARNING,
INFO,
null
createdAt
string
required
updatedAt
string
required
platformUrl
string<uri>
required
Last modified on May 19, 2026