Positions

Delete a position within an account for an instrument.

Retrieves orders generated to close the position.

delete/v1/accounts/{account_id}/positions/{instrument_id}

Request

  • Base URL
    https://api.clearstreet.com
  • Auth
    HTTP bearer

Path parameters

account_idinteger required

Account identifier

instrument_idstring required

Instrument identifier: either an instrument UUID or a symbol (symbol for equities, OSI for options). Non-UUID inputs are resolved server-side.

Instrument ID (UUID) or symbol (equity ticker or OSI option symbol).

Request body

cancel_ordersboolean nullable

Whether to cancel existing open orders for the position before submitting closing orders.

Example request

{
  "cancel_orders": false
}

Response

List of orders generated to close the position.

Example response

{
  "error": {
    "code": 400,
    "message": "Order quantity must be greater than zero"
  },
  "metadata": {
    "page_number": 1,
    "total_items": 42,
    "total_pages": 5
  },
  "data": [
    {
      "account_id": 19816,
      "client_order_id": "my-ref-id-20251001-001",
      "created_at": "2025-10-31T13:30:00.000000000Z",
      "extended_hours": false,
      "filled_quantity": "0",
      "id": "0195f6c7-4f64-7e3c-8b0a-1d8e4f5e6a7b",
      "instrument_id": "d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab",
      "instrument_type": "COMMON_STOCK",
      "leaves_quantity": "1",
      "limit_price": "48.00",
      "order_type": "LIMIT",
      "quantity": "1",
      "side": "BUY",
      "status": "PENDING_NEW",
      "stop_price": null,
      "symbol": "TSLA",
      "time_in_force": "DAY",
      "updated_at": "2025-10-31T13:30:00.000000000Z",
      "venue": "XNAS"
    }
  ]
}

Changes

    • warning

      removed the optional property /// from the response with the status

    • breaking

      for the path request parameter instrument_id, the minLength was increased from 0 to 1

    • warning

      added the new AT_CLOSE enum value to the /// response property for the response status

    • warning

      added the new AT_OPEN enum value to the /// response property for the response status

    • warning

      added the new PENDING_TRIGGER enum value to the /// response property for the response status

    • warning

      added the new QUEUED enum value to the /// response property for the response status

    • info

      for the path request parameter instrument_id, the type was generalized from no type to string

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      removed the AT_CROSSING enum value from the /// response property for the response status

    • info

      removed the AT_THE_CLOSE enum value from the /// response property for the response status

    • info

      removed the AT_THE_OPENING enum value from the /// response property for the response status

    • info

      removed the GOOD_THROUGH_CROSSING enum value from the /// response property for the response status

    • info

      removed the GOOD_TILL_CROSSING enum value from the /// response property for the response status

    • info

      removed the OTHER enum value from the /// response property for the response status

    • info

      removed the SELL_SHORT enum value from the /// response property for the response status