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

# List aggregated portfolio positions

> Requires `portfolio:read`. `mode` currently accepts `net` or `flat`; `both` is not implemented.



## OpenAPI

````yaml /openapi/portfobit-openapi.yaml get /portfolios/{portfolio_id}/positions
openapi: 3.1.0
info:
  title: Portfobit Open API
  version: 0.1.0
  description: >
    Public REST API for direct API clients, CI, scripts, service accounts,
    third-party agents, and developer integrations.

    Public REST requests use scoped Portfobit Open API keys. OAuth access tokens
    issued for the Portfobit MCP resource are not accepted by `/api/v1/*`
    endpoints.

    Portfobit is crypto-CEX-only. Financial values are decimal strings and
    timestamps are RFC 3339 UTC strings.

    The API never supports withdrawals, external-address transfers,
    cross-exchange transfers, or P2P transfers.
servers:
  - url: https://api.portfobit.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Context
  - name: Accounts
  - name: Portfolios
  - name: Valuation
  - name: Activity
  - name: Trading
  - name: Market data
  - name: Support
paths:
  /portfolios/{portfolio_id}/positions:
    get:
      tags:
        - Portfolios
      summary: List aggregated portfolio positions
      description: >-
        Requires `portfolio:read`. `mode` currently accepts `net` or `flat`;
        `both` is not implemented.
      operationId: listPortfolioPositions
      parameters:
        - $ref: '#/components/parameters/PortfolioId'
        - $ref: '#/components/parameters/BaseCurrency'
        - $ref: '#/components/parameters/Venue'
        - $ref: '#/components/parameters/Tag'
        - $ref: '#/components/parameters/AggregationAccountStatus'
        - $ref: '#/components/parameters/AggregationMode'
        - $ref: '#/components/parameters/Symbol'
        - $ref: '#/components/parameters/PortfolioPositionSide'
        - $ref: '#/components/parameters/InstrumentType'
        - $ref: '#/components/parameters/MarginMode'
        - $ref: '#/components/parameters/IncludeSources'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          $ref: '#/components/responses/PortfolioPositionsResponse'
        '403':
          $ref: '#/components/responses/ResourcePlanLimitedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    PortfolioId:
      name: portfolio_id
      in: path
      required: true
      schema:
        type: string
      description: Portfolio ID; `global` is the current user's all-account view.
    BaseCurrency:
      name: base_currency
      in: query
      schema:
        type: string
        default: USD
    Venue:
      name: venue
      in: query
      schema:
        type: string
      description: CEX identifier.
    Tag:
      name: tag
      in: query
      schema:
        type: string
      description: Exact, case-sensitive tag filter.
    AggregationAccountStatus:
      name: account_status
      in: query
      schema:
        type: string
        enum:
          - active
          - syncing
          - error
          - expired
          - disabled
    AggregationMode:
      name: mode
      in: query
      schema:
        type: string
        enum:
          - net
          - flat
        default: net
    Symbol:
      name: symbol
      in: query
      schema:
        type: string
      description: CCXT unified symbol.
    PortfolioPositionSide:
      name: side
      in: query
      schema:
        type: string
        enum:
          - long
          - short
          - flat
    InstrumentType:
      name: type
      in: query
      schema:
        type: string
        enum:
          - spot
          - margin
          - swap
          - future
          - option
    MarginMode:
      name: margin_mode
      in: query
      schema:
        type: string
        enum:
          - cross
          - isolated
          - none
    IncludeSources:
      name: include_sources
      in: query
      schema:
        type: boolean
        default: false
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
    Offset:
      name: offset
      in: query
      schema:
        type: integer
        minimum: 0
        default: 0
  responses:
    PortfolioPositionsResponse:
      description: Aggregated portfolio position response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PortfolioPositionsResponseSchema'
    ResourcePlanLimitedResponse:
      description: The targeted retained resource is unavailable on the current plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourcePlanLimitedResponseSchema'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    PortfolioPositionsResponseSchema:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - aggregation_mode
              - market_type
              - type
              - symbol
              - side
              - contracts
              - contract_size
              - mark_price
              - net_notional_value
              - gross_notional_value
              - unrealized_pnl
              - risk
            properties:
              aggregation_mode:
                type: string
              market_type:
                type: string
              type:
                type: string
              symbol:
                type: string
              side:
                type: string
              contracts:
                type: string
              contract_size:
                type: string
              mark_price:
                type: string
              net_notional_value:
                type: string
              gross_notional_value:
                type: string
              unrealized_pnl:
                type: string
              risk:
                type: object
                required:
                  - status
                  - level
                  - model_version
                  - as_of
                  - reasons
                  - metrics
                properties:
                  status:
                    type: string
                  level:
                    type: string
                  model_version:
                    type: string
                  as_of:
                    type: string
                    format: date-time
                  reasons:
                    type: array
                    items:
                      type: object
                  metrics:
                    type: object
                    required:
                      - initial_margin
                      - maintenance_margin
                    properties:
                      initial_margin:
                        type: string
                      maintenance_margin:
                        type: string
        meta:
          type: object
          required:
            - total
            - limit
            - offset
            - has_next
            - portfolio_id
            - base_currency
            - account_count
            - request_id
            - generated_at
          properties:
            total:
              type: integer
            limit:
              type: integer
            offset:
              type: integer
            has_next:
              type: boolean
            portfolio_id:
              type: string
            base_currency:
              type: string
            account_count:
              type: integer
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        data:
          - aggregation_mode: net
            market_type: crypto
            type: swap
            symbol: ETH/USDT:USDT
            side: long
            contracts: '6'
            contract_size: '1'
            mark_price: '3000.00'
            net_notional_value: '18000.00'
            gross_notional_value: '42000.00'
            unrealized_pnl: '-300.00'
            risk:
              status: partial
              level: medium
              model_version: risk_v1
              as_of: '2026-08-07T08:00:00Z'
              reasons: []
              metrics:
                initial_margin: '4200.00'
                maintenance_margin: '1800.00'
        meta:
          total: 1
          limit: 50
          offset: 0
          has_next: false
          portfolio_id: global
          base_currency: USD
          account_count: 1
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-07T08:00:01Z'
    ResourcePlanLimitedResponseSchema:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              required:
                - resource_type
                - resource_id
                - current_plan
                - limit
                - upgrade_path
              properties:
                resource_type:
                  type: string
                resource_id:
                  type: string
                current_plan:
                  type: string
                limit:
                  type: integer
                upgrade_path:
                  type: string
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        error:
          code: resource_plan_limited
          message: This portfolio is retained but unavailable on the Free plan.
          details:
            resource_type: portfolio
            resource_id: pf_01J2K7M9N3
            current_plan: Free
            limit: 3
            upgrade_path: Plus
        meta:
          request_id: req_01J2K8B7QW
          generated_at: '2026-08-08T08:00:00Z'
    ErrorEnvelope:
      type: object
      required:
        - error
        - meta
      properties:
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Meta:
      type: object
      required:
        - request_id
        - generated_at
      properties:
        request_id:
          type: string
        generated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Portfobit Open API key

````

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