API referenceWorkspaces

POST /workspaces/{workspaceId}/connect SDK setup

Get everything the application needs to send data to this workspace, so nobody copies keys from the dashboard. Call it after the workspace spec is active (or at least drafted). It mints a key that can only publish (events:publish), bound to this workspace's application and one environment, and returns it once with the API URL, OTLP settings, a Sentry DSN when available, a ready-to-write env map and SDK snippets. When an agent calls it, the key and DSN are never returned: the result carries claim, a one-time link (valid 30 minutes) the signed-in user opens in the dashboard to reveal them, and the secret env values are placeholders. Ask the user to open the link and put the key into the app's git-ignored env file as AXONPUSH_API_KEY (and SENTRY_DSN if shown). Write the returned env into the app's local secret file (for example .env.local, or the project's existing secret convention), make sure that file is git-ignored, and never commit, print or paste the key. Then add the SDK observe and identify calls and send a test event. Also wire the application's existing logging, OpenTelemetry or Sentry error integration so exceptions retain their original traceback and source locations; business observations alone do not install exception capture. Reuse the existing provider and capture policy, correlate trace/span ids where available, and verify a controlled exception locally or in a test environment. Do not create synthetic production errors. Calling it again for the same environment and purpose does not mint another key: it returns the existing key's metadata without the secret. If the secret was lost, call again with rotate: true, which revokes the old key and mints a new one.

POST
/workspaces/{workspaceId}/connect

Path Parameters

workspaceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/workspaces/string/connect" \  -H "Content-Type: application/json" \  -d '{}'
{  "$schema": "https://example.com/schemas/ActivityConnectResult.json",  "apiUrl": "string",  "claim": {    "envName": "string",    "expiresAt": "2019-08-24T14:15:22Z",    "url": "string"  },  "created": true,  "env": {    "property1": "string",    "property2": "string"  },  "environment": "string",  "hint": "string",  "otlp": {    "endpoint": "string",    "header": "string",    "logsEndpoint": "string",    "tracesEndpoint": "string"  },  "publishKey": {    "createdAt": "string",    "id": "string",    "key": "string",    "name": "string",    "scopes": [      "string"    ],    "start": "string"  },  "purpose": "string",  "revokedKeyIds": [    "string"  ],  "sdk": {    "python": "string",    "typescript": "string"  },  "sentryDsn": "string",  "sentryDsnUnavailable": "string",  "warnings": [    "string"  ],  "workspaceId": "string"}