Create alerts via Sentry's workflow engine API.
Use these API calls to resolve names to IDs as needed.
bash
API="https://{region}.sentry.io/api/0/organizations/{org}"
AUTH="Authorization: Bearer {token}"
# Find user ID by email
curl -s "$API/members/" -H "$AUTH" | python3 -c "
import json,sys
for m in json.load(sys.stdin):
if m.get('email')=='USER_EMAIL' or m.get('user',{}).get('email')=='USER_EMAIL':
print(m['user']['id']); break"
# List teams
curl -s "$API/teams/" -H "$AUTH" | python3 -c "
import json,sys
for t in json.load(sys.stdin):
print(t['id'], t['slug'])"
# List integrations (for Slack/PagerDuty)
curl -s "$API/integrations/" -H "$AUTH" | python3 -c "
import json,sys
for i in json.load(sys.stdin):
print(i['id'], i['provider']['key'], i['name'])"
Pick which issue events fire the workflow. Use
(triggers must always use this).
Conditions that must pass before actions execute. Use
,
, or
.
Priority scale: Low=25, Medium=50, High=75, Critical=100.
Set
to
to invert (fire when condition is NOT met).
json
{
"name": "<Alert Name>",
"enabled": true,
"environment": null,
"config": { "frequency": 0 },
"triggers": {
"logicType": "any-short",
"conditions": [
{ "type": "first_seen_event", "comparison": true, "conditionResult": true }
]
},
"actionFilters": [{
"logicType": "all",
"conditions": [
{ "type": "issue_priority_greater_or_equal", "comparison": 75, "conditionResult": true }
],
"actions": [{
"type": "email",
"integrationId": null,
"data": {},
"config": {
"targetType": "user",
"targetIdentifier": "<user_id>",
"targetDisplay": null
}
}]
}]
}
: seconds between repeated notifications.
= no throttling,
= 30 min.
Expect HTTP
. The response contains the workflow
.
If the org lacks the
feature flag, the alert appears at: