Skip to main content

Modify Master API Key

Modify the settings of master api key. Use the api key pending to be modified to call the endpoint. 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"
info

Only the api key that calls this interface can be modified

HTTP Request

POST /v5/user/update-api

Request Parameters

ParameterRequiredTypeComments
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","SubMemberTransfer"]
> OptionsfalsearrayUSDC Contract. ["OptionsTrade"]
> DerivativesfalsearrayThis param is deprecated because system will automatically add this permission according to your account is UTA or Classic
> CopyTradingfalsearrayCopytrade. ["CopyTrading"]
> BlockTradefalsearrayBlocktrade. ["BlockTrade"]
> ExchangefalsearrayExchange. ["ExchangeHistory"]
> NFTfalsearrayNFT. ["NFTQueryProductList"]
> AffiliatefalsearrayAffiliate. ["Affiliate"]
  • This permission is only useful for affiliate
  • If you need this permission, make sure you remove all other permissions

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. Not applicable to sub account, always []
> 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-api HTTP/1.1
Host: api.bybit.com
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1676431264739
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXXX
Content-Type: application/json

{
"readOnly": null,
"ips": "*",
"permissions": {
"ContractTrade": [
"Order",
"Position"
],
"Spot": [
"SpotTrade"
],
"Wallet": [
"AccountTransfer",
"SubMemberTransfer"
],
"Options": [
"OptionsTrade"
],
"CopyTrading": [
"CopyTrading"
],
"BlockTrade": [],
"Exchange": [
"ExchangeHistory"
],
"NFT": [
"NFTQueryProductList"
]
}
}

Response Example

{
"retCode": 0,
"retMsg": "",
"result": {
"id": "13770661",
"note": "xxxxx",
"apiKey": "xxxxx",
"readOnly": 0,
"secret": "",
"permissions": {
"ContractTrade": [
"Order",
"Position"
],
"Spot": [
"SpotTrade"
],
"Wallet": [
"AccountTransfer",
"SubMemberTransfer"
],
"Options": [
"OptionsTrade"
],
"Derivatives": [
"DerivativesTrade"
],
"CopyTrading": [
"CopyTrading"
],
"BlockTrade": [],
"Exchange": [
"ExchangeHistory"
],
"NFT": [
"NFTQueryProductList"
]
},
"ips": [
"*"
]
},
"retExtInfo": {},
"time": 1676431265427
}