Skip to main content
POST
Close all positions across accounts

Authorizations

X-API-Key
string
header
required

Organization API key. Format: "hp_live_{key}". Organization admins manage the key in the dashboard.

Body

application/json
reason
string
required

Why the positions are being closed. Recorded on every resulting order and on each affected account's event log.

Required string length: 3 - 200
Example:

"Market data outage — closing all exposure"

allAccounts
enum<boolean>

Close positions on every tradable account of your organization (not started or in progress). Send this or accountIds, not both.

Available options:
true
Example:

true

accountIds
string[]

Close positions on these accounts of your organization, whatever their status (1 to 5,000; duplicates are ignored). Send this or allAccounts, not both.

Required array length: 1 - 5000 elements
Example:
preview
boolean
default:false

When true, only report how many accounts the run would cover. Nothing is closed.

Response

Preview - How many accounts the run would cover (only with preview: true)

success
boolean
Example:

true

data
object