Skip to content

create_trading_token

POST
/admin/trading-tokens
curl --request POST \
--url http://localhost:3001/admin/trading-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"label":null,"portfolio_id":"00000000-0000-0000-0000-000000000000","principal_id":"00000000-0000-0000-0000-000000000000"}'
Media typeapplication/json
object
label

Human label for this key (shown in the token list). Optional.

string
nullable
portfolio_id

Optionally entitle the principal to trade this portfolio (adds a can_trade grant). Omit if the principal is already granted, or to grant separately.

string format: uuid
nullable
principal_id
required

Mint the token under this existing principal (the trader/strategy/service it belongs to). Create principals on the Principals admin surface first.

string format: uuid

Example generated

{
"label": "example",
"portfolio_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"principal_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Created — single bearer token included once

Media typeapplication/json
object
key_id
required
string
label
string
nullable
portfolio_id
string format: uuid
nullable
principal_id
required
string format: uuid
token
required

The single bearer token — Authorization: Bearer <token>. Shown once.

string

Example generated

{
"key_id": "example",
"label": "example",
"portfolio_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"principal_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"token": "example"
}

Auto-provision needs an active broker connection