> ## Documentation Index
> Fetch the complete documentation index at: https://tickblaze.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List positions across accessible accounts

> Returns positions for trading accounts the caller can access, filtered by state.
Staff users can see every account in the firm, while non-staff users only see their own accounts.

`date_from` / `date_to` are coarse date filters. For timestamp-level windows, use `opened_at_after` / `opened_at_before` with `state=OPEN` or `closed_at_after` / `closed_at_before` with `state=CLOSED`.

Default state is OPEN. Results are ordered by open_time DESC then id DESC for OPEN positions, and close_time DESC then open_time DESC for CLOSED positions.



## OpenAPI

````yaml /openapi.json get /api/trade/positions/
openapi: 3.0.3
info:
  title: TBBO API
  version: 1.0.0
  description: >
    Authentication uses short-lived session tokens (3 hours).


    Send the token with every request using the `Authorization` header:


    ```

    Authorization: Token <token>

    ```


    Example:


    ```

    Authorization: Token 123abc456def789

    ```


    To obtain a token, call `POST /auth/login/` with valid credentials. The
    response includes a `key` value. Use that value in the header above for
    subsequent API calls.


    How to find required IDs:


    - `challenge_id`: Prop Tech Configuration -> Challenges

    - `user_id`: Tickblaze Manager -> Users

    - `account_id`: Tickblaze Manager -> Accounts 
servers: []
security: []
tags:
  - name: withdrawals
    description: Withdrawal related endpoints
    x-displayName: Withdrawals
