# Cancel subscription

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/subscriptions/cancel:
    post:
      summary: Cancel subscription
      deprecated: false
      description: >-
        Cancel a subscription or revert a previous cancellation. The same
        endpoint handles both operations via the revertCancellation flag.
      tags:
        - subscriptions
      parameters:
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
        - name: ' x-service-provider'
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subscriptionId:
                  type: string
                revertCancellation:
                  type: boolean
                  x-apidog-mock: '{{$datatype.boolean}}'
              required:
                - subscriptionId
                - revertCancellation
              x-apidog-orders:
                - subscriptionId
                - revertCancellation
            example:
              subscriptionId: 436QM0E1MJ7PGQ7P6Y1SPQF6KW5S
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: 'null'
                required:
                  - message
                  - data
                x-apidog-orders:
                  - message
                  - data
          headers: {}
          x-apidog-name: Success
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  errorId:
                    type: string
                required:
                  - status
                  - message
                  - errorId
                x-apidog-orders:
                  - status
                  - message
                  - errorId
          headers: {}
          x-apidog-name: Not found
      security: []
      x-apidog-folder: subscriptions
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13489478-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
