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
- Master Account Only: This endpoint can only be called using the API Key of a Master Account.
- Security: The response returns the
apiKey(public key) but does not return thesecretKey. 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
| Parameter | Type | Description |
|---|---|---|
| data | Array | List of API Key details. |
| -userCode | String | The login ID of the sub-account. |
| -nickName | String | The alias/name of the sub-account. |
| -apiRemark | String | The remark/label assigned to this API Key. |
| -apiKey | String | The API Key (Public Key) string. |
| -createdAt | Long | The timestamp of when the API Key was created (Unix timestamp in ms). |
| -spotTradeFlag | Integer | Spot Trading Permission. 1: Enabled 0: Disabled |
| -contractTradeFlag | Integer | Futures Trading Permission. 1: Enabled 0: Disabled |
| -readonlyFlag | Integer | Read-Only Permission. 1: Read-Only (Enabled) 0: Read-Write (Disabled) |
| -apiWhiteListFlag | Integer | IP Whitelist Switch Status. 1: Enabled 0: Disabled |
| -apiWhiteList | String | The 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
}