Skip to main content
POST
cURL

Authorizations

X-Monaco-Signature
string
header
required

Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.

Body

application/json
tradingPairId
string<uuid> | null

Optional trading-pair filter. When set, only open positions on this trading pair are closed; otherwise every open position is closed. Cannot be combined with trading_pair_ids.

slippageToleranceBps
integer<int32> | null

Optional slippage tolerance (basis points) applied to each MARKET close.

tradingPairIds
string<uuid>[] | null

Optional set of trading-pair UUIDs, at most 256. When non-empty, only open positions on one of these pairs are closed. An empty or omitted list applies no pair filter, so every open position is closed. Duplicate ids are ignored, and an id that matches no open position closes nothing. Cannot be combined with trading_pair_id. Delegated sessions must pass trading_pair_id or a non-empty trading_pair_ids.

Maximum array length: 256
Minimum string length: 1
side
string | null

Optional side filter: LONG or SHORT (case-insensitive). When set, only open positions on that side are closed. It applies on top of the pair filter, and on its own does not meet the delegated-session pair requirement.

Response

OK

totalRequested
integer<int32> | null

Number of open positions the batch attempted to close.

totalClosed
integer<int32> | null

Number of positions whose close order was accepted by the matching engine (SUCCESS, PARTIAL, or PENDING).

totalFailed
integer<int32> | null

Number of positions whose close failed (validation, lookup, or a rejected close order).

results
object[] | null