Send data

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 prod covers 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:

ResourceNameNotes
AppDefaultWith one channel named default. Events with no channel go here.
Environmentdev (Development)The default environment. Unbound credentials write here.
Environmentstaging (Staging)
Environmentprod (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.

EndpointApp and channelEnvironment
POST /event, POST /events/batchToken’s channel, else channel_id in the body, else the key’s app default channel, else the org default channelThe 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/logsToken’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 endpointsThe DSN token’s channelThe DSN token’s environment. The environment set in the Sentry SDK is kept as an attribute only.
Workspace observationsThe workspace’s appenvironment 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.

MethodPathWho
GET/environmentsAny member, or a key with observe:read
POST/environmentsOwner or admin, dashboard session only
PATCH/environments/{slug}Owner or admin, dashboard session only
POST/environments/{slug}/promoteOwner 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 slug is 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-9 and -, starting and ending with a letter or digit, and must not start with axonpush-. Otherwise 422.
  • A slug already used in the organisation is 409.
  • isProduction defaults to true only for the slugs prod and production.
  • color defaults to #6366f1.
  • isDefault: true makes the new environment the org default and clears the flag on the previous default, as promote does.

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.

MethodPathScope
GET/appsapps:manage
POST/appsapps: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:

MethodPathScope
GET/apps/{appId}/channelschannels:manage
POST/apps/{appId}/channelschannels: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=prod

A 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.