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

# delete-connection

> Archive a connection and enqueue credential revocation/disconnect cleanup.



## OpenAPI

````yaml /api-reference/membrane-api.json delete /connections/{id}
openapi: 3.0.0
info:
  title: Membrane API
  description: API documentation for Membrane Engine
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getmembrane.com
security:
  - bearer: []
tags: []
paths:
  /connections/{id}:
    delete:
      summary: delete-connection
      description: >-
        Archive a connection and enqueue credential revocation/disconnect
        cleanup.
      operationId: deleteConnection
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Connection id or connection key.
      responses:
        '200':
          description: >-
            Archive a connection and enqueue credential revocation/disconnect
            cleanup.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      Internal database ID of the element. Assigned by the API;
                      unique per element.
                  name:
                    type: string
                  userId:
                    type: string
                  tenantId:
                    type: string
                  ownerName:
                    type: string
                    nullable: true
                  type:
                    type: string
                    enum:
                      - connector
                      - mcp
                      - pipedream
                  key:
                    type: string
                  isTest:
                    type: boolean
                  connected:
                    type: boolean
                  hasDocs:
                    type: boolean
                  docsCount:
                    type: number
                  docsSummary:
                    type: string
                  state:
                    type: string
                    enum:
                      - BUILDING
                      - CLIENT_ACTION_REQUIRED
                      - CONFIGURATION_ERROR
                      - SETUP_FAILED
                      - READY
                      - DISCONNECTING
                  errors:
                    type: array
                    items:
                      type: object
                  requestError:
                    allOf:
                      - type: object
                  integrationId:
                    type: string
                  connectorId:
                    type: string
                  externalAppId:
                    type: string
                  connectorVersion:
                    type: string
                  authOptionKey:
                    type: string
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                  lastActiveAt:
                    type: string
                  nextCredentialsRefreshAt:
                    type: string
                  nextRetryTimestamp:
                    type: string
                  retryAttempts:
                    type: number
                  canTest:
                    type: boolean
                  canRefreshCredentials:
                    type: boolean
                  archivedAt:
                    type: string
                  isDeactivated:
                    type: boolean
                  meta:
                    type: object
                    additionalProperties: {}
                  buildingAgentSessionId:
                    description: >-
                      Session ID for building the element via intent-based
                      endpoints (create/update with intent). Present when state
                      is BUILDING.
                    type: string
                  clientAction:
                    description: >-
                      Action the client must perform to advance this connection.
                      Present if and only if state is CLIENT_ACTION_REQUIRED.
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - connect
                          - provide-input
                      description:
                        type: string
                      uiUrl:
                        type: string
                      agentInstructions:
                        type: string
                      handoffAgentInstructions:
                        type: string
                      reason:
                        description: >-
                          [INTERNAL] Cause that triggered this client action;
                          persisted so prompts can be re-rendered on read.
                        type: string
                        enum:
                          - authenticate
                          - reauthenticate
                          - provide-input
                    required:
                      - type
                      - description
                    additionalProperties: false
                  logoUri:
                    description: >-
                      Resolved app logo for this element (integration ->
                      connector -> external app -> favicon).
                    type: string
                  input: {}
                required:
                  - id
                  - name
                  - userId
                additionalProperties: false
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````