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

# Update a portfolio

> Requires `portfolio:write` and `Idempotency-Key`. `global` cannot be updated.



## OpenAPI

````yaml /openapi/portfobit-openapi.yaml patch /portfolios/{portfolio_id}
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}:
    patch:
      tags:
        - Portfolios
      summary: Update a portfolio
      description: >-
        Requires `portfolio:write` and `Idempotency-Key`. `global` cannot be
        updated.
      operationId: updatePortfolio
      parameters:
        - $ref: '#/components/parameters/MutablePortfolioId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        $ref: '#/components/requestBodies/PortfolioRequest'
      responses:
        '200':
          $ref: '#/components/responses/PortfolioResponse'
        '403':
          $ref: '#/components/responses/ResourcePlanLimitedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    MutablePortfolioId:
      name: portfolio_id
      in: path
      required: true
      schema:
        type: string
        not:
          const: global
      description: User-created portfolio ID; `global` cannot be changed.
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: Opaque retry key, unique to the same user, method, and path.
  requestBodies:
    PortfolioRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PortfolioRequest'
  responses:
    PortfolioResponse:
      description: Portfolio object response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PortfolioResponseSchema'
    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:
    PortfolioRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        base_currency:
          type: string
          default: USD
        tags:
          type: array
          items:
            type: string
        account_ids:
          type: array
          items:
            type: string
      additionalProperties: false
    PortfolioResponseSchema:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: object
          required:
            - id
            - name
            - description
            - base_currency
            - tags
            - account_ids
            - matched_account_count
            - subscription_access
            - is_system
            - created_at
            - updated_at
          properties:
            id:
              type: string
            name:
              type: string
            description:
              type: string
            base_currency:
              type: string
            tags:
              type: array
              items:
                type: string
            account_ids:
              type: array
              items:
                type: string
            matched_account_count:
              type: integer
            subscription_access:
              type: string
            is_system:
              type: boolean
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        meta:
          type: object
          required:
            - request_id
            - generated_at
          properties:
            request_id:
              type: string
            generated_at:
              type: string
              format: date-time
      example:
        data:
          id: pf_01J2K7M9N3
          name: Q3_Quant_Hedge
          description: Cross_CEX_funding_rate_arbitrage
          base_currency: USD
          tags:
            - Arbitrage
          account_ids:
            - acc_01H8XFK9A
          matched_account_count: 1
          subscription_access: available
          is_system: false
          created_at: '2026-08-01T00:00:00Z'
          updated_at: '2026-08-07T08:00:00Z'
        meta:
          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.