Authentication
How API keys, dashboard sessions, MCP sign-ins and public ingest tokens authenticate, and what every API key scope allows.
axonpush accepts four kinds of credential. Pick the one that matches who is calling.
| Caller | Credential | Header |
|---|---|---|
| Your services, SDKs, scripts, CI | API key (ak_...) | X-API-Key: ak_... |
| A person in the dashboard | Session JWT | Authorization: Bearer <jwt> |
| A coding agent over MCP | MCP OAuth token, or an API key | Authorization: Bearer ... |
| Untrusted clients sending passive telemetry | Public ingest token (pt_...) | X-Public-Token: pt_... |
API keys
API keys belong to the organisation, not to a person. Each key carries a list of scopes and can be bound to one application and one environment. See API keys for creating, editing and revoking them.
The server reads a key from any of these, in this order:
x-axonpush-api-key: ak_...X-API-Key: ak_...Authorization: Bearer ak_...
curl https://api.axonpush.xyz/organization \
-H "X-API-Key: $AXONPUSH_API_KEY"The SDKs read AXONPUSH_API_KEY and AXONPUSH_BASE_URL from the environment and
send the key for you. See Python, TypeScript and .NET.
A key is checked on every call against three things:
- Scope. The operation’s required scope must be on the key. Some operations accept any one of several scopes.
- Organisation. A key only ever acts on its own organisation.
- Binding. A key bound to an application or environment only reaches data in that application or environment. Some operations, such as editing organisation settings, refuse bound keys entirely.
A key that fails any of these gets 403 credential lacks operation permission.
Keys can never manage members, invitations, SSO, billing or other API keys; those
need a dashboard session.
Dashboard sessions
The dashboard signs you in through the auth service (email and password, Google,
or SSO) and calls the API with a short-lived JWT as
Authorization: Bearer <jwt>. Sessions are not limited by scopes. They are
limited by your role in the organisation, which is
looked up live on every request, so a removed member loses access immediately.
A session acts on your active organisation. Switch it with
PATCH /users/me/active-org, or with the
organisation switcher in the dashboard. List the organisations you belong to with
GET /users/me/organizations.
X-Tenant-ID
X-Tenant-ID is a guard for dashboard sessions. It never selects an
organisation. When the header is present and does not match the organisation the
request resolved to, the server answers 409 active organization changed; refresh before retrying. The dashboard sends it so a request started in one tab does not
land in another organisation after you switch in a second tab.
Leave it unset when you call with an API key. The key already fixes the organisation, and a mismatched value only turns a valid call into a 409.
The SDKs send x-tenant-id when you configure a tenant id (AXONPUSH_TENANT_ID).
With an API key you do not need it. If you set it, it must be the key’s own
organisation id.
Coding agents over MCP
A coding agent connected through MCP signs in with MCP OAuth as you. It keeps your role, with three limits:
- Operations marked dashboard-only refuse with
403 Do this in the dashboard.Changing a member’s role, transferring ownership and deleting an organisation are dashboard-only. - The agent never sees secrets. When it creates an API key it gets a one-time claim link for you to open, not the key.
- Audit entries record the call as coming from MCP, with the client name.
An MCP client can also authenticate with an API key as Authorization: Bearer ak_...; it then gets exactly that key’s scopes.
Credentials for agent setup
When an agent wires axonpush into a project, keep its credentials apart from the application’s:
- The agent signs in through MCP OAuth as you. Reading activity and the draft
needs
observe:read; editing and activating a workspace needs an owner or admin, orworkspaces:manage; publishing a template needstemplates:publish. - The application gets its own key with
events:publishonly, bound to its application and environment.workspaces_connectmints exactly that key. A publish-only key can check the receipt for an observation it sent, but cannot read evidence or edit a workspace. - Read service secrets from the project’s existing environment or secret store. Write a local env file only when asked to, and make sure it is git-ignored.
- Never print keys or tokens in agent output, and never ship an
ak_key to a browser or mobile app. - The application must still start without axonpush credentials.
Public ingest tokens
A public ingest token (pt_...) is for clients you do not trust, such as a browser.
It is bound to one channel and one environment, can only send telemetry, and grants
no reads, no workspace authoring and no management. Send it as X-Public-Token.
Treat what arrives through it as evidence, not as identity.
Owners and admins manage tokens from a dashboard session:
curl -X POST https://api.axonpush.xyz/public-ingest-tokens \
-H "Authorization: Bearer $SESSION_JWT" \
-H "Content-Type: application/json" \
-d '{"name": "web app", "channelId": "ch_...", "environmentId": "env_..."}'The response includes token once. See tokens.create,
tokens.list and
tokens.revoke.
Scopes
GET /capabilities returns the scope catalogue as apiKeyScopes, and the
dashboard builds its permission picker from it. There are 17 scopes today. New
keys default to events:publish and observe:read.
| Scope | Group | Allows |
|---|---|---|
events:publish | Core | Publishing events, logs, traces and workspace observations, identify calls, and reading the receipt of an observation you sent |
events:read | Read | Reading event and log history |
observe:read | Read | Reading traces, errors, analytics and breakdowns, workspace activity, drafts, the catalog and describe, organisation details |
content:read | Read | Reading private interaction content (prompts, responses, tool payloads) captured under the privacy policy |
replay:read | Read | Reading browser recordings. Also needs content:read |
profiles:read | Read | Reading personal attributes and profile traits unmasked |
audit:read | Read | Reading evidence archives and audit compliance records |
content:erase | Manage | Erasing private telemetry for a subject |
audit:manage | Manage | Managing evidence retention, legal holds and audit compliance workflows |
requests:manage | Manage | Managing affected-person requests and the recorded responses |
observe:manage | Manage | Triaging error issues: resolve, ignore, assign |
apps:manage | Manage | Creating, updating and deleting applications |
channels:manage | Manage | Managing channels inside applications |
alerts:manage | Manage | Creating and managing alert rules |
workspaces:manage | Manage | Validating, previewing, revising and activating workspaces, erasure, and workspaces_connect |
templates:publish | Manage | Publishing immutable public or organisation-private workspace templates |
webhooks:manage | Manage | Managing webhook endpoints |
A scope is necessary, not sufficient: the organisation, application and environment checks above still apply, and some records may be further limited by data access grants.
curl https://api.axonpush.xyz/capabilities -H "X-API-Key: $AXONPUSH_API_KEY"Discover what you can call
GET /capabilities/operations tells the current caller which operations it may
run. Each operation id comes back as allowed, denied or conditional, with a
registryRevision. Conditional means the server still has to check the actual
target, such as another organisation or a record covered by a data access grant.
Treat a missing entry or a failed lookup as unknown, not as permission.
The answer is specific to the caller. Refresh it after switching organisation or
changing roles or scopes, and never use it in place of the server’s own checks.
GET /capabilities describes the deployment instead: feature flags, licence
status, controls and the scope catalogue.
See capabilities.get and
capabilities.operations.