Upscale
Menu
On this page

Close all positions

Try it out ↓
POST/positions/{accountId}/close-all
Close all positionsTrading

Closes every open position of the account at market. Stop and take orders attached to them end up as canceled_by_position; pending entry orders are left alone.

Responds 204 with no body.

Base URL https://api.upscale.trade

Authorization

bearerhttp · bearerrequired

Personal API key, prefixed with usk_.

Parameters

Path
accountIdstring · uuidrequired

Trader account identifier. Must belong to the caller.

Example: 00000000-0000-4000-8000-000000000000

Examples

curl --request POST 'https://api.upscale.trade/positions/{accountId}/close-all' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Responses

401

Unauthorized

403

The account belongs to another user (account_access_denied), or the request is authenticated with an API key while api_trading is disabled on the account (api_trading_not_enabled).

404

No account with this identifier.

429

Rate limit of the API key exceeded (api_key_rate_limit_exceeded). Retry-After says when to come back; the body carries the bucket (read / write), the window that tripped, its limit and retryAt.