Create a Slack alert trigger
import requests
url = "https://app.langwatch.ai/api/trigger/slack"
payload = {
"slack_webhook": "<string>",
"name": "<string>"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({slack_webhook: '<string>', name: '<string>'})
};
fetch('https://app.langwatch.ai/api/trigger/slack', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/trigger/slack \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"slack_webhook": "<string>",
"name": "<string>"
}
'{
"message": "<string>"
}{
"message": "<string>",
"errors": [
{}
]
}{
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}Triggers
Create a Slack alert trigger
Create a trigger that posts to a Slack incoming webhook when traces match its filters. The /api/triggers family supersedes this narrower form, which stays for callers written against it.
POST
/
api
/
trigger
/
slack
Create a Slack alert trigger
import requests
url = "https://app.langwatch.ai/api/trigger/slack"
payload = {
"slack_webhook": "<string>",
"name": "<string>"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({slack_webhook: '<string>', name: '<string>'})
};
fetch('https://app.langwatch.ai/api/trigger/slack', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/trigger/slack \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"slack_webhook": "<string>",
"name": "<string>"
}
'{
"message": "<string>"
}{
"message": "<string>",
"errors": [
{}
]
}{
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"fault": "<string>",
"tips": [
"<string>"
],
"docsUrl": "<string>"
}Authorizations
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
Incoming webhook URL the alert is posted to
How the trigger is listed in the app
Available options:
CRITICAL, WARNING, INFO Extra line included with each alert
Which traces the trigger fires on. An empty object fires on all of them.
Show child attributes
Show child attributes
Response
The trigger was created
Human-readable confirmation
Was this page helpful?
⌘I