Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

The session token of a Lean user who is signed in, sent as Authorization: Bearer <token>. Only the API key endpoints accept it, and an API key cannot create or revoke keys.

Body

application/json
name
string
required
Required string length: 1 - 80
tradingAccountId
string<uuid>
required
scopes
enum<string>[]
required
Minimum array length: 1
Available options:
read,
trade,
route,
withdraw
maxOrderNotionalMicros
integer
required
Required range: 0 < x <= 9007199254740991
dailyNotionalLimitMicros
integer
required
Required range: 0 < x <= 9007199254740991
expiresInDays
integer
required
Required range: 1 <= x <= 90
mode
enum<string>
default:test
Available options:
test,
live
maxWithdrawalMicros
integer
Required range: 0 < x <= 9007199254740991
dailyWithdrawalLimitMicros
integer
Required range: 0 < x <= 9007199254740991

Response

The new key and its secret, shown once

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required