Skip to main content
POST
Close a specific position by contract

Authorizations

Authorization
string
header
required

A Hyperprop session token, the partner session token returned by POST /trade/partner/session, or the personal API key session token returned by POST /trade/api-keys/session.

Body

application/json

Close position request

account_id
string<uuid>
required

UUID of the account

Example:

"550e8400-e29b-41d4-a716-446655440000"

contract
string
required

Contract symbol to close (e.g., "ESH6")

Example:

"ESH6"

quantity
integer<int32> | null

How much to close, in the same units as order quantities. Omit to close the whole position. A partial close keeps the rest of the position and its TP/SL, which shrink to the size still open; it never opens a position in the other direction. Must be at least 1 and no more than the open quantity.

Required range: x >= 0
Example:

1

Response

Close-position command accepted

accepted
boolean
required
command_id
string<uuid>
required
command_type
string
required
status
string
required