Skip to main content

Create Sub UID API Key

To create new API key for those newly created sub UID. Use master user's api key only.

tip

The API key must have one of the below permissions in order to call this endpoint..

  • master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"

HTTP Request

POST /v5/user/create-sub-api

Request Parameters

ParameterRequiredTypeComments
subuidtrueintegerSub user Id
notefalsestringSet a remark
readOnlytrueinteger0:Read and Write. 1:Read only
ipsfalsestringSet the IP bind. example: "192.168.0.1,192.168.0.2"note:
  • don't pass ips or pass with "*" means no bind
  • No ip bound api key will be invalid after 90 days
  • api key without IP bound will be invalid after 7 days once the account password is changed
permissionstrueObjectTick the types of permission.
  • one of below types must be passed, otherwise the error is thrown
> ContractTradefalsearrayContract Trade. ["Order","Position"]
> SpotfalsearraySpot Trade. ["SpotTrade"]
> WalletfalsearrayWallet. ["AccountTransfer","SubMemberTransferList"]
> OptionsfalsearrayUSDC Contract. ["OptionsTrade"]
> DerivativesfalsearrayThis param is depreciated because system will automatically add this permission according to your account is UTA or Classic
> ExchangefalsearrayExchange. ["ExchangeHistory"]
> CopyTradingfalsearrayCopytrade. ["CopyTrading"]

Response Parameters

ParameterTypeComments
idstringUnique id. Internal used
notestringThe remark
apiKeystringApi key
readOnlyinteger0:Read and Write. 1:Read only
secretstringThe secret paired with api key.
  • The secret can't be queried by GET api. Please keep it properly
permissionsObjectThe types of permission
> ContractTradearrayPermisson of contract trade
> SpotarrayPermisson of spot
> WalletarrayPermisson of wallet
> OptionsarrayPermission of USDC Contract. It supports trade option and usdc perpetual.
> DerivativesarrayPermission of Unified account
> CopyTradingarrayPermission of copytrade
> BlockTradearrayPermission of blocktrade. Not applicable to sub account, always []
> ExchangearrayPermission of exchange
> NFTarrayPermission of NFT. Not applicable to sub account, always []

Request Example

POST /v5/user/create-sub-api HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1676430005459
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"subuid": 53888000,
"note": "testxxx",
"readOnly": 0,
"permissions": {
"Wallet": [
"AccountTransfer"
]
}
}

Response Example

{
"retCode": 0,
"retMsg": "",
"result": {
"id": "16651283",
"note": "testxxx",
"apiKey": "xxxxx",
"readOnly": 0,
"secret": "xxxxxxxx",
"permissions": {
"ContractTrade": [],
"Spot": [],
"Wallet": [
"AccountTransfer"
],
"Options": [],
"CopyTrading": [],
"BlockTrade": [],
"Exchange": [],
"NFT": []
}
},
"retExtInfo": {},
"time": 1676430007643
}