Create Sub-account API Key (For Master Account) (TRADE)
API Description
Create a new API Key for a sub-account.
HTTP Request
POST /sapi/v1/sub-account/subAccountApi
Request Weight(UID)
3000
Request Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| STRING | YES | Sub-account email | |
| apiName | STRING | YES | API Key name |
| status | INTEGER | YES | IP restriction status. 1 = unrestricted, 2 = restricted to trusted IPs, 3 = third-party IP restriction |
| canTrade | BOOLEAN | NO | Spot & Margin trading permission, default false |
| canMarginLoanRepay | BOOLEAN | NO | Margin borrow/repay permission, default false |
| canFuturesTrade | BOOLEAN | NO | Futures trading permission, default false |
| canUniversalTransfer | BOOLEAN | NO | Universal transfer permission, default false |
| canVanillaOptions | BOOLEAN | NO | Vanilla options permission, default false |
| ipAddress | STRING | NO | Required when status=2. IP address list, max 500 chars |
| thirdPartyName | STRING | NO | Required when status=3. Third-party name |
| publicKey | STRING | NO | Ed25519 public key (optional, for Ed25519 type API Key) |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
status=2requiresipAddressstatus=3requiresthirdPartyName- Asset Sub Account is not supported
- The caller must pass the KYC IP restriction check
Response Example
{
"apiName": "myKey",
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"secretKey": "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j",
"canTrade": true,
"canMarginLoanRepay": false,
"canFuturesTrade": false,
"canUniversalTransfer": false,
"canVanillaOptions": false,
"status": 2,
"ipList": [
"192.168.1.1",
"10.0.0.1"
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| apiName | STRING | API Key name |
| apiKey | STRING | API Key (public key) |
| secretKey | STRING | Secret Key. Returned only once on creation, please keep it safe |
| canTrade | BOOLEAN | Spot & Margin trading permission |
| canMarginLoanRepay | BOOLEAN | Margin borrow/repay permission |
| canFuturesTrade | BOOLEAN | Futures trading permission |
| canUniversalTransfer | BOOLEAN | Universal transfer permission |
| canVanillaOptions | BOOLEAN | Vanilla options permission |
| status | INTEGER | IP restriction status. 1 = unrestricted, 2 = restricted to trusted IPs, 3 = third-party IP restriction |
| ipList | ARRAY | IP list (IP addresses when status=2; third-party names when status=3) |