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

# Cancel a payment subscription



## OpenAPI

````yaml https://api.mn.co/admin/v1/spec.json delete /admin/v1/networks/{network_id}/subscriptions/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: The Mighty Networks Admin API
  description: An API for managing your Mighty Networks network
servers:
  - url: https://api.mn.co
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Members
    description: Manage members of your network
  - name: Courseworks
    description: Manage course content (lessons, quizzes, sections)
  - name: Reactions
    description: Manage reactions on comments
  - name: Mute
    description: Mute posts for users
  - name: Comments
    description: Manage comments on posts
  - name: Invites
    description: Invites allow you to invite users to your network
  - name: Tags
    description: Manage tags for your network
  - name: Spaces
    description: >-
      Spaces are the organizational units within a Network where content and
      members are organized
  - name: Plans
    description: Manage plans in your network
  - name: PasswordResets
    description: Manage member password resets
  - name: Badges
    description: Manage badges for your network
  - name: Rsvps
    description: Manage event RSVPs for your network
  - name: Options
    description: Manage dropdown custom field options
  - name: Answers
    description: Manage member responses to custom fields
  - name: Subscriptions
    description: >-
      Manage payment subscriptions - recurring payments from members to hosts
      for plans
  - name: Purchases
    description: Manage purchases and subscriptions for your network
  - name: Posts
    description: Posts also include Articles.
  - name: Polls
    description: >-
      Polls and Questions allow members to share opinions and engage with each
      other
  - name: Networks
    description: >-
      Networks are the top-level organizational unit under which other resources
      are nested
  - name: Me
    description: Metadata about the requesting user
  - name: Events
    description: Events are scheduled gatherings that members can RSVP to and engage with
  - name: CustomFields
    description: Manage custom fields for your network
  - name: Collections
    description: Manage collections in your network
  - name: Assets
    description: Manage assets for your network
  - name: AbuseReports
    description: Manage abuse reports for your network
paths:
  /admin/v1/networks/{network_id}/subscriptions/{id}:
    delete:
      tags:
        - Subscriptions
      summary: Cancel a payment subscription
      operationId: delete_subscriptions
      parameters:
        - name: id
          in: path
          required: true
          description: Subscription ID
          schema:
            type: integer
            format: uint64
        - name: when
          in: query
          required: false
          description: >-
            When to cancel: 'now' (immediate) or 'end_of_billing_cycle'
            (default: 'end_of_billing_cycle')
          schema:
            type: string
        - $ref: '#/components/parameters/networkId'
      responses:
        '200':
          description: Returns the canceled subscription details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
        '400':
          description: Invalid 'when' parameter value
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Subscription is already canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    networkId:
      name: network_id
      in: path
      description: The Network's unique integer ID, or subdomain
      required: true
      schema:
        oneOf:
          - type: integer
            description: Unique numeric network ID
            format: uint64
          - type: string
            description: Network subdomain
            format: /^[a-z][a-z0-9-]+$/
  schemas:
    SubscriptionResponse:
      description: A payment subscription for a plan
      type: object
      required:
        - created_at
        - email
        - member_id
        - permalink
        - plan
        - subscription
        - updated_at
      properties:
        member_id:
          type: integer
          format: uint64
          description: The subscriber's integer ID
        created_at:
          type: string
          format: date-time
          description: The date and time the subscriber was created
          example: '2026-06-29T15:23:14+00:00'
        updated_at:
          type: string
          format: date-time
          description: The date and time the subscriber was last modified
          example: '2026-06-29T15:23:14+00:00'
        email:
          type: string
          format: email
          description: The subscriber's email address
          example: ada.lovelace@example.com
        first_name:
          type: string
          description: The subscriber's first name
        last_name:
          type: string
          description: The subscriber's last name
        time_zone:
          type: string
          description: The subscriber's time zone
        location:
          type: string
          description: The subscriber's location
        referral_count:
          type: integer
          format: uint64
          description: Number of referrals made by this subscriber
        avatar:
          type: string
          description: URL to the subscriber's avatar image
        categories:
          type: array
          description: >-
            Array of category objects. Contains the user's primary segment if
            present.
          items:
            $ref: '#/components/schemas/CategoryResponse'
        permalink:
          type: string
          description: Canonical URL to the subscriber's profile page
        ambassador_level:
          type: string
          description: The subscriber's ambassador level
        plan:
          $ref: '#/components/schemas/SubscriptionPlanResponse'
          description: The subscription plan
        subscription:
          $ref: '#/components/schemas/SubscriptionDetailResponse'
          description: Detailed subscription information
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: An error message explaining the problem encountered
    CategoryResponse:
      description: A category (segment) in the network
      type: object
      required:
        - id
        - title
      properties:
        id:
          type: integer
          format: uint64
          description: The category's integer ID
        title:
          type: string
          description: The category's title
    SubscriptionPlanResponse:
      description: Plan information for a subscription
      type: object
      required:
        - amount
        - currency
        - has_free_trial
        - interval
        - type
      properties:
        id:
          type: integer
          format: uint64
          description: The plan ID (null when the underlying bundle has been deleted)
        name:
          type: string
          description: The plan name (null when the underlying bundle has been deleted)
        amount:
          type: integer
          format: uint64
          description: The plan amount in cents
        currency:
          type: string
          description: The plan currency code
        interval:
          type: string
          description: The billing interval (day, week, month, year, etc.)
        type:
          type: string
          description: The plan type (free, subscription, one-time-payment)
        has_free_trial:
          type: boolean
          description: Whether the plan has a free trial
    SubscriptionDetailResponse:
      description: Detailed subscription information
      type: object
      required:
        - id
        - purchased_at
      properties:
        id:
          type: integer
          format: uint64
          description: The record's integer ID
          example: '1234'
        current_period_start:
          type: string
          format: date-time
          description: Start of current billing period
          example: '2026-06-29T15:23:14+00:00'
        current_period_end:
          type: string
          format: date-time
          description: End of current billing period
          example: '2026-06-29T15:23:14+00:00'
        payment_platform:
          type: string
          description: Payment platform (stripe, apple, etc.)
        canceled_at:
          type: string
          format: date-time
          description: When the subscription was canceled
          example: '2026-06-29T15:23:14+00:00'
        trial_length:
          type: integer
          format: uint64
          description: Length of trial in days
        trial_start:
          type: string
          format: date-time
          description: Trial start date
          example: '2026-06-29T15:23:14+00:00'
        trial_end:
          type: string
          format: date-time
          description: Trial end date
          example: '2026-06-29T15:23:14+00:00'
        purchased_at:
          type: string
          format: date-time
          description: When the subscription was purchased
          example: '2026-06-29T15:23:14+00:00'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````