paths:
  /api/trade/positions/:
    get:
      tags:
        - Trade
      summary: List positions across accessible accounts
      description: >-
        Returns positions for trading accounts the caller can access, filtered
        by state.

        Staff users can see every account in the firm, while non-staff users
        only see their own accounts.


        `date_from` / `date_to` are coarse date filters. For timestamp-level
        windows, use `opened_at_after` / `opened_at_before` with `state=OPEN` or
        `closed_at_after` / `closed_at_before` with `state=CLOSED`.


        Default state is OPEN. Results are ordered by open_time DESC then id
        DESC for OPEN positions, and close_time DESC then open_time DESC for
        CLOSED positions.
      operationId: api_trade_positions_list
      parameters:
        - in: query
          name: account_id
          schema:
            type: integer
          description: >-
            Optional account ID. Regular users may only request their own
            accounts.
        - in: query
          name: closed_at_after
          schema:
            type: string
            format: date-time
          description: >-
            For `state=CLOSED` only. Filter by `close_time` at or after this ISO
            8601 datetime. Inclusive.
        - in: query
          name: closed_at_before
          schema:
            type: string
            format: date-time
          description: >-
            For `state=CLOSED` only. Filter by `close_time` at or before this
            ISO 8601 datetime. Inclusive.
        - in: query
          name: date_from
          schema:
            type: string
          description: >-
            Filter by open or close date. Use `YYYY-MM-DD`; `DD-MM-YYYY` is also
            accepted for compatibility. For timestamp precision, use the
            `opened_at_*` or `closed_at_*` filters.
        - in: query
          name: date_to
          schema:
            type: string
          description: >-
            Filter by open or close date. Use `YYYY-MM-DD`; `DD-MM-YYYY` is also
            accepted for compatibility. For timestamp precision, use the
            `opened_at_*` or `closed_at_*` filters.
        - in: query
          name: opened_at_after
          schema:
            type: string
            format: date-time
          description: >-
            For `state=OPEN` only. Filter by `open_time` at or after this ISO
            8601 datetime. Inclusive.
        - in: query
          name: opened_at_before
          schema:
            type: string
            format: date-time
          description: >-
            For `state=OPEN` only. Filter by `open_time` at or before this ISO
            8601 datetime. Inclusive.
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: prop_firm
          schema:
            type: string
          description: >-
            Optional firm slug. When supplied, results are limited to the
            caller's own accounts for that firm.
        - in: query
          name: state
          schema:
            type: string
            enum:
              - CLOSED
              - OPEN
            default: OPEN
          description: Filter positions by state
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOpenPositionList'
              examples:
                OpenPositionsResponse:
                  value:
                    meta:
                      count: 123
                      page: 1
                      page_size: 20
                      total_pages: 7
                      has_next: true
                      has_previous: false
                      next: https://api.example.org/resources/?page=2
                      previous: null
                    results:
                      - meta:
                          count: 1
                          page: 1
                          page_size: 20
                          total_pages: 1
                          has_next: false
                          has_previous: false
                          next: null
                          previous: null
                        results:
                          - account_id: 2001
                            account_currency: USD
                            uid: POS-OPEN-001
                            symbol: EURUSD
                            direction: long
                            volume: '1.0000'
                            open_price: '1.0800'
                            open_time: '2025-01-13T10:00:00Z'
                            tp: '1.0900'
                            sl: '1.0700'
                            open_pnl: '0.0000'
                  summary: Paginated positions response
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    PaginatedOpenPositionList:
      type: object
      required:
        - meta
        - results
      properties:
        meta:
          type: object
          required:
            - count
            - page
            - page_size
            - total_pages
            - has_next
            - has_previous
            - next
            - previous
          description: >-
            Pagination metadata. Use `has_next`/`has_previous` for boolean page
            checks and `next`/`previous` for page URLs.
          example:
            count: 123
            page: 1
            page_size: 20
            total_pages: 7
            has_next: true
            has_previous: false
            next: https://api.example.org/resources/?page=2
            previous: null
          properties:
            count:
              type: integer
              example: 123
              description: Total number of items matching the request.
            page:
              type: integer
              example: 1
              description: Current 1-indexed page number.
            page_size:
              type: integer
              example: 20
              description: Number of items returned per page.
            total_pages:
              type: integer
              example: 7
              description: Total number of pages available.
            has_next:
              type: boolean
              example: true
              description: Whether another page is available after this one.
            has_previous:
              type: boolean
              example: false
              description: Whether a page is available before this one.
            next:
              type: string
              nullable: true
              format: uri
              example: http://api.example.org/accounts/?page=2
              description: URL for the next page, or null on the final page.
            previous:
              type: string
              nullable: true
              format: uri
              example: null
              description: URL for the previous page, or null on the first page.
        results:
          type: array
          items:
            $ref: '#/components/schemas/OpenPosition'
    OpenPosition:
      type: object
      properties:
        account_id:
          type: string
          readOnly: true
        account_currency:
          type: string
          readOnly: true
        direction:
          type: string
          readOnly: true
        open_pnl:
          type: string
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        uid:
          type: string
          maxLength: 255
        profit:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
        state:
          allOf:
            - $ref: '#/components/schemas/StateEnum'
          minimum: -2147483648
          maximum: 2147483647
        volume:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,4})?$
        close_volume:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,4})?$
          nullable: true
        symbol:
          type: string
          maxLength: 50
        commission:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
        swap:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
        tp:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        sl:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        open_time:
          type: string
          format: date-time
        open_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
        open_order_id:
          type: string
          maxLength: 255
        close_time:
          type: string
          format: date-time
          nullable: true
        close_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        close_order_id:
          type: string
          nullable: true
          maxLength: 255
        close_reason:
          type: string
          nullable: true
          maxLength: 255
        mae:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
        mae_timestamp:
          type: string
          format: date-time
          nullable: true
        mfe:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
        mfe_timestamp:
          type: string
          format: date-time
          nullable: true
        avg_long_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        avg_short_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        avg_entry_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        avg_exit_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,4})?$
          nullable: true
        net_pnl:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          nullable: true
        trade_count:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        day_bought_quantity:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,4})?$
          nullable: true
        day_sold_quantity:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,4})?$
          nullable: true
        prop_firm:
          type: string
          format: uuid
        account:
          type: integer
      required:
        - account
        - account_currency
        - account_id
        - created
        - direction
        - modified
        - open_order_id
        - open_pnl
        - open_price
        - open_time
        - prop_firm
        - state
        - symbol
        - uid
        - volume
    StateEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Open
        * `1` - Closed
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.