API referenceApi keys
POST /organization/api-keys
Create an API key for the active organisation (organisation admins only). Scopes are limited to events:publish, events:read and observe:read. When an agent calls this, the key is never returned: the result has a claim link that the signed-in user opens in the dashboard to reveal the key once (valid 30 minutes). Ask the user to open it and put the key in the app's git-ignored env file as AXONPUSH_API_KEY.
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/organization/api-keys" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "scopes": [ "string" ] }'{ "$schema": "https://example.com/schemas/CreatedKey.json", "claim": { "envName": "string", "expiresAt": "2019-08-24T14:15:22Z", "url": "string" }, "id": "string", "key": "string", "name": "string", "scopes": [ "string" ]}appId?string
Bind the key to one application
environmentId?string
Bind the key to one environment
name*string
Length
1 <= length <= 128scopes*array<string>|
Any of events:publish, events:read, observe:read
Items
1 <= items