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

# Delete Automation

> Soft-delete a draft or a drained paused/archived automation.

Active parents must be paused first. Pausing stops new enrollments while
existing runs continue; active/waiting/queued/stuck runs refuse deletion.
History is retained in storage, and all public parent/history reads become
404 after deletion. Successful responses have an empty body.



## OpenAPI

````yaml /openapi/mio-openapi.json delete /api/v1/teams/{team_id}/hubs/{hub_id}/automations/{automation_id}
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/hubs/{hub_id}/automations/{automation_id}:
    delete:
      tags:
        - automations
      summary: Delete Automation
      description: >-
        Soft-delete a draft or a drained paused/archived automation.


        Active parents must be paused first. Pausing stops new enrollments while

        existing runs continue; active/waiting/queued/stuck runs refuse
        deletion.

        History is retained in storage, and all public parent/history reads
        become

        404 after deletion. Successful responses have an empty body.
      operationId: >-
        automations.delete_automations_delete_teams_by_team_id_hubs_by_hub_id_automations_by_automation_id
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
        - in: path
          name: automation_id
          required: true
          schema:
            title: Automation Id
            type: string
      responses:
        '204':
          description: Successful Response
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Bad request
        '401':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not authenticated
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Forbidden
        '404':
          content:
            application/vnd.api+json:
              examples:
                automation_not_found:
                  value:
                    errors:
                      - code: automation_not_found
                        detail: Automation 'id' not found.
                        meta:
                          request_id: request-id
                        status: '404'
                        title: Not Found
                hub_not_found:
                  value:
                    errors:
                      - code: hub_not_found
                        detail: Hub 'hub' not found or does not belong to team 'team'.
                        meta:
                          request_id: request-id
                        status: '404'
                        title: Not Found
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not found
        '409':
          content:
            application/vnd.api+json:
              examples:
                automation_active:
                  value:
                    errors:
                      - code: automation_active
                        detail: >-
                          Pause this automation before deleting it. Pausing
                          stops new enrollments; existing runs continue.
                        meta:
                          request_id: request-id
                        status: '409'
                        title: Conflict
                automation_has_active_runs:
                  value:
                    errors:
                      - code: automation_has_active_runs
                        detail: >-
                          This automation has active runs. Let runs finish or
                          remove them first, then delete it.
                        meta:
                          request_id: request-id
                        status: '409'
                        title: Conflict
                automation_status_conflict:
                  value:
                    errors:
                      - code: automation_status_conflict
                        detail: Cannot delete automation with status 'unsupported'.
                        meta:
                          request_id: request-id
                        status: '409'
                        title: Conflict
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Status conflict
        '422':
          content:
            application/vnd.api+json:
              examples:
                graph_validation_error:
                  value:
                    errors:
                      - code: graph_validation_error
                        detail: >-
                          Cannot copy node 'branch': missing, deleted or
                          cross-team tag 'id'.
                        meta:
                          request_id: request-id
                        source:
                          pointer: >-
                            /data/attributes/definition/nodes/0/config/condition_tree/groups/0/conditions/0/value/tag_id
                        status: '422'
                        title: Unprocessable Entity
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Graph validation error
        '429':
          content:
            application/vnd.api+json:
              examples:
                rate_limited:
                  value:
                    errors:
                      - code: rate_limited
                        detail: Too many requests. Please try again later.
                        meta:
                          request_id: request-id
                        status: '429'
                        title: Too Many Requests
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: 'Shared authoring limit: 60 requests/hour per client IP'
        '503':
          content:
            application/vnd.api+json:
              examples:
                service_unavailable:
                  value:
                    errors:
                      - code: service_unavailable
                        detail: Service temporarily unavailable.
                        meta:
                          request_id: request-id
                        status: '503'
                        title: Service Unavailable
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Service temporarily unavailable
      security:
        - HTTPBearer: []
components:
  schemas:
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.