# Cancel Subscription

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/placement-tests/cancel-subscription:
    post:
      summary: Cancel Subscription
      deprecated: false
      description: Cancel a placement test subscription or revert a previous cancellation.
      tags:
        - placement test
      parameters:
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: YOUR_API_KEY
          schema:
            type: string
        - name: x-service-provider
          in: header
          description: ''
          required: false
          example: GOOGLE
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subscriptionId:
                  type: string
                revertCancellation:
                  type: boolean
              required:
                - subscriptionId
                - revertCancellation
            example:
              subscriptionId: sub_1234567890
              revertCancellation: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: 'null'
                required:
                  - status
                  - message
                  - data
                x-apidog-orders:
                  - status
                  - message
                  - data
              example:
                status: 200
                message: Placement test subscription cancellation initiated
                data: null
          headers: {}
          x-apidog-name: Success
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
                x-apidog-orders:
                  - message
              example:
                message: subscriptionId is required
          headers: {}
          x-apidog-name: Unprocessable entity
      security: []
      x-apidog-folder: placement test
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-26754449-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
