Activity and workspaces

Connect your app

Get a publish-only key and the env your application needs to send observations to a workspace, then confirm the first event arrived.

Connecting an application means giving it a key that can only publish, bound to the workspace’s application and one environment, plus the settings to send observations, OpenTelemetry data and (optionally) Sentry errors. There are two ways:

  • Your coding agent does it with the workspaces_connect MCP tool. This is the default, and nobody copies keys from the dashboard.
  • You do it by hand from Settings → Integrations.

Connect after the workspace spec is active, or at least drafted. Observations sent before activation are stored, but nothing is projected until a spec with entities is active.

With your coding agent

Settings → Integrations → Send observations shows a prompt for the current workspace and environment. Paste it into your agent (Claude Code, Codex, Cursor or any MCP client connected to axonpush). The agent then:

  1. Calls workspaces_connect for the workspace, optionally with an environment and a purpose.
  2. Gets back the env to write and a one-time claim link in place of the key. An agent signed in over MCP never sees the secret: the key, and the Sentry DSN when one was minted, are replaced by a placeholder such as <claim: open https://app.axonpush.xyz/claim/key/...>.
  3. Writes the non-secret values to the app’s git-ignored env file (.env.local, or whatever secret convention the project already uses) and asks you to open the link.
  4. Adds observe and identify calls, sends one test event and checks it in workspaces_catalog.

Open the claim link while signed in as the person whose agent asked for it. The Your API key page shows the key once with a ready-to-copy .env snippet (AXONPUSH_API_KEY, plus SENTRY_DSN when available). Paste it into the same git-ignored env file, then choose I have saved it.

A claim link works once and expires after 30 minutes. A used or expired link shows This link has been used or has expired; ask your agent to call connect again with rotate: true, or create a key yourself. A link opened by a different account shows We could not find this key.

By hand in the dashboard

  1. Open Settings → Integrations. Step 2, Send observations, targets the workspace and environment selected in the top bar.
  2. Expand Set up by hand. It shows the Workspace id, Environment and API base.
  3. Choose Create a publish key. The key appears once as Publish key (shown once). It can only send observations and events, so keep it on your server.
  4. Copy the Environment variables snippet and the Python or TypeScript snippet into your app.

You can also create a key with only events:publish under API keys. Unlike workspaces_connect, a key created by hand is not bound to the workspace’s application and environment unless you bind it when you create it.

What connect returns

POST /workspaces/{workspaceId}/connect takes an optional body:

FieldMeaning
environmentEnvironment slug or id. Defaults to the organisation’s default environment, else the production one
purposeSeparates keys for different processes of one app, such as web or worker. Lowercase letters, digits, - and _, up to 40 characters. Defaults to default
rotateRevoke this environment and purpose’s existing connect key and mint a new one

The response has:

  • publishKey: id, name, start (the first characters, to recognise it), scopes (always ["events:publish"]), createdAt, and key only when this call minted it for a dashboard or API-key caller.
  • apiUrl, workspaceId, environment (the slug) and purpose.
  • created: true when this call minted a new key. revokedKeyIds lists keys that rotate revoked.
  • otlp: endpoint, tracesEndpoint, logsEndpoint and header for an OpenTelemetry exporter. The header is x-axonpush-api-key=<key>.
  • sentryDsn, or sentryDsnUnavailable with the reason it is missing (for example Sentry-compatible ingest is off on this server).
  • env: the variables to write: AXONPUSH_API_KEY, AXONPUSH_BASE_URL, AXONPUSH_WORKSPACE_ID, AXONPUSH_ENVIRONMENT, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS and SENTRY_DSN when there is one. Secret values are present only when the key was minted in this response.
  • sdk: short Python and TypeScript snippets.
  • claim: for agents, the one-time link (url, expiresAt, envName).
  • hint and warnings: what to do next, and anything that went wrong (such as an old key that could not be revoked).
# A key with workspaces:manage, not the app's publish key
curl -X POST "https://api.axonpush.xyz/workspaces/$WORKSPACE_ID/connect" \
-H "X-API-Key: $AXONPUSH_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{ "environment": "production", "purpose": "worker" }'

Calling connect again

Calling connect again for the same workspace, environment and purpose does not mint another key. It returns the existing key’s metadata without the secret, with a hint. If the app already has AXONPUSH_API_KEY, keep it. If the secret was lost, call again with rotate: true: the old key (and its Sentry token) is revoked and a new one is minted.

Who can call it

Connect needs an organisation owner or admin session, or an API key with workspaces:manage. A signed-in user (in the dashboard or through an agent) must have a verified email, and a credential restricted by a data access grant is refused. Each call is recorded in the audit log as workspace.connect or workspace.connect.rotate, with the client that called it. If the server has no key minting configured (some self-hosted setups), connect answers 503 and asks you to create a publish key in the dashboard instead.

Confirm data is arriving

After the first observation:

  • workspaces_catalog lists the event with its count, refs and attribute keys, and flags keys the dictionary does not declare.
  • Activity → Health shows Last received and the projection lag. See Queue, Insights and Health.
  • GET /workspaces/{workspaceId}/observations/{sourceEventId} reports whether one observation was stored and projected (observations.receipt).

Errors and traces

observe reports business facts. It does not capture exceptions. To get real tracebacks and source locations next to your observations, wire your app’s existing OpenTelemetry or Sentry integration with the otlp and sentryDsn values connect returned. See Sentry, Send data and Traces. Pass trace_id and span_id on observations to link them to their traces.