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

# Cancel Plan

> Cancel Billing Plan

<script src="/locale-bridge.js" />


## OpenAPI

````yaml /openapi.en.json POST /v1/public/accounts/{account_id}/billing/cancel-plan
openapi: 3.1.0
info:
  title: Code API (Public)
  version: 1.0.0
servers:
  - url: https://api.hybridbox.io
security: []
paths:
  /v1/public/accounts/{account_id}/billing/cancel-plan:
    post:
      tags:
        - public-accounts
        - public-billing
      summary: Cancel Billing Plan
      description: Cancel the account billing plan.
      operationId: >-
        cancel_public_billing_plan_v1_public_accounts__account_id__billing_cancel_plan_post
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            format: uuid
            title: Account Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCancelPlanRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBillingPlanOperationResponse'
          description: ''
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - PublicBearerAuth: []
components:
  schemas:
    BillingCancelPlanRequest:
      description: Customer request schema for cancelling an account subscription plan.
      properties:
        cancel_at_period_end:
          default: true
          description: Cancel the plan at the end of the billing period
          title: Cancel At Period End
          type: boolean
        cancel_immediately:
          default: false
          description: Cancel the plan immediately
          title: Cancel Immediately
          type: boolean
      title: BillingCancelPlanRequest
      type: object
    PublicBillingPlanOperationResponse:
      properties:
        account_status:
          anyOf:
            - type: string
            - type: 'null'
          description: Account status after the operation
          title: Account Status
        effective_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the billing change took effect
          title: Effective At
        eligible:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the account was eligible for the operation
          title: Eligible
        previous_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Previous billing plan ID
          title: Previous Plan Id
        status:
          description: Billing operation status
          title: Status
          type: string
        target_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Target billing plan ID
          title: Target Plan Id
      required:
        - status
      title: PublicBillingPlanOperationResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    PublicBearerAuth:
      bearerFormat: JWT or Hybridbox Service account token
      description: >-
        Public API bearer credential sent as `Authorization: Bearer <token>`.
        Use either an OAuth access token or a Hybridbox Service account token.
      scheme: bearer
      type: http

````