Loading...
Loading...
Create Sentry alerts using the workflow engine API. Use when asked to create alerts, set up notifications, configure issue priority alerts, or build workflow automations. Supports email, Slack, PagerDuty, Discord, and other notification actions.
npx skill4agent add getsentry/sentry-for-ai sentry-create-alertAll Skills > Feature Setup > Create Alert
curlalerts:writeorg:adminorg:write| Detail | Required | Example |
|---|---|---|
| Org slug | Yes | |
| Auth token | Yes | |
| Region | Yes (default: | |
| Alert name | Yes | |
| Trigger events | Yes | Which issue events fire the workflow |
| Conditions | Optional | Filter conditions before actions execute |
| Action type | Yes | |
| Action target | Yes | User email, team, channel, or service |
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'])"logicType: "any-short"| Type | Fires when |
|---|---|
| New issue created |
| Resolved issue recurs |
| Archived issue reappears |
| Issue is resolved |
logicType: "all""any-short""none"comparisontype| Type | | Description |
|---|---|---|
| | Priority >= Low(25)/Medium(50)/High(75) |
| | Priority dropped below peak |
| | Event count in time window |
| | Affected users in time window |
| | Event tag matches |
| | Issue assigned to target |
| | Event level (fatal=50, error=40, warning=30) |
| | Issue age |
| | Category (1=Error, 6=Feedback) |
| | Total occurrence count |
"1min""5min""15min""1hr""1d""1w""30d""co""nc""eq""ne""sw""ew""is""ns"conditionResultfalse| Type | Key Config |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
{
"name": "<Alert Name>",
"enabled": true,
"environment": null,
"config": { "frequency": 30 },
"triggers": {
"logicType": "any-short",
"conditions": [
{ "type": "first_seen_event", "comparison": true, "conditionResult": true }
],
"actions": []
},
"actionFilters": [{
"logicType": "all",
"conditions": [
{ "type": "issue_priority_greater_or_equal", "comparison": 75, "conditionResult": true },
{ "type": "event_frequency_count", "comparison": {"value": 50, "interval": "1hr"}, "conditionResult": true }
],
"actions": [{
"type": "email",
"integrationId": null,
"data": {},
"config": {
"targetType": "user",
"targetIdentifier": "<user_id>",
"targetDisplay": null
},
"status": "active"
}]
}]
}frequency051030601807201440triggers.actions[]actionFilters[].actionscurl -s -w "\n%{http_code}" -X POST \
"https://{region}.sentry.io/api/0/organizations/{org}/workflows/" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{payload}'201idhttps://{org_slug}.sentry.io/monitors/alerts/{workflow_id}/workflow-engine-uihttps://{org_slug}.sentry.io/alerts/rules/# List all workflows
curl -s "$API/workflows/" -H "$AUTH"
# Get one workflow
curl -s "$API/workflows/{id}/" -H "$AUTH"
# Update a workflow
curl -s -X PUT "$API/workflows/{id}/" -H "$AUTH" -H "Content-Type: application/json" -d '{payload}'
# Delete a workflow
curl -s -X DELETE "$API/workflows/{id}/" -H "$AUTH"
# Expect 204| Issue | Solution |
|---|---|
| 401 Unauthorized | Token needs |
| 403 Forbidden | Token must belong to the target org |
| 404 Not Found | Check org slug and region ( |
| 400 Bad Request | Validate payload JSON structure, check required fields |
| User ID not found | Verify email matches a member of the org |