Loading...
Loading...
Sentry API via curl. Use this skill to manage error tracking, list issues, resolve errors, and monitor releases in Sentry.
npx skill4agent add vm0-ai/vm0-skills sentrycurlOfficial docs:https://docs.sentry.io/api/
export SENTRY_HOST="sentry.io" # Or your self-hosted Sentry domain
export SENTRY_TOKEN="sntrys_..." # Personal Auth Token
export SENTRY_ORG="your-org-slug" # Your organization slugproject:readevent:readevent:writeproject:releasesImportant: When usingin a command that pipes to another command, wrap the command containing$VARin$VAR. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
SENTRY_HOSTSENTRY_TOKENSENTRY_ORGhttps://${SENTRY_HOST}/api/0bash -c 'curl -s "https://${SENTRY_HOST}/api/0/projects/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {slug, name, platform, dateCreated}'Note: Replacewith your actual project slug from the "List Your Projects" output above.my-project
PROJECT_SLUG="my-project"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/projects/${SENTRY_ORG}/${PROJECT_SLUG}/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '{slug, name, platform, status, dateCreated}'bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {id, shortId, title, culprit, status, count, userCount, firstSeen, lastSeen}query=is:unresolvedquery=error.type:TypeErrorsort=datesort=newsort=freqNote: Replacewith your actual project slug from the "List Your Projects" output.my-project
PROJECT_SLUG="my-project"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/projects/${SENTRY_ORG}/${PROJECT_SLUG}/issues/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {id, shortId, title, status, count, lastSeen}/tmp/sentry_query.txtis:unresolved level:errorbash -c 'curl -s -G "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --data-urlencode "query@/tmp/sentry_query.txt"' | jq '.[] | {shortId, title, level, count}is:unresolvedis:resolvedis:ignoredlevel:errorlevel:warninglevel:infoassigned:meassigned:nonebrowser:Chromeos:Windowsrelease:1.0.0Note: Replacewith an actual issue ID from the "List Issues" or "List Project Issues" output (use the123456789field, notid).shortId
ISSUE_ID="123456789"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '{id, shortId, title, culprit, status, level, count, userCount, firstSeen, lastSeen, assignedTo}'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/events/latest/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '{eventID, message, platform, dateCreated, tags, contexts}'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/events/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {eventID, message, dateCreated}Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"/tmp/sentry_request.json{
"status": "resolved"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, status}'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"/tmp/sentry_request.json{
"status": "resolvedInNextRelease"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, status}'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"/tmp/sentry_request.json{
"status": "ignored"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, status}'/tmp/sentry_request.json{
"status": "ignored",
"statusDetails": {
"ignoreDuration": 60
}
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, status}'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"/tmp/sentry_request.json{
"status": "unresolved"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, status}'Note: Replacewith an actual issue ID from the "List Issues" output. Replace123456789with a valid user email from your Sentry organization members.<user-email>
/tmp/sentry_request.json{
"assignedTo": "<user-email>"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{id, shortId, assignedTo}'Note: Replacein the URL with the actual issue ID from the "List Issues" output.123456789
Note: Replaceand123456789with actual issue IDs from the "List Issues" output.987654321
/tmp/sentry_request.json{
"id": ["123456789", "987654321"],
"status": "resolved"
}bash -c 'curl -s -X PUT "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json'Note: Replacewith an actual issue ID from the "List Issues" output.123456789
ISSUE_ID="123456789"
bash -c 'curl -s -X DELETE "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/issues/${ISSUE_ID}/" --header "Authorization: Bearer ${SENTRY_TOKEN}" -w "\nHTTP Status: %{http_code}"'bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/releases/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {version, dateCreated, newGroups, projects: [.projects[].slug]}'Note: Replacewith an actual release version from the "List Releases" output.1.0.0
RELEASE_VERSION="1.0.0"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/releases/${RELEASE_VERSION}/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '{version, dateCreated, dateReleased, newGroups, lastEvent, projects}'Note: Replacewith your actual project slug from the "List Your Projects" output.<your-project-slug>
/tmp/sentry_request.json{
"version": "1.0.1",
"projects": ["<your-project-slug>"]
}bash -c 'curl -s -X POST "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/releases/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{version, dateCreated}'Note: Replacewith your actual project slug from the "List Your Projects" output.<your-project-slug>
/tmp/sentry_request.json{
"version": "1.0.2",
"projects": ["<your-project-slug>"],
"refs": [
{
"repository": "owner/repo",
"commit": "abc123def456"
}
]
}bash -c 'curl -s -X POST "https://${SENTRY_HOST}/api/0/organizations/${SENTRY_ORG}/releases/" --header "Authorization: Bearer ${SENTRY_TOKEN}" --header "Content-Type: application/json" -d @/tmp/sentry_request.json' | jq '{version, dateCreated}'Note: Replacewith your actual project slug from the "List Your Projects" output.my-project
PROJECT_SLUG="my-project"
bash -c 'curl -s "https://${SENTRY_HOST}/api/0/projects/${SENTRY_ORG}/${PROJECT_SLUG}/events/" --header "Authorization: Bearer ${SENTRY_TOKEN}"' | jq '.[] | {eventID, title, message, dateCreated}'| Status | Description |
|---|---|
| Active issue (default) |
| Manually resolved |
| Auto-resolve on next release |
| Ignored (won't alert) |
cursorSENTRY_HOST