Skip to main content

Get Sub-Account API Keys

API Description

This interface allows the Master Account to query the API Key information for its sub-accounts, including permission settings, IP whitelist status, and key creation time.

Note: Get Sub-Account API Keys is only available via RESTful API.

Precautions

  1. Master Account Only: This endpoint can only be called using the API Key of a Master Account.
  2. Security: The response returns the apiKey (public key) but does not return the secretKey. The secret key is only visible for one hour at the time of creation.

Authentication

This is a Private interface. It requires authentication using the Master Account's API Key and Secret Key. For details on signature generation, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.

Request Method

POST

Endpoint

/api/v1/private?command=subAccount_apikey

Frequency Limit

The frequency limit for this interface is 3 requests/s per user ID. For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section here.

Request Parameters

This interface does not require request parameters.

Response Parameters

ParameterTypeDescription
dataArrayList of API Key details.
-userCodeStringThe login ID of the sub-account.
-nickNameStringThe alias/name of the sub-account.
-apiRemarkStringThe remark/label assigned to this API Key.
-apiKeyStringThe API Key (Public Key) string.
-createdAtLongThe timestamp of when the API Key was created (Unix timestamp in ms).
-spotTradeFlagIntegerSpot Trading Permission.
1: Enabled
0: Disabled
-contractTradeFlagIntegerFutures Trading Permission.
1: Enabled
0: Disabled
-readonlyFlagIntegerRead-Only Permission.
1: Read-Only (Enabled)
0: Read-Write (Disabled)
-apiWhiteListFlagIntegerIP Whitelist Switch Status.
1: Enabled
0: Disabled
-apiWhiteListStringThe list of bound IP addresses (or * for all).

Request Example

The following Python code shows how to get the sub-account API key list.

Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.

api_url = "/api/v1/private?command=subAccount_apikey"
method = "POST"
params = {}

SpotRestfulPrivate(host, api_url, method, api_key, params, secret_key) # function SpotRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface)

Response Example

The following is an example response returned by the above request:

{
"code": "200",
"data": [
{
"userCode": "423005***",
"nickName": "SubAccount01",
"apiRemark": "01",
"createdAt": 1753774404000,
"apiKey": "43******************ad3da4403869",
"spotTradeFlag": 0,
"contractTradeFlag": 0,
"readonlyFlag": 1,
"apiWhiteListFlag": 0,
"apiWhiteList": "*"
}
],
"msg": "SUCCESS",
"success": true,
"failed": false
}