Create API key for User
HTTP Request
POST /v1/api-key/create
Header
Authorization: Bearer {access_token}
Request Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
apiName | STRING | YES | custom api name, can be repeated |
enableTrade | BOOLEAN | YES | true or false |
enableFutureTrade | BOOLEAN | YES | true or false |
enableMargin | BOOLEAN | NO | true or false . If it's not sent or the user doesn't have Margin account, it will be false by default. |
enableEuropeanOptions | BOOLEAN | NO | true or false . If it's not sent or the user doesn't have Options account, it will be false by default. |
status | ENUM | NO | 1 or null = Access IP unrestricted, 2 = Trusted IPs only, 3 = Trusted Third Party IPs only. If you want to enable any Trade permission(including Spot, Margin or Futures), you must restrict the IP access. |
ipAddress | STRING | NO | Trusted IPs. Can be added in batches, separated by commas. Max 30 for an API key |
thirdPartyName | STRING | NO | Third party name must match the name in the server side. |
publicKey | STRING | YES | Your custom public key. The server side will use it to encrypt the apikey, and client decrypts with a private key. Use RSA algorithm, the keysize is customized with client, usually 1024 or 2048 (Reference). |
Response Example
{
"code": "000000",
"message": null,
"data": {
"apiKey": "ZN02rGiWOE6*****yjOZg==",
"apiName": "testoauth1",
"secretKey": "rH1cO1374UhZXfn2*********3EJjg/JT6gg==",
"enableTrade": true,
"enableFutureTrade": true,
"enableMargin": false,
"enableEuropeanOptions": true,
"createTime": 1717746281067
},
"success": true
}