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

# Add plan entitlements

> Appends one or more feature entitlements to the plan. If the plan's latest version is published, a new draft version is created automatically.



## OpenAPI

````yaml /api-reference/openapi.json post /catalog/plans/{identifier}/features/
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}/features/:
    parameters:
      - name: identifier
        in: path
        required: true
        description: Plan identifier.
        example: pro-monthly
        schema:
          type: string
      - name: version
        in: query
        required: false
        description: Plan version to scope the listing to (GET only).
        example: 2
        schema:
          type: integer
    post:
      tags:
        - Plan Entitlements
      summary: Add plan entitlements
      description: >-
        Appends one or more feature entitlements to the plan. If the plan's
        latest version is published, a new draft version is created
        automatically.
      operationId: addCatalogPlanFeatures
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanFeaturesCreateRequest'
      responses:
        '201':
          description: Entitlements added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogPlan'
        '401':
          description: Unauthorized — missing or invalid API key
      security:
        - bearerAuth: []
components:
  schemas:
    PlanFeaturesCreateRequest:
      type: object
      required:
        - planEntitlements
      properties:
        planEntitlements:
          type: array
          items:
            $ref: '#/components/schemas/PlanFeatureEntitlementWrite'
    CatalogPlan:
      type: object
      description: >-
        A versioned plan attached to a product. Updates create new versions;
        only the published version is `is_latest=true`.
      properties:
        identifier:
          type: string
          description: URL-safe slug. Stable across versions.
          example: pro-monthly
        name:
          type: string
          example: Pro Monthly
        description:
          type: string
          example: Pro tier billed monthly.
        product:
          type: string
          format: uuid
          description: UUID of the parent product.
          example: 0d65f7c0-7e91-4f56-9b32-13a9a6a7c1de
        metadata:
          type: object
          additionalProperties: true
          example: {}
        version:
          type: integer
          readOnly: true
          example: 3
        isLatest:
          type: boolean
          readOnly: true
          description: True only for the currently published version.
          example: true
        modifiedOn:
          type: string
          format: date-time
          readOnly: true
          example: '2025-04-12T08:21:14.910Z'
        createdOn:
          type: string
          format: date-time
          readOnly: true
          example: '2025-03-01T08:21:14.910Z'
        details:
          type: object
          readOnly: true
          additionalProperties: true
          description: Provider-side identifiers (e.g. `stripeProductId`).
          example:
            stripeProductId: prod_ABC123
        isVisible:
          type: boolean
          example: true
        isImported:
          type: boolean
          readOnly: true
          example: false
        countries:
          type: array
          readOnly: true
          items:
            type: string
          example:
            - US
            - IN
        license:
          $ref: '#/components/schemas/LicenseConfig'
        links:
          type: array
          items:
            $ref: '#/components/schemas/PlanLink'
        files:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/PlanFile'
        ordering:
          type: integer
          nullable: true
          example: 1
    PlanFeatureEntitlementWrite:
      type: object
      required:
        - feature
        - details
      properties:
        feature:
          type: string
          format: uuid
          description: Feature UUID.
          example: 3a3e92ab-90a3-4f43-8e87-9d4c8c5a9c01
        details:
          $ref: '#/components/schemas/PlanEntitlementDetails'
    LicenseConfig:
      type: object
      description: License configuration for a plan (used when issuing license keys).
      properties:
        enabled:
          type: boolean
          example: true
        activationLimit:
          type: integer
          minimum: 1
          example: 3
        activationLimitEnabled:
          type: boolean
          example: true
        durationUnit:
          type: string
          enum:
            - DAY
            - MONTH
            - YEAR
          example: YEAR
        durationValue:
          type: integer
          minimum: 1
          example: 1
        hasExpiry:
          type: boolean
          example: true
    PlanLink:
      type: object
      properties:
        name:
          type: string
          example: Product page
        url:
          type: string
          format: uri
          example: https://example.com/product
    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/
    PlanEntitlementDetails:
      type: object
      description: >-
        Per-feature entitlement configuration on a plan. Shape varies by
        feature_type.
      additionalProperties: true
      properties:
        value:
          description: 'For BOOLEAN: a boolean. For CUSTOMIZABLE / METER: a number.'
          example: 10000
        hasUnlimitedUsage:
          type: boolean
          example: false
        reset:
          type: string
          enum:
            - NEVER
            - EVERY_DAY
            - EVERY_MONTH
            - EVERY_QUARTER
            - EVERY_YEAR
          example: EVERY_MONTH
        resetTime:
          type: string
          nullable: true
          example: BEGINNING_OF_PERIOD
        rollover:
          type: object
          additionalProperties: true
          example: {}
        usageAlerts:
          type: object
          description: >-
            Optional usage-alert configuration for this entitlement.
            `thresholdType` is `PERCENTAGE` (thresholds are 1-100) or `BALANCE`
            (thresholds are absolute usage values).
          properties:
            enabled:
              type: boolean
              example: true
            thresholds:
              type: array
              items:
                type: number
              example:
                - 75
                - 90
            thresholdType:
              type: string
              enum:
                - PERCENTAGE
                - BALANCE
              example: PERCENTAGE
          example:
            enabled: true
            thresholds:
              - 75
              - 90
            thresholdType: PERCENTAGE
        hardLimit:
          type: boolean
          example: false
        isInherited:
          type: boolean
          example: false
        isValueOverridden:
          type: boolean
          example: false
  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__'

````