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

# Optimize a strategy's portfolio over a subset of companies



## OpenAPI

````yaml /api-reference/openapi.json post /strategies/{strategyId}/optimized-portfolio
openapi: 3.0.0
info:
  title: Noonum API
  version: 1.0.0
  contact:
    name: Noonum Support
    email: hello@noonum.com
  description: >
    Create, read, update, and delete your own investment strategies, browse
    public premade strategies, run semantic search, and call supporting utility
    endpoints.
servers:
  - url: https://api.noonum.ai/v1
security:
  - bearerAuth: []
tags:
  - name: UserStrategies
    description: Create, read, update, and delete your own investment strategies.
  - name: PremadeStrategies
    description: Read public premade strategies and find the ones closest to an objective.
  - name: Helper
    description: >-
      Supporting endpoints for company lookup, objective editing, and health
      checks.
  - name: Benchmarks
    description: Read benchmark data.
  - name: Portfolios
    description: Create, read, update, and delete your portfolios.
  - name: Backtest
    description: Backtest a portfolio without saving it.
paths:
  /strategies/{strategyId}/optimized-portfolio:
    post:
      tags:
        - UserStrategies
      summary: Optimize a strategy's portfolio over a subset of companies
      operationId: app.api.v1.strategies.optimize_portfolio_filter
      parameters:
        - name: strategyId
          in: path
          required: true
          schema:
            type: string
          description: UUID of the user strategy
        - name: minMarketCap
          in: query
          required: false
          description: Minimum company market capitalization (USD) required for inclusion.
          schema:
            type: number
            format: double
            minimum: 0
            exclusiveMinimum: true
            default: 1000000000
        - name: returnWeight
          in: query
          required: false
          description: >-
            Multiplier applied to expected returns in the optimization
            objective.
          schema:
            type: number
            format: double
            minimum: 0
            exclusiveMinimum: true
            default: 1
        - name: linguisticBetaWeight
          in: query
          required: false
          description: Weight of the linguistic beta term in the optimization objective.
          schema:
            type: number
            format: double
            minimum: 0
            maximum: 1
            default: 0.5
        - name: riskFreeRate
          in: query
          required: false
          description: Annual risk-free rate assumption used for risk metrics.
          schema:
            type: number
            format: double
            default: 0.03
        - name: minActivePositions
          in: query
          required: false
          description: Minimum number of holdings that must receive a positive weight.
          schema:
            type: integer
            minimum: 2
            default: 50
        - name: minActivePositionWeight
          in: query
          required: false
          description: >-
            Minimum weight assigned to holdings counted toward the active
            position requirement.
          schema:
            type: number
            format: double
            minimum: 0.0001
            exclusiveMinimum: true
            default: 0.01
        - name: maxWeight
          in: query
          required: false
          description: Maximum weight allowed for any single holding.
          schema:
            type: number
            format: double
            minimum: 0
            exclusiveMinimum: true
            maximum: 1
            default: 0.2
        - name: marketBuzzWeight
          in: query
          required: false
          description: >-
            Penalty weight applied when allocations diverge from market buzz
            preferences.
          schema:
            type: number
            format: double
            minimum: 0
            maximum: 1
            default: 0.05
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              nullable: true
              properties:
                companyIds:
                  type: array
                  description: >-
                    Company IDs to consider before the other filters are
                    applied. When omitted or empty, the full strategy set is
                    used.
                  minItems: 0
                  items:
                    type: string
      responses:
        '200':
          description: The optimized portfolio.
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: object
                    properties:
                      numberStocks:
                        type: integer
                        example: 50
                      weightedLinguisticBeta:
                        type: number
                        format: float
                        example: 0.12
                      marketBuzzCoverage:
                        type: number
                        format: float
                        example: 25.4
                      annualizedReturn:
                        type: number
                        format: float
                        example: 0.18
                      volatility:
                        type: number
                        format: float
                        example: 0.09
                      cvar:
                        type: number
                        format: float
                        example: 0.2
                      sharpeRatio:
                        type: number
                        format: float
                        example: 1.5
                      expectedDailyReturn:
                        type: number
                        format: float
                        example: 0.001
                      maxDrawdown:
                        type: number
                        format: float
                        example: -0.25
                    required:
                      - numberStocks
                      - weightedLinguisticBeta
                      - marketBuzzCoverage
                      - annualizedReturn
                      - volatility
                      - cvar
                      - sharpeRatio
                      - expectedDailyReturn
                      - maxDrawdown
                  portfolio:
                    type: array
                    items:
                      description: >-
                        A company in the constructed portfolio, with its
                        assigned weight.
                      allOf:
                        - type: object
                          description: A company produced by a strategy run.
                          properties:
                            id:
                              type: string
                              format: uuid
                              example: b544d95b-43a6-4a50-a326-90552b05c551
                            symbol:
                              type: string
                              example: TSLA
                            name:
                              type: string
                              example: Tesla, Inc.
                            isin:
                              type: string
                              example: US88160R1014
                              nullable: true
                            figi:
                              type: string
                              example: BBG000N9MNX3
                              nullable: true
                              description: >-
                                Bloomberg Financial Instrument Global Identifier
                                (FIGI) for the listing.
                            exchange:
                              type: string
                              example: NASDAQ
                            market:
                              type: string
                              example: us
                              nullable: true
                            mic:
                              type: string
                              example: XNAS
                              nullable: true
                              description: >-
                                ISO 10383 operating market identifier code for
                                the listing exchange.
                            sector:
                              type: string
                              example: Consumer Cyclical
                              nullable: true
                            industry:
                              type: string
                              example: Auto - Manufacturers
                              nullable: true
                            marketCap:
                              type: number
                              example: 902298200000
                              nullable: true
                            volAvg:
                              type: number
                              format: float
                              example: 1250000
                              nullable: true
                            linguisticBeta:
                              type: number
                              format: float
                              example: 0.12002
                            marketBuzz:
                              type: number
                              format: float
                              example: 0.406
                            reasoning:
                              type: string
                              nullable: true
                              description: >-
                                Why the company was included. Present only when
                                `includeReasoning` is `true`.
                            convictionScore:
                              type: number
                              format: float
                              example: 0.75
                              nullable: true
                              description: >-
                                Conviction score between 0 and 1 that combines
                                market buzz and linguistic beta. A higher score
                                indicates a stronger thematic signal on both
                                dimensions.
                            active:
                              type: boolean
                              example: true
                              description: Whether the company is currently active.
                          required:
                            - id
                            - symbol
                            - name
                            - isin
                            - exchange
                            - market
                            - sector
                            - industry
                            - marketCap
                            - volAvg
                            - linguisticBeta
                            - marketBuzz
                            - active
                        - type: object
                          properties:
                            weight:
                              description: The company's weight in the portfolio.
                              type: number
                              format: float
                              example: 0.035
                          required:
                            - weight
                required:
                  - metadata
                  - portfolio
        '202':
          description: The strategy is still generating and results are not ready yet.
        '400':
          description: The request body is invalid, or no companies match the filters.
        '404':
          description: The strategy or its results do not exist.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: |
        Enter 'Bearer' followed by a space and then your JWT or API Key.
        Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`
        or `Bearer YOUR_API_KEY_HERE`

````