Skip to main content

Create end-user API key

  • POST /api/v3/accountCenter/apiKey

Weight(IP): 5

Creates an API key for a specified end user. The secret is returned only once upon successful creation and should be stored securely.

Request parameters

ParameterTypeRequired?Description
subUserIdLongYesEnd-user UID.
passphraseStringYesAPI key passphrase. 8-31 characters long. Only letters or numbers are allowed. No spaces or special characters.
authoritiesString[]NoAPI key permissions. Defaults to ACCOUNT_DETAILS if omitted.
ipWhiteListString[]ConditionalIP allowlist (up to 10 entries). Required if any non-read-only permission is enabled.
remarkStringNoAPI key remark.

API key permission enums

PermissionDescription
ACCOUNT_DETAILSRead-only access to account details.
SPOT_TRADINGSpot trading permission.
FUTURES_TRADINGFutures trading permission.
TRANSFERFund transfer permission.
WITHDRAWWithdrawal permission.

Request example

{
"subUserId": 1234567890,
"passphrase": "abc12345",
"authorities": ["ACCOUNT_DETAILS", "TRANSFER"],
"ipWhiteList": ["127.0.0.1"],
"remark": "sub user key"
}

Response parameters

Field nameTypeDescription
subUserIdLongEnd-user UID.
apiKeyStringAPI key.
secretStringSecret key, returned only once upon creation.
authoritiesString[]API key permissions.
ipWhiteListString[]IP allowlist.

Response example

{
"subUserId": 1234567890,
"apiKey": "weex_xxxxxxxxxxxxxxxxxxxxxxxx",
"secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"authorities": ["ACCOUNT_DETAILS", "TRANSFER"],
"ipWhiteList": ["127.0.0.1"]
}