Operator Api
API keys
Manage operator API keys through the operator API.
API keys
Manage operator API keys used by backend services.
Endpoints
| Method and path | Required scope | Parameters |
|---|---|---|
GET /api/operator/api-keys | api_keys:read | No query parameters or body. |
POST /api/operator/api-keys | api_keys:write | JSON body documented below. |
POST /api/operator/api-keys/{id}/revoke | api_keys:write | id is a required positive API key ID. No body. |
Create request
{
"name": "backend-prod",
"scopes": ["launch:write", "users:read", "markets:read", "trades:read"]
}
| Field | Type | Requirement | Notes |
|---|---|---|---|
name | string | Required | Non-empty after trimming. |
scopes | string | Required | Non-empty. Every scope must be valid and assignable by the caller. |
Create response
tokenis returned once.- The token has exactly three dot-separated parts:
pma.<key-id>.<secret>. key_prefixcontainspma.plus the first eight key-id characters for operator recognition; it is not an authentication credential.
{
"item": {
"id": 1,
"name": "backend-prod",
"key_id": "<opaque-key-id>",
"key_prefix": "pma.<first-8-key-id-chars>",
"scopes": ["launch:write", "users:read", "markets:read"],
"last4": "abcd",
"revoked_at": null,
"created_at": "2026-06-18T00:00:00.000Z",
"updated_at": "2026-06-18T00:00:00.000Z"
},
"token": "pma.<key-id>.<secret>"
}
List response fields
idnamekey_idkey_prefixscopeslast4last_used_atlast_used_iplast_used_user_agentrevoked_atcreated_atupdated_at
Rules
["*"]grants full scope.- Only a caller that already has
*may create a key with*. - A non-wildcard caller may assign only scopes it already has.
- API key scopes can include
markets:write,wallet_adapter:read, andwallet_adapter:write. - API key scopes cannot include
staffs:readorstaffs:write; staff management requires a staff session. - Invalid scopes ->
400 INVALID_SCOPES - Empty name ->
400 INVALID_NAME - Unknown revoke target ->
404 NOT_FOUND - Raw token must never be persisted outside secret storage.
