Skip to main content

Modify Sub API Key

Modify the settings of sub api key. Use the sub account api key pending to be modified to call the endpoint or use master account api key to manage its sub account api key.

tip

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

  • sub API key: "Account Transfer", "Sub Member Transfer"
  • master API Key: "Account Transfer", "Sub Member Transfer", "Withdrawal"

HTTP Request

POST /v5/user/update-sub-api

Request Parameters

ParameterRequiredTypeComments
apikeyfalsestringSub account api key
  • You must pass this param when you use master account manage sub account api key settings
  • If you use corresponding sub uid api key call this endpoint, apikey param cannot be passed, otherwise throwing an error
readOnlyfalseinteger0 (default):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 will be invalid after 7 days once the account password is changed
permissionsfalseObjectTick the types of permission. Don't send this param if you don't want to change the permission
> ContractTradefalsearrayContract Trade. ["Order","Position"]
> SpotfalsearraySpot Trade. ["SpotTrade"]
> WalletfalsearrayWallet. ["AccountTransfer", "SubMemberTransferList"]
> OptionsfalsearrayUSDC Contract. ["OptionsTrade"]
> DerivativesfalsearrayThis param is deprecated 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
secretstringAlways ""
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 []
ipsarrayIP bound

Request Example

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

{
"readOnly": 0,
"ips": "*",
"permissions": {
"ContractTrade": [],
"Spot": [
"SpotTrade"
],
"Wallet": [
"AccountTransfer"
],
"Options": [],
"CopyTrading": [],
"BlockTrade": [],
"Exchange": [],
"NFT": []
}
}

Response Example

{
"retCode": 0,
"retMsg": "",
"result": {
"id": "16651472",
"note": "testxxx",
"apiKey": "xxxxxx",
"readOnly": 0,
"secret": "",
"permissions": {
"ContractTrade": [],
"Spot": [
"SpotTrade"
],
"Wallet": [
"AccountTransfer"
],
"Options": [],
"Derivatives": [],
"CopyTrading": [],
"BlockTrade": [],
"Exchange": [],
"NFT": []
},
"ips": [
"*"
]
},
"retExtInfo": {},
"time": 1676431796263
}