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

# Update a plan file

> Updates display metadata on a plan file (name, ordering, enabled). If the plan's latest version is published, a new draft version is created and the file is updated on the new draft.



## OpenAPI

````yaml /api-reference/openapi.json patch /catalog/plans/{identifier}/file/{pk}/
openapi: 3.0.0
info:
  title: kelviq API
  version: 1.0.0
  description: >-
    API for interacting with kelviq services, derived from Python SDK
    documentation.
servers:
  - url: https://api.kelviq.com/api/v1
    description: kelviq API Server (General - specific operations might override)
security:
  - bearerAuth: []
tags:
  - name: Products
    description: Catalog products.
  - name: Product Settings
    description: Per-product settings (currency, VPN/Tor/proxy, product URL).
  - name: Product Files
    description: Product images and downloadable assets.
  - name: Features
    description: Catalog features that can be granted as plan entitlements.
  - name: Plans
    description: Catalog plans (CRUD, publish, versions, prices).
  - name: Plan Entitlements
    description: Feature entitlements attached to a plan.
  - name: Plan Files
    description: Files attached to plans, and signed download links.
  - name: Media
    description: Generate presigned S3 upload URLs for product/plan images and files.
  - name: Partner
    description: Partner integration APIs (organization provisioning, lookup).
  - name: Charges
    description: >-
      One-time payments charged immediately against a customer's default payment
      method.
paths:
  /catalog/plans/{identifier}/file/{pk}/:
    parameters:
      - name: identifier
        in: path
        required: true
        description: Plan identifier.
        example: pro-monthly
        schema:
          type: string
      - name: pk
        in: path
        required: true
        description: Plan file UUID.
        example: 7a3e3411-cef0-4f4e-bdb6-1f74a4f4d2c0
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Plan Files
      summary: Update a plan file
      description: >-
        Updates display metadata on a plan file (name, ordering, enabled). If
        the plan's latest version is published, a new draft version is created
        and the file is updated on the new draft.
      operationId: updateCatalogPlanFile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanFileUpdateRequest'
      responses:
        '200':
          description: Updated plan file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanFile'
        '401':
          description: Unauthorized — missing or invalid API key
        '404':
          description: Plan file not found.
      security:
        - bearerAuth: []
components:
  schemas:
    PlanFileUpdateRequest:
      type: object
      description: >-
        Update display fields of a plan file. The underlying file cannot be
        replaced.
      properties:
        name:
          type: string
          example: Plan Terms (v2).pdf
        ordering:
          type: integer
          example: 1
        enabled:
          type: boolean
          example: true
    PlanFile:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          example: 7a3e3411-cef0-4f4e-bdb6-1f74a4f4d2c0
        name:
          type: string
          example: Plan Terms.pdf
        file:
          type: string
          readOnly: true
          example: media/.../plans/<id>/<uuid>/terms.pdf
        ordering:
          type: integer
          example: 0
        enabled:
          type: boolean
          example: true
        downloadUrl:
          type: string
          format: uri
          readOnly: true
          description: >-
            URL clients can hit to download the file. Will redirect to a
            forced-download URL.
          example: >-
            https://api.kelviq.com/api/v1/catalog/plans/pro-monthly/file/7a3e3411-cef0-4f4e-bdb6-1f74a4f4d2c0/download/
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The Server API Key obtained from the kelviq application. Pass as a
        Bearer token in the Authorization header. Example: 'Authorization:
        Bearer __YOUR_API_KEY__'

````