Skip to main content
POST
/
api
/
v1
/
update-margin-mode
Update Margin Mode
curl --request POST \
  --url https://order.trade.rails.xyz/api/v1/update-margin-mode \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "market": "BTC-USD",
  "marginMode": "C"
}
'
{
  "message": "margin mode updated successfully"
}
Use this endpoint only when the market has no open position and no open orders. Close the position and cancel any open orders for the market before changing its margin mode.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
market
string
required

Market name. Example value: BTC-USD. To get all supported markets, call /api/v1/markets endpoint.

marginMode
enum<string>
required

Margin mode to set for the market. C for cross margin, I for isolated margin. Defaults to C if this endpoint is never called for the market.

Available options:
C,
I

Response

message
string
required

A message describing the result of the update margin mode operation.