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

# Update Subscription

> Updates fields of an existing user subscription. This may include billing cycle, status, auto-renewal settings, etc.



## OpenAPI

````yaml PATCH /update-subscription/{id}
openapi: 3.1.0
info:
  title: CloserX.ai API
  description: >-
    The CloserX.ai API provides programmatic access to manage AI-powered calling
    operations, including agent creation, campaign management, contact handling,
    telephony integration, and more. This API enables seamless automation and
    integration with CRM systems, telephony providers, and other third-party
    services for enhanced client communication and business operations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.closerx.ai/api
security:
  - api_key: []
paths:
  /update-subscription/{id}:
    patch:
      summary: Update Subscription
      description: >-
        Updates fields of an existing user subscription. This may include
        billing cycle, status, auto-renewal settings, etc.
      parameters:
        - name: id
          in: path
          required: true
          description: The unique ID of the subscription to update.
          schema:
            type: string
            example: sub_67890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionRequest'
      responses:
        '200':
          description: Subscription successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSubscriptionResponse'
        '400':
          description: Invalid request parameters or update failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateSubscriptionRequest:
      type: object
      required:
        - user_id
      properties:
        user_id:
          type: string
          example: user_12345
          description: The ID of the user whose subscription is being updated.
        auto_renew:
          type: boolean
          example: false
          description: Toggle for auto-renewal setting.
        billing_cycle:
          type: string
          example: monthly
          description: >-
            New billing cycle if being changed. Accepted values: 'monthly',
            'yearly'.
        status:
          type: string
          example: paused
          description: >-
            Set subscription status. Example values: 'active', 'paused',
            'cancelled'.
    UpdateSubscriptionResponse:
      type: object
      properties:
        status:
          type: string
          example: success
          description: Status of the subscription update operation.
        subscription_id:
          type: string
          example: sub_67890
          description: ID of the updated subscription.
        updated_fields:
          type: object
          example:
            auto_renew: false
            billing_cycle: monthly
          description: The fields that were updated in the subscription.
    Error:
      required:
        - success
        - message
        - data
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api_key

````