Public ingest tokens
Write-only pt_ tokens bound to one channel and one environment, for browser, mobile and Sentry DSN ingest where an API key would be exposed.
A public ingest token (pt_...) is a credential you can ship to code you do
not control: a browser bundle, a mobile app, a Sentry DSN. It can only write,
and only into the one channel and environment it was minted for. It cannot
read anything, manage anything or move its data elsewhere.
Use an API key (ak_...) for server-side code. Use a
public token wherever the credential will be visible to end users.
What a token can do
| Endpoint | Header |
|---|---|
POST /event, POST /events/batch | X-Public-Token: pt_... or Authorization: Bearer pt_... |
POST /v1/traces, POST /v1/logs | X-Public-Token: pt_... or Authorization: Bearer pt_... |
| Sentry envelope and store endpoints | The token is the DSN’s public key |
That is the whole list. Public tokens are not accepted for workspace observations or any read or management endpoint.
The binding is fixed:
- Events always land in the token’s channel. Naming a different
channel_idin an event body, or a differentX-Axonpush-Channelon OTLP, is403. - Events always land in the token’s environment. An
X-Axonpush-Environmentheader naming any other environment is400. - If the token’s app, environment or organisation has been deleted, every
request with it is
401.
Create a token
Creating, listing and revoking tokens needs a dashboard session of an organisation owner or admin with a verified email address. API keys cannot manage public tokens.
In the dashboard. Open Integrations. In the Sentry card, click
Create a DSN. axonpush mints a public token named sentry-<environment>
for the environment selected in the top bar, on the default channel of the
current application, and shows the DSN, which contains the token, once. The
Sentry card only appears when Sentry ingest is enabled for your
organisation. The token inside a DSN works on the OTLP and event endpoints too.
Over the API. Call POST /public-ingest-tokens with your session token
(see Authentication). environmentId is the
environment’s ID, not its slug; get it from
GET /environments.
curl -X POST https://api.axonpush.xyz/public-ingest-tokens \
-H "Authorization: Bearer $AXONPUSH_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "web-app-prod", "channelId": "chan_...", "environmentId": "env_..."}'{
"tokenId": "pt_3f...",
"name": "web-app-prod",
"prefix": "pt_",
"token": "pt_8c1e...",
"channelId": "chan_...",
"environmentId": "env_...",
"appId": "app_...",
"orgId": "...",
"active": true,
"createdAt": "2026-11-18T09:30:00.000Z"
}token is returned only in this response. axonpush stores a hash. The token’s
app is taken from the channel. name is 1 to 60 characters.
The channel must belong to your organisation, and environmentId must name a
live environment in it. A missing, deleted or other-organisation environment is
404 environment not found.
Use a token
await fetch("https://api.axonpush.xyz/event", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Public-Token": "pt_8c1e...",
},
body: JSON.stringify({
identifier: "checkout.viewed",
payload: { step: 2 },
dedupKey: crypto.randomUUID(),
}),
});The API allows cross-origin requests with the X-Public-Token,
X-Axonpush-Environment and X-Axonpush-Channel headers, so browser code,
including a browser OTLP exporter, can call it directly. Browser code can also
read the Retry-After and X-Sentry-Rate-Limits response headers. A self-hosted install allows any origin
unless you restrict it with CORS_ORIGINS.
List and revoke
GET /public-ingest-tokenslists the organisation’s tokens without their secrets. In the dashboard, Applications & environments shows each application’s tokens and their environments.DELETE /public-ingest-tokens/{tokenId}revokes one. In the dashboard, use the revoke button next to a DSN in the Sentry card. Revocation takes effect on the next request; data already sent stays.
Creating and revoking a token are recorded in the organisation’s audit log.
lastUsedAt records when the token last authenticated an ingest request. It is
updated at most once a minute per token, so treat it as approximate to the
minute.
Related
- Apps, channels and environments
- Sentry DSN setup
- API reference:
tokens.create,tokens.list,tokens.revoke
Observations (observe and identify)
Report business facts to a workspace with observe, attach profile traits with identify, and check that each observation was stored and projected.
What we receive (ingest outcomes)
Daily counts of what Sentry SDKs sent to axonpush, what was accepted, and what was dropped and why, from GET /ingest/outcomes.