Close all margin positions

post/api/prime/trading/v1/accounts/{accountId}/margin/positions/close

Initiates an asynchronous process to close margin positions by executing market trades to net positions to zero. Unlike 'cover' which transfers assets, 'close' creates trade orders to sell or buy assets. Returns immediately with a request ID that can be used to track progress via the close position requests endpoints.

Path Parameters

  • accountIdstringRequired
    The ID of the account

Request Body

One of
currencies array[string]

202 Response

closePositionsRequestId string <uuid>required
Unique identifier for the close position request
accountId string required
The ID of the account
enterpriseId string required
Enterprise ID associated with the request
status string required
Status of a close position request or order
Allowed values: pending in_progress completed failed
bitgoUserId string required
BitGo user ID who initiated the request
creationDate string <date-time>required
Timestamp when the request was created