v1

latestOpenAPI 3.0.32026-07-267278168.1 KB
Positions

Set Leverage

Sets the leverage for a market. Leverage must be a positive integer and cannot exceed the market's maximum leverage. Reducing leverage while insufficient margin is available will return 400 with error_code=insufficient_margin. For how leverage and margin work, see Leverage.

post/v1/perps/leverage

Request body

marketstring required

Perps market to set leverage for

leveragestring required

New leverage value. Must be a positive integer not exceeding the market maximum.

Example request

{
  "market": "AAPL-USD.P",
  "leverage": "10"
}

Response

Leverage updated successfully

successboolean required

Whether the request was successful

errorstring

Error message, present only on failure

error_codestring

Semantic error code. See each endpoint's error responses for the specific codes it can return.

deprecatedstring

Deprecation notice, if applicable

Example response

{
  "success": true
}