Guides
Guides

Reverse position

Switch an existing position from long to short or vice versa.

Request

curl -X POST "https://trade.mudrex.com/fapi/v1/futures/positions/{position_id}/reverse" \
  -H "Content-Type: application/json" \
  -H "X-Authentication: your-secret-key"

Parameters

ParameterTypeRequiredDescription
position_idstringYesThe unique identifier of the position (path parameter)

Response

Status: 202 Accepted

{
    "success": true,
    "data": {
        "position_id": "01999e74-27a6-76d5-880b-4cab5eac78f1",
        "status": "CREATED",
        "message": "Position reversed successfully"
    }
}

Parameters

ParameterDescription
position_idID of the reversed position
statusStatus of the reversal operation (e.g., CREATED)
messageStatus message

Common errors

Position not in sync with exchange

{
    "success": false,
    "errors": [
        {
            "code": null,
            "text": "position not in sync with exchange"
        }
    ]
}

Status: 400 Bad Request

This error occurs when the position state on the exchange differs from the local state, preventing the reversal operation.