Apps, channels and environments
How axonpush scopes incoming data by application, channel and environment, how each request picks them, and how to manage them.
Every stored event carries three labels: the app it came from, the
channel within that app, and the environment (such as dev or prod).
Credentials can be bound to them, and every read can filter by them.
- An app is one application or service you send data from. Workspaces belong to an app.
- A channel is a stream inside an app. Most setups never touch channels: the defaults below are created for you.
- An environment belongs to the organisation, not to an app. One
prodcovers every app, so the production view shows production data from all of them.
What exists by default
The first time an owner or admin opens the dashboard, axonpush seeds:
| Resource | Name | Notes |
|---|---|---|
| App | Default | With one channel named default. Events with no channel go here. |
| Environment | dev (Development) | The default environment. Unbound credentials write here. |
| Environment | staging (Staging) | |
| Environment | prod (Production) | Marked as production. |
The same environment set is also seeded the first time an organisation sends
data without one. Ingest creates a few channels on demand as well:
otlp-traces and otlp-logs for OTLP, and a default
channel inside an app the first time a key bound to that app publishes without
naming a channel.
How a request picks app, channel and environment
The credential decides. Bind an API key to an app
(appId) and an environment (environmentId) when you create it, and
everything sent with it lands there. A
public ingest token is always bound to one
channel and one environment.
| Endpoint | App and channel | Environment |
|---|---|---|
POST /event, POST /events/batch | Token’s channel, else channel_id in the body, else the key’s app default channel, else the org default channel | The credential’s environment. An unbound credential may choose one with X-Axonpush-Environment (slug or ID); otherwise the org default. |
POST /v1/traces, POST /v1/logs | Token’s channel, else X-Axonpush-Channel, else otlp-traces / otlp-logs in the key’s app (or an app named OTLP) | The credential’s environment. An unbound key may choose one with X-Axonpush-Environment (slug or ID); otherwise the org default. |
| Sentry endpoints | The DSN token’s channel | The DSN token’s environment. The environment set in the Sentry SDK is kept as an attribute only. |
| Workspace observations | The workspace’s app | environment in the body or on the observations, else the key’s environment. Required. |
A bound credential can never write elsewhere. Naming a different environment is
400 environment override forbidden on OTLP, POST /event and
POST /events/batch, and 403 on observations; naming
a channel outside the credential’s app is 403. Credentials bound to an app or
environment that has since been deleted stop working.
The OTLP endpoints tell you where data landed in the response headers
x-axonpush-resolved-environment (the slug) and x-axonpush-resolved-via
(apiKey, publicToken, header or default).
Choosing a setup
One key per deployment target is the usual shape: a key bound to prod,
another bound to dev, and your secret manager decides which process gets
which. Nothing in the application chooses an environment, so nothing in the
application can get it wrong.
One unbound key writes to the org default environment, or to whatever
environment a request names in X-Axonpush-Environment. Convenient for a
test harness, but the guarantee now lives in code.
Public tokens are for browser and mobile code. Browser code cannot write to production by accident because a token can only address its own environment.
Environments
In the dashboard
Switch the environment you are looking at from the top bar. To manage them, open Settings > Environments:
- New environment opens Create environment: a Name, a Slug (filled in from the name), a Swatch colour and a production toggle. Copy settings from (optional) copies the colour and production flag from an existing environment in the form; nothing else is copied.
- The star button (Set as default) makes an environment the org default.
- The bin button deletes an environment after you type its slug. The default environment cannot be deleted.
Over the API
Environments are addressed by slug in the path.
| Method | Path | Who |
|---|---|---|
GET | /environments | Any member, or a key with observe:read |
POST | /environments | Owner or admin, dashboard session only |
PATCH | /environments/{slug} | Owner or admin, dashboard session only |
POST | /environments/{slug}/promote | Owner or admin, dashboard session only |
DELETE | /environments/{slug} | Owner or admin, dashboard session only |
API keys cannot create, change or delete environments; those calls return
403.
curl -X POST https://api.axonpush.xyz/environments \
-H "Authorization: Bearer $AXONPUSH_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Preview", "slug": "preview", "color": "#22c55e"}'POST /environments takes name (1 to 120 characters) and optionally slug,
color, isProduction and isDefault.
- When
slugis omitted it is derived from the name: lowercased, runs of other characters turned into hyphens, cut to 40 characters. - A slug is 1 to 40 characters of
a-z,0-9and-, starting and ending with a letter or digit, and must not start withaxonpush-. Otherwise422. - A slug already used in the organisation is
409. isProductiondefaults to true only for the slugsprodandproduction.colordefaults to#6366f1.isDefault: truemakes the new environment the org default and clears the flag on the previous default, aspromotedoes.
PATCH /environments/{slug} changes name, color and isProduction. The
slug cannot be changed.
POST /environments/{slug}/promote makes that environment the org default and
clears the flag on the previous one. Promoting the current default does
nothing.
DELETE /environments/{slug} is a soft delete and returns 400 for the
default environment; promote another one first. Credentials bound to a deleted
environment stop working, and OTLP requests that name it get
400 unknown environment.
Two things in the delete flow are not what they appear. The dashboard dialog offers Also delete all events in this environment, but the server ignores that option: no events are deleted. The dialog also says events are “recoverable for 7 days”, but there is no API to restore a deleted environment. Treat a delete as permanent for the environment record and as a no-op for its events.
Creating, promoting and deleting an environment are recorded in the organisation’s audit log. Updates are not.
There is no cap on the number of environments, and no option to clone one
server-side. Passing isDefault: true on create does not clear the existing
default; use promote to change the default.
Apps
Manage apps in the dashboard under Applications & environments: New application, then rename or delete from each application’s row. The same page lists each application’s workspaces and public ingest tokens.
| Method | Path | Scope |
|---|---|---|
GET | /apps | apps:manage |
POST | /apps | apps:manage |
GET | /apps/{appId} | apps:manage |
PATCH | /apps/{appId} | apps:manage |
DELETE | /apps/{appId} | apps:manage |
An app has a name (1 to 120 characters) and, optionally, repoUrl and
defaultBranch for coding-agent handoff. Listing and creating apps needs a
key that is not bound to an app.
Deleting an app is a soft delete. Credentials and tokens bound to it stop working and ingest into it is refused. The server does not delete events that were already stored, although the dashboard’s confirmation says “everything sent to it” is deleted.
Channels
Channels have no page of their own in the dashboard. Manage them over the API:
| Method | Path | Scope |
|---|---|---|
GET | /apps/{appId}/channels | channels:manage |
POST | /apps/{appId}/channels | channels:manage |
GET | /apps/{appId}/channels/{channelId} | channels:manage |
PUT | /apps/{appId}/channels/{channelId} | channels:manage |
DELETE | /apps/{appId}/channels/{channelId} | channels:manage |
A channel has a name (1 to 120 characters). Deleting a channel is a soft
delete; events sent to it afterwards are rejected. Webhook endpoints are
configured per channel, see Webhooks.
Reading by environment
Environment is a filter, not a partition. Read endpoints take a slug or an ID:
GET /traces?environment=prod
GET /events?environmentId=prod
GET /analytics/timeseries?environment=prodA key bound to an environment always reads only that environment, whatever it
passes. Export destinations are scoped by envSlug, and
alert rules take an environmentId.
Related
- API keys, binding keys to an app and environment
- Public ingest tokens
- API reference: environments, apps, channels