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

> [!NOTE]
>
> Click the base URL in the API playground and select the **Sandbox** host for test data or the **Production** host for live data. Use credentials from the same environment.


## 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://sandboxapi.kelviq.com/api/v1
    description: Sandbox — Test payments
  - url: https://api.kelviq.com/api/v1
    description: Production — Live payments
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.
  - name: Refunds
    description: Full and partial refunds for paid orders.
  - name: Transactions
    description: >-
      Charges, refunds, disputes, and other financial movements for the
      authenticated organization.
  - name: Payment Methods
    description: Saved customer payment methods (cards, etc.).
  - name: Orders
    description: Completed and resolved orders for the authenticated organization.
  - name: Order Events
    description: Timeline events for a specific order.
  - name: Invoices
    description: Invoices generated for orders and subscription billing cycles.
  - name: Discounts
    description: >-
      Discount codes (coupons) that can be applied to products and plans at
      checkout.
  - name: Webhook Endpoints
    description: >-
      Configure the destination URLs and event subscriptions that receive
      webhook deliveries.
  - name: Webhooks
    description: Delivery logs for webhook events sent to your configured endpoints.
  - name: Checkout Sessions
    description: Merchant-side view of checkout sessions created by customers.
  - name: Checkout Session Events
    description: Timeline events for a specific checkout session.
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: bf9f0fe0-c9c0-436d-8811-e412d0365470
        name:
          type: string
          example: custom-pricinig.png
        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. Carries a signed token and
            expires 24 hours after it was generated; requesting a fresh copy of
            the plan/subscription issues a new link.
          example: >-
            https://api.kelviq.com/api/v1/catalog/plans/10-july/file/bf9f0fe0-c9c0-436d-8811-e412d0365470/download/?token=Yjk5ZjBmZTAtYzljMC00MzZkLTg4MTEtZTQxMmQwMzY1NDcw%3A1v2Abc%3Ahash
  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__'

````

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