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

# Publish a draft plan version

> Publishes the current draft version, making it the active version.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json post /api/v1/plans/{plan_id}/publish
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Checkout Sessions
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
paths:
  /api/v1/plans/{plan_id}/publish:
    post:
      tags:
        - Plans
      summary: Publish a draft plan version
      description: Publishes the current draft version, making it the active version.
      operationId: publish_plan
      parameters:
        - name: plan_id
          in: path
          description: Plan ID
          required: true
          schema:
            $ref: '#/components/schemas/PlanId'
      responses:
        '200':
          description: Plan published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '404':
          description: Plan not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '409':
          description: No draft version to publish
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    PlanId:
      type: string
      format: MeteroidId
      examples:
        - plan_7n42DGM5Tflk9n8mt7Fhc7
    Plan:
      type: object
      required:
        - id
        - name
        - created_at
        - plan_type
        - status
        - product_family
        - version_id
        - version
        - currency
        - net_terms
        - price_components
        - available_parameters
      properties:
        available_parameters:
          $ref: '#/components/schemas/AvailableParameters'
        billing_cycles:
          type:
            - integer
            - 'null'
          format: int32
        created_at:
          type: string
          format: date-time
        currency:
          type: string
        description:
          type:
            - string
            - 'null'
        entitlements:
          type: array
          items:
            $ref: '#/components/schemas/Entitlement'
        id:
          $ref: '#/components/schemas/PlanId'
        minimum_commitment:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MinimumCommitment'
              description: >-
                Plan-level minimum commitment (period true-up floor). When set,
                every billing-period

                invoice for this plan is guaranteed to be at least
                `minimum_commitment.amount` after

                discounts, with a "Minimum commitment" line filling any
                shortfall.
        name:
          type: string
        net_terms:
          type: integer
          format: int32
        period_start_day:
          type:
            - integer
            - 'null'
          format: int32
        plan_type:
          $ref: '#/components/schemas/PlanTypeEnum'
        price_components:
          type: array
          items:
            $ref: '#/components/schemas/PriceComponent'
        product_family:
          $ref: '#/components/schemas/ProductFamily'
        self_service_rank:
          type:
            - integer
            - 'null'
          format: int32
        status:
          $ref: '#/components/schemas/PlanStatusEnum'
        trial:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TrialConfig'
        version:
          type: integer
          format: int32
        version_id:
          $ref: '#/components/schemas/PlanVersionId'
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    AvailableParameters:
      type: object
      properties:
        billing_periods:
          type: object
          description: >-
            Map of component_id -> available billing periods (e.g., "MONTHLY",
            "ANNUAL")
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/BillingPeriodEnum'
          propertyNames:
            type: string
        capacity_thresholds:
          type: object
          description: Map of component_id -> available capacity values
          additionalProperties:
            type: array
            items:
              type: integer
              format: int64
              minimum: 0
          propertyNames:
            type: string
        slot_components:
          type: array
          items:
            type: string
          description: >-
            List of component_ids that support slot parametrization (initial
            slot count)
    Entitlement:
      type: object
      description: >-
        A raw entitlement row attached to one entity (feature, plan version,
        add-on, or subscription).
      required:
        - id
        - feature_id
        - value
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
        feature_id:
          $ref: '#/components/schemas/FeatureId'
        id:
          $ref: '#/components/schemas/EntitlementId'
        updated_at:
          type: string
          format: date-time
        value:
          $ref: '#/components/schemas/EntitlementValue'
    MinimumCommitment:
      type: object
      required:
        - amount
        - scope
      properties:
        amount:
          type: string
          description: Decimal string in the plan currency, e.g. "100.00".
        scope:
          $ref: '#/components/schemas/MinimumCommitmentScope'
    PlanTypeEnum:
      type: string
      title: PlanType
      enum:
        - STANDARD
        - FREE
        - CUSTOM
    PriceComponent:
      type: object
      required:
        - id
        - name
      properties:
        fee:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Fee'
        id:
          $ref: '#/components/schemas/PriceComponentId'
        name:
          type: string
        product_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ProductId'
    ProductFamily:
      type: object
      required:
        - id
        - name
      properties:
        id:
          $ref: '#/components/schemas/ProductFamilyId'
        name:
          type: string
    PlanStatusEnum:
      type: string
      title: PlanStatus
      enum:
        - DRAFT
        - ACTIVE
        - INACTIVE
        - ARCHIVED
    TrialConfig:
      type: object
      required:
        - duration_days
        - is_free
      properties:
        duration_days:
          type: integer
          format: int32
          minimum: 0
        is_free:
          type: boolean
        trialing_plan_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PlanId'
    PlanVersionId:
      type: string
      format: MeteroidId
      examples:
        - plv_7n42DGM5Tflk9n8mt7Fhc7
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
    BillingPeriodEnum:
      type: string
      enum:
        - MONTHLY
        - QUARTERLY
        - SEMIANNUAL
        - ANNUAL
    FeatureId:
      type: string
      format: MeteroidId
      examples:
        - feat_7n42DGM5Tflk9n8mt7Fhc7
    EntitlementId:
      type: string
      format: MeteroidId
      examples:
        - ent_7n42DGM5Tflk9n8mt7Fhc7
    EntitlementValue:
      oneOf:
        - $ref: '#/components/schemas/BooleanEntitlementValue'
        - $ref: '#/components/schemas/MeteredEntitlementValue'
      discriminator:
        propertyName: type
        mapping:
          BOOLEAN:
            $ref: '#/components/schemas/BooleanEntitlementValue'
          METERED:
            $ref: '#/components/schemas/MeteredEntitlementValue'
    MinimumCommitmentScope:
      oneOf:
        - $ref: '#/components/schemas/AllComponentsScope'
        - $ref: '#/components/schemas/ProductsScope'
      discriminator:
        propertyName: type
        mapping:
          all_components:
            $ref: '#/components/schemas/AllComponentsScope'
          products:
            $ref: '#/components/schemas/ProductsScope'
    Fee:
      oneOf:
        - $ref: '#/components/schemas/RatePlanFee'
        - $ref: '#/components/schemas/SlotPlanFee'
        - $ref: '#/components/schemas/CapacityPlanFee'
        - $ref: '#/components/schemas/UsagePlanFee'
        - $ref: '#/components/schemas/ExtraRecurringPlanFee'
        - $ref: '#/components/schemas/OneTimePlanFee'
      discriminator:
        propertyName: type
        mapping:
          CAPACITY:
            $ref: '#/components/schemas/CapacityPlanFee'
          EXTRA_RECURRING:
            $ref: '#/components/schemas/ExtraRecurringPlanFee'
          ONE_TIME:
            $ref: '#/components/schemas/OneTimePlanFee'
          RATE:
            $ref: '#/components/schemas/RatePlanFee'
          SLOT:
            $ref: '#/components/schemas/SlotPlanFee'
          USAGE:
            $ref: '#/components/schemas/UsagePlanFee'
    PriceComponentId:
      type: string
      format: MeteroidId
      examples:
        - price_7n42DGM5Tflk9n8mt7Fhc7
    ProductId:
      type: string
      format: MeteroidId
      examples:
        - prd_7n42DGM5Tflk9n8mt7Fhc7
    ProductFamilyId:
      type: string
      format: MeteroidId
      examples:
        - pf_7n42DGM5Tflk9n8mt7Fhc7
    BooleanEntitlementValue:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
    MeteredEntitlementValue:
      type: object
      properties:
        enabled:
          type: boolean
          description: Per-entitlement kill switch. `false` means disabled.
        limit:
          type:
            - string
            - 'null'
          format: decimal
          description: Cap on usage. Null means unlimited.
        reset_period:
          $ref: '#/components/schemas/ResetPeriod'
    AllComponentsScope:
      type: object
      description: Every revenue line counts toward the floor.
    ProductsScope:
      type: object
      description: >-
        Only lines for the listed products count. A product is the identity
        shared by plan

        components, overrides and ad-hoc extras, so a subscription's billed set
        is matched uniformly.
      required:
        - product_ids
      properties:
        product_ids:
          type: array
          items:
            type: string
    RatePlanFee:
      type: object
      description: Recurring rate fee (e.g., monthly subscription)
      required:
        - rates
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/TermRate'
    SlotPlanFee:
      type: object
      description: Slot-based fee (e.g., per-seat pricing)
      required:
        - rates
        - slot_unit_name
      properties:
        minimum_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        quota:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        rates:
          type: array
          items:
            $ref: '#/components/schemas/TermRate'
        slot_unit_name:
          type: string
    CapacityPlanFee:
      type: object
      description: Capacity-based fee with included committed usage and overage
      required:
        - metric_id
        - thresholds
        - cadence
      properties:
        cadence:
          $ref: '#/components/schemas/BillingPeriodEnum'
        metric_id:
          $ref: '#/components/schemas/BillableMetricId'
        thresholds:
          type: array
          items:
            $ref: '#/components/schemas/CapacityThreshold'
    UsagePlanFee:
      type: object
      description: Usage-based fee
      required:
        - metric_id
        - pricing
        - cadence
      properties:
        cadence:
          $ref: '#/components/schemas/BillingPeriodEnum'
        metric_id:
          $ref: '#/components/schemas/BillableMetricId'
        pricing:
          $ref: '#/components/schemas/PlanUsagePricingModel'
    ExtraRecurringPlanFee:
      type: object
      description: Extra recurring fee
      required:
        - unit_price
        - quantity
        - billing_type
        - cadence
      properties:
        billing_type:
          $ref: '#/components/schemas/BillingType'
        cadence:
          $ref: '#/components/schemas/BillingPeriodEnum'
        quantity:
          type: integer
          format: int32
          minimum: 0
        unit_price:
          type: string
    OneTimePlanFee:
      type: object
      description: One-time fee
      required:
        - unit_price
        - quantity
      properties:
        quantity:
          type: integer
          format: int32
          minimum: 0
        unit_price:
          type: string
    ResetPeriod:
      oneOf:
        - $ref: '#/components/schemas/BillingCycleResetPeriod'
          description: >-
            Resets each time your subscription renews — anchored to your billing
            cycle.
        - $ref: '#/components/schemas/CalendarResetPeriod'
          description: >-
            Resets on calendar boundaries (e.g. the 1st of every month) — not
            tied to subscription start date.
        - $ref: '#/components/schemas/FixedWindowResetPeriod'
          description: >-
            Resets at regular intervals — anchored to your subscription's exact
            activation time.
        - $ref: '#/components/schemas/SlidingWindowResetPeriod'
          description: >-
            Always ends at now — e.g. 30 days means the last 30 days, old usage
            drops off automatically.
        - $ref: '#/components/schemas/NeverResetPeriod'
          description: >-
            Never resets — counts all usage since the subscription was
            activated.
      discriminator:
        propertyName: type
        mapping:
          BILLING_CYCLE:
            $ref: '#/components/schemas/BillingCycleResetPeriod'
          CALENDAR:
            $ref: '#/components/schemas/CalendarResetPeriod'
          FIXED_WINDOW:
            $ref: '#/components/schemas/FixedWindowResetPeriod'
          NEVER:
            $ref: '#/components/schemas/NeverResetPeriod'
          SLIDING_WINDOW:
            $ref: '#/components/schemas/SlidingWindowResetPeriod'
    TermRate:
      type: object
      required:
        - term
        - price
      properties:
        price:
          type: string
        term:
          $ref: '#/components/schemas/BillingPeriodEnum'
    BillableMetricId:
      type: string
      format: MeteroidId
      examples:
        - bm_7n42DGM5Tflk9n8mt7Fhc7
    CapacityThreshold:
      type: object
      required:
        - included_amount
        - price
        - per_unit_overage
      properties:
        included_amount:
          type: integer
          format: int64
          minimum: 0
        per_unit_overage:
          type: string
        price:
          type: string
    PlanUsagePricingModel:
      oneOf:
        - $ref: '#/components/schemas/PerUnitPlanPricing'
        - $ref: '#/components/schemas/TieredPlanPricing'
        - $ref: '#/components/schemas/VolumePlanPricing'
        - $ref: '#/components/schemas/PackagePlanPricing'
        - $ref: '#/components/schemas/MatrixPlanPricing'
      discriminator:
        propertyName: type
        mapping:
          MATRIX:
            $ref: '#/components/schemas/MatrixPlanPricing'
          PACKAGE:
            $ref: '#/components/schemas/PackagePlanPricing'
          PER_UNIT:
            $ref: '#/components/schemas/PerUnitPlanPricing'
          TIERED:
            $ref: '#/components/schemas/TieredPlanPricing'
          VOLUME:
            $ref: '#/components/schemas/VolumePlanPricing'
    BillingType:
      type: string
      enum:
        - ADVANCE
        - ARREARS
    BillingCycleResetPeriod:
      type: object
      description: >-
        Resets each time your subscription renews — anchored to your billing
        cycle.
    CalendarResetPeriod:
      type: object
      description: >-
        Resets on calendar boundaries (e.g. the 1st of every month) — not tied
        to subscription start date.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    FixedWindowResetPeriod:
      type: object
      description: >-
        Resets at regular intervals — anchored to your subscription's exact
        activation time.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    SlidingWindowResetPeriod:
      type: object
      description: >-
        Always ends at now — e.g. 30 days means the last 30 days, old usage
        drops off automatically.
      required:
        - unit
        - interval
      properties:
        interval:
          type: integer
          format: int32
          minimum: 0
        unit:
          $ref: '#/components/schemas/CalendarUnit'
    NeverResetPeriod:
      type: object
      description: Never resets — counts all usage since the subscription was activated.
    PerUnitPlanPricing:
      type: object
      required:
        - rate
      properties:
        rate:
          type: string
    TieredPlanPricing:
      type: object
      required:
        - tiers
      properties:
        block_size:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/TierRow'
    VolumePlanPricing:
      type: object
      required:
        - tiers
      properties:
        block_size:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/TierRow'
    PackagePlanPricing:
      type: object
      required:
        - block_size
        - rate
      properties:
        block_size:
          type: integer
          format: int64
          minimum: 0
        rate:
          type: string
    MatrixPlanPricing:
      type: object
      required:
        - rates
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/MatrixRow'
    CalendarUnit:
      type: string
      enum:
        - HOUR
        - DAY
        - WEEK
        - MONTH
        - YEAR
    TierRow:
      type: object
      required:
        - first_unit
        - rate
        - flat_fee
        - flat_cap
      properties:
        first_unit:
          type: integer
          format: int64
          minimum: 0
        flat_cap:
          type: string
          format: decimal
        flat_fee:
          type: string
          format: decimal
        rate:
          type: string
          format: decimal
    MatrixRow:
      type: object
      required:
        - dimension1
        - per_unit_price
      properties:
        dimension1:
          $ref: '#/components/schemas/MatrixDimension'
        dimension2:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MatrixDimension'
        per_unit_price:
          type: string
          format: decimal
    MatrixDimension:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
        value:
          type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````