Skip to main content

Set Auto Add Margin

Turn on/off auto-add-margin for isolated margin position

HTTP Request

POST /v5/position/set-auto-add-margin

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear (USDT Perps, USDC Contract)
  • Classic account: linear (USDT Perps)
symboltruestringSymbol name, like BTCUSDT, uppercase only
autoAddMargintrueintegerTurn on/off. 0: off. 1: on
positionIdxfalseintegerUsed to identify positions in different position modes. For hedge mode position, this param is required
  • 0: one-way mode
  • 1: hedge-mode Buy side
  • 2: hedge-mode Sell side

Response Parameters

None


Request Example

POST /v5/position/set-auto-add-margin HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN-TYPE: 2
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1675255134857
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"category": "linear",
"symbol": "BTCUSDT",
"autoAddmargin": 1,
"positionIdx": null
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {},
"retExtInfo": {},
"time": 1675255135069
}