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

# Cancel Subscription

> Schedule subscription cancellation at period end and record exit-survey row.

Sets ``cancel_at_period_end=true`` on the Stripe subscription. Inserts a row
in ``subscription_cancellations`` capturing the optional reason + free-text.
The row is immutable — resuming the subscription does NOT delete it; it's an
event log, not state.



## OpenAPI

````yaml /openapi.json post /api/v1/workspaces/{workspace_id}/billing/cancel
openapi: 3.1.0
info:
  description: Change Impact Engine for multi-repo systems
  title: Riftmap
  version: 1.12.3
servers: []
security: []
paths:
  /api/v1/workspaces/{workspace_id}/billing/cancel:
    post:
      tags:
        - billing
      summary: Cancel Subscription
      description: >-
        Schedule subscription cancellation at period end and record exit-survey
        row.


        Sets ``cancel_at_period_end=true`` on the Stripe subscription. Inserts a
        row

        in ``subscription_cancellations`` capturing the optional reason +
        free-text.

        The row is immutable — resuming the subscription does NOT delete it;
        it's an

        event log, not state.
      operationId: cancel_subscription_api_v1_workspaces__workspace_id__billing_cancel_post
      parameters:
        - in: path
          name: workspace_id
          required: true
          schema:
            format: uuid
            title: Workspace Id
            type: string
        - in: header
          name: X-Workspace-Id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Workspace-Id
        - in: cookie
          name: riftmap_access
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Riftmap Access
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelSubscriptionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelSubscriptionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    CancelSubscriptionRequest:
      properties:
        reason:
          anyOf:
            - enum:
                - too_expensive
                - missing_feature
                - switching_competitor
                - no_longer_needed
                - other
              type: string
            - type: 'null'
          title: Reason
        reason_text:
          anyOf:
            - maxLength: 500
              type: string
            - type: 'null'
          title: Reason Text
        waive_pending_charges:
          default: false
          title: Waive Pending Charges
          type: boolean
      title: CancelSubscriptionRequest
      type: object
    CancelSubscriptionResponse:
      properties:
        cancel_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Cancel At
        status:
          title: Status
          type: string
        waived_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Waived Count
        waived_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Waived Total
      required:
        - status
        - cancel_at
      title: CancelSubscriptionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        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:
    APIKeyHeader:
      in: header
      name: X-API-Key
      type: apiKey
    HTTPBearer:
      description: API key as Bearer token (rfm_live_... prefix)
      scheme: bearer
      type: http

````