How to create a Sentry auth token (with the right scopes)
Step-by-step: create a Sentry auth token, pick the minimal read-only scopes (project:read, event:read, org:read), test it with curl, and use it with self-hosted Sentry.
A Sentry auth token authenticates requests to Sentry's web API — issue counts, event volume, session health. The most common mistake is over-scoping it: for reading stats you need exactly three read scopes, nothing more.
Create the token
- Go to sentry.io/settings/account/api/auth-tokens — or the same path on your self-hosted instance
- Click Create New Token
- Grant these scopes:
project:read,event:read, andorg:read - Click Create Token and copy the value — Sentry shows it only once
Skip everything ending in :write or :admin. A stats consumer never needs them, and a leaked read-only token can't resolve issues, change settings, or delete projects — it can only look.
Test it with curl
This lists the organizations the token can see and confirms it works:
curl -s "https://sentry.io/api/0/organizations/" \
-H "Authorization: Bearer YOUR_TOKEN"From there, the endpoints you'll actually want are per-project:
# unresolved issue count
curl -s "https://sentry.io/api/0/projects/ORG_SLUG/PROJECT_SLUG/issues/?query=is:unresolved" \
-H "Authorization: Bearer YOUR_TOKEN"
# events received, hourly resolution
curl -s "https://sentry.io/api/0/projects/ORG_SLUG/PROJECT_SLUG/stats/?stat=received&resolution=1h" \
-H "Authorization: Bearer YOUR_TOKEN"Self-hosted Sentry
The token flow is identical on a self-hosted instance — create it under the same account settings path and swap https://sentry.io for your own host in every request. Anything that consumes the token just needs a configurable API host.
What this unlocks on a public page
Error health is a trust signal: a project with a visible, low unresolved-issue count and a healthy crash-free rate looks maintained. The infra.page Sentry widget uses exactly the three scopes above to show unresolved issues, 24h event volume, and crash-free session rate — on a page where you decide what's public and what stays private. It works with sentry.io and self-hosted Sentry alike.
Related setup guides: get your beehiiv API key and create a read-only Stripe key.
Related Posts
How to get your beehiiv API key (and what you can read with it)
Where to find your beehiiv API key and publication ID, how to test the v2 API with curl, and which subscriber stats it returns — open rate, click rate, and active subscriptions.
How to get an Ahrefs API key (the free Domain Rating endpoint now needs one)
Ahrefs' free Domain Rating API requires authentication from 10 August 2026. How to get a free API key, test it with curl, and meet the attribution rule most DR tools are missing.
How to create a restricted Stripe API key (read-only)
Create a Stripe restricted key that can only read subscriptions and prices: step-by-step permissions, test vs live mode, a curl test, and why you should never hand out sk_ keys.