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

# Update an owned portfolio and replace its holdings

> Updates a portfolio, replacing its holdings with the supplied ones. Only the owner can update a portfolio.



## OpenAPI

````yaml /api-reference/openapi.json put /portfolios/{portfolioId}
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:
  /portfolios/{portfolioId}:
    parameters:
      - name: portfolioId
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: UUID of the portfolio
    put:
      tags:
        - Portfolios
      summary: Update an owned portfolio and replace its holdings
      description: >-
        Updates a portfolio, replacing its holdings with the supplied ones. Only
        the owner can update a portfolio.
      operationId: app.api.v1.portfolios.put
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: My Portfolio
                public:
                  type: boolean
                  default: false
                tags:
                  type: array
                  items:
                    type: string
                  nullable: true
                source:
                  type: string
                  nullable: true
                metadata:
                  type: object
                  nullable: true
                holdings:
                  type: array
                  items:
                    type: object
                    properties:
                      weight:
                        type: number
                        format: float
                        minimum: 0
                        maximum: 1
                      symbol:
                        type: string
                        nullable: true
                      exchange:
                        type: string
                        nullable: true
                      name:
                        type: string
                        nullable: true
                      raw_payload:
                        type: object
                        nullable: true
                      security_id:
                        type: string
                        format: uuid
                        nullable: true
                      org_id:
                        type: string
                        format: uuid
                        nullable: true
                    required:
                      - weight
              required:
                - name
                - holdings
      responses:
        '200':
          description: The updated portfolio.
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      user_id:
                        type: string
                        nullable: true
                        description: >-
                          Owner identifier, null when the caller is not the
                          owner.
                      name:
                        type: string
                      public:
                        type: boolean
                      tags:
                        type: array
                        items:
                          type: string
                        nullable: true
                      source:
                        type: string
                        nullable: true
                      metadata:
                        type: object
                        nullable: true
                      created_at:
                        description: >-
                          Timestamp of when the portfolio was created, as an RFC
                          7231 HTTP date.
                        type: string
                        example: Sat, 05 Apr 2025 17:43:37 GMT
                      updated_at:
                        description: >-
                          Timestamp of when the portfolio was last updated, as
                          an RFC 7231 HTTP date.
                        type: string
                        example: Mon, 07 Apr 2025 18:39:41 GMT
                    required:
                      - id
                      - user_id
                      - name
                      - public
                      - created_at
                      - updated_at
                  - type: object
                    properties:
                      holdings:
                        type: array
                        items:
                          type: object
                          properties:
                            weight:
                              type: number
                              format: float
                              minimum: 0
                              maximum: 1
                            symbol:
                              type: string
                              nullable: true
                            exchange:
                              type: string
                              nullable: true
                            market:
                              type: string
                              nullable: true
                            name:
                              type: string
                              nullable: true
                            raw_payload:
                              type: object
                              nullable: true
                            security_id:
                              type: string
                              format: uuid
                              nullable: true
                            org_id:
                              type: string
                              format: uuid
                              nullable: true
                            market_cap:
                              type: number
                              nullable: true
                            sector:
                              type: string
                              nullable: true
                            industry:
                              type: string
                              nullable: true
                            created_at:
                              description: >-
                                Timestamp of when the holding was created, as an
                                RFC 7231 HTTP date.
                              type: string
                              example: Sat, 05 Apr 2025 17:43:37 GMT
                            updated_at:
                              description: >-
                                Timestamp of when the holding was last updated,
                                as an RFC 7231 HTTP date.
                              type: string
                              example: Mon, 07 Apr 2025 18:39:41 GMT
                          required:
                            - weight
                            - created_at
                            - updated_at
                    required:
                      - holdings
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    type: string
                    description: A human-readable description of the error.
        '404':
          description: The portfolio was not found.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    type: string
                    description: A human-readable description of the error.
        '409':
          description: Another portfolio already uses the requested name.
          content:
            application/json:
              schema:
                type: object
                description: A standard error response.
                properties:
                  error:
                    type: string
                    description: A human-readable description of the error.
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`

````