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

# Uninstall an integration connection

> Revokes the connection's runtime credentials, deletes any upstream OAuth tokens, revokes active leased tokens, disables inbound webhook subscriptions, transitions the system.connection to state `revoked`, and emits a system.activity row. Audit-logged. Idempotent at the artefact level (revoking an already-revoked artefact is a no-op), but rejects with 400 when the connection itself is already revoked.



## OpenAPI

````yaml /openapi.json post /connections/{id}/uninstall
openapi: 3.1.0
info:
  title: Marfa API
  version: 4.2.0
  description: Typed data layer for structured personal data
servers: []
security: []
paths:
  /connections/{id}/uninstall:
    post:
      tags:
        - Connections
      summary: Uninstall an integration connection
      description: >-
        Revokes the connection's runtime credentials, deletes any upstream OAuth
        tokens, revokes active leased tokens, disables inbound webhook
        subscriptions, transitions the system.connection to state `revoked`, and
        emits a system.activity row. Audit-logged. Idempotent at the artefact
        level (revoking an already-revoked artefact is a no-op), but rejects
        with 400 when the connection itself is already revoked.
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Connection uninstalled. Body details the artefacts cleaned up.
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection_id:
                    type: string
                  revoked_credential_ids:
                    type: array
                    items:
                      type: string
                  oauth_tokens_deleted:
                    type: boolean
                  leased_tokens_revoked:
                    type: integer
                    minimum: 0
                  inbound_webhooks_disabled:
                    type: integer
                    minimum: 0
                  activity_id:
                    type: string
                required:
                  - connection_id
                  - revoked_credential_ids
                  - oauth_tokens_deleted
                  - leased_tokens_revoked
                  - inbound_webhooks_disabled
                  - activity_id
        '400':
          description: Connection is not an integration, or already revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unauthorized
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Caller is not an admin.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - forbidden
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: Connection not found in this tenant scope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - connection_not_found
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or OAuth Token
      description: Pass an API key (marfa_k1_...) or OAuth access token (marfa_at_...)

````