> ## 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.

# Clean an investment objective

> Surgically extracts quantitative filter conditions (region, market cap, exclusion phrases) from a natural-language investment objective. Keeps the original wording unless a filter is woven into the sentence.



## OpenAPI

````yaml /api-reference/openapi-v2.json post /clean-objective
openapi: 3.0.0
info:
  title: Noonum API v2
  version: 2.0.0
  contact:
    name: Noonum Support
    email: hello@noonum.com
  description: >
    Create and manage investment strategies, portfolios, and backtests. The API
    covers the full strategy lifecycle, including creation and editing, the
    archive and revive flow, version submission and run state, result companies,
    evidence, factsheets, exposures, and taxonomy.
servers:
  - url: https://api.noonum.ai/v2
security:
  - bearerAuth: []
tags:
  - name: UserStrategies
    description: Create, read, update, and manage your own investment strategies.
  - name: Helper
    description: >-
      Shared utilities for company lookup and search, objective tooling, and a
      health check.
  - name: Portfolios
    description: Create, read, update, and delete portfolios.
  - name: Backtest
    description: Run a standalone backtest on a portfolio of companies.
  - name: Segments
    description: >-
      Companies' business segments, grouped into segment groups and tagged to
      GICS, NAICS and ICB industries, and the companies most similar to a
      company by the segments they share. You read a company's segment data once
      you subscribe to the company. A subscription lasts 365 days and cannot be
      cancelled or moved to another company; your plan sets how many you can
      hold at once, and `GET /segments/subscriptions` lists them.
  - name: Usage
    description: Read your plan, your remaining credits, and your credit usage.
paths:
  /clean-objective:
    post:
      tags:
        - Helper
      summary: Clean an investment objective
      description: >-
        Surgically extracts quantitative filter conditions (region, market cap,
        exclusion phrases) from a natural-language investment objective. Keeps
        the original wording unless a filter is woven into the sentence.
      operationId: app.api.v2.helper.clean_objective
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - objective
              properties:
                objective:
                  description: The investment objective in natural language.
                  type: string
                exclusions:
                  type: array
                  items:
                    type: string
                  description: Exclusion phrases already selected by the user.
                regions:
                  type: array
                  items:
                    type: string
                  description: Region filters already selected by the user.
                marketCap:
                  type: string
                  nullable: true
                  description: >-
                    Market-cap catalog key already selected by the user, or
                    null.
                availableFilters:
                  type: object
                  description: Catalog of filter options the model may choose from.
                  properties:
                    regions:
                      type: array
                      items:
                        type: string
                    marketCaps:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                          label:
                            type: string
      responses:
        '200':
          description: The cleaned objective and extracted filters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  cleanedObjective:
                    type: string
                    description: >-
                      The objective with filter phrases removed, otherwise the
                      original text.
                  regions:
                    type: array
                    items:
                      type: string
                    description: Selected region options from the provided catalog.
                  marketCap:
                    type: string
                    nullable: true
                    description: One market-cap catalog key, or null if none applies.
                  exclusions:
                    type: array
                    items:
                      type: string
                    description: >-
                      Short exclusion trigger phrases extracted from the
                      objective.
                  unsupportedFilters:
                    type: array
                    items:
                      type: string
                    description: >-
                      Subjects of screening conditions the API cannot express,
                      removed from the cleaned objective.
        '400':
          description: The request is invalid, for example a required field is missing.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    description: A human-readable description of the error.
                    type: string
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    description: A human-readable description of the error.
                    type: string
        '502':
          description: The upstream language model returned an error.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    description: A human-readable description of the error.
                    type: string
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`

````

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