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

# Cancel subscription

> Cancel a subscription. For currently active subscriptions, subscription will be scheduled to end at end of current billing period. For upcoming subscriptions, subscription will be deleted.



## OpenAPI

````yaml https://platform.runonatlas.com/external/schema post /external/subscriptions/{id}/cancel
openapi: 3.0.0
info:
  title: Atlas API
  version: 1.0.0
servers:
  - url: https://platform.runonatlas.com
security: []
paths:
  /external/subscriptions/{id}/cancel:
    post:
      tags:
        - Subscriptions
      summary: Cancel subscription
      description: >-
        Cancel a subscription. For currently active subscriptions, subscription
        will be scheduled to end at end of current billing period. For upcoming
        subscriptions, subscription will be deleted.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: The Atlas subscription ID
            example: atlas-internal-subscription-id-123
          required: true
          description: The Atlas subscription ID
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                externalCustomerId:
                  type: string
                  minLength: 1
                  description: >-
                    The external ID of the customer (e.g. the customer ID in
                    your system)
                  example: external-customer-id-123
                type:
                  type: string
                  enum:
                    - active
                    - upcoming
              required:
                - externalCustomerId
                - type
              additionalProperties: false
      responses:
        '204':
          description: The subscription has been canceled.
        '400':
          description: >-
            There is an issue with the request data. See the response for more
            details.
        '401':
          description: Invalid API key provided.
        '403':
          description: This endpoint is only available for standard merchants.
        '404':
          description: Subscription not found.
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        You can obtain this key from the Atlas dashboard. It must be of type
        `secret`

````