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

# Delete Connection

> Delete a connection by its ID and Organization ID (Leen's UUID).



## OpenAPI

````yaml delete /provisioning/organizations/{organization_id}/connections/{connection_id}
openapi: 3.1.0
info:
  title: Leen Security API
  version: 0.0.1
servers:
  - description: Production API (US)
    url: https://api.leen.dev/v1
  - description: Production API (EU)
    url: https://api.eu-c1.leen.dev/v1
  - description: Production API (APAC)
    url: https://api.ap-se2.leen.dev/v1
security: []
paths:
  /provisioning/organizations/{organization_id}/connections/{connection_id}:
    delete:
      tags:
        - provisioning
      summary: Delete Connection
      description: Delete a connection by its ID and Organization ID (Leen's UUID).
      operationId: delete_connection_by_id
      parameters:
        - in: path
          name: organization_id
          required: true
          schema:
            format: uuid
            title: Organization Id
            type: string
        - in: path
          name: connection_id
          required: true
          schema:
            format: uuid
            title: Connection Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionRespModel'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - API-Key: []
components:
  schemas:
    ConnectionRespModel:
      properties:
        created_at:
          description: When the connection was created.
          format: date-time
          title: Created At
          type: string
        direction:
          $ref: '#/components/schemas/ConnectionDirectionEnum'
          default: SOURCE
          description: >-
            Which way data moves. `SOURCE` reads from the vendor; the
            destination kinds write to it, and are what a push or pull
            integration uses.
        health:
          $ref: '#/components/schemas/ConnectionHealthRespModel'
          description: >-
            Whether the connection is working, and who has to act if it is not
            -- a revoked credential is yours to fix, a vendor outage is not.
        id:
          description: >-
            Leen's identifier for this connection. Pass it as `connection_id`
            when reading data.
          format: uuid
          title: Id
          type: string
        identifier:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Your own reference for this connection, set when it was created.
            Leen does not interpret it; it is here so you can match a connection
            to a record in your system.
          title: Identifier
        is_active:
          description: >-
            Whether scheduled syncing runs. Separate from `state`: a connection
            can be `ACTIVE` with syncing switched off.
          title: Is Active
          type: boolean
        last_token_issued_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Pull destinations only: latest access-token mint time across active
            secrets. Used as a freshness proxy since these connections never
            sync.
          title: Last Token Issued At
        oauth2_authorize_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Where to send the user to authorise this connection, for vendors
            that use OAuth2. Null once authorisation is complete, and for every
            vendor that authenticates another way.
          title: Oauth2 Authorize Url
        organization_id:
          description: The organization this connection belongs to.
          format: uuid
          title: Organization Id
          type: string
        pull_destination_health:
          anyOf:
            - enum:
                - HEALTHY
                - STALE
              type: string
            - type: 'null'
          description: >-
            Pull destinations only: HEALTHY if a token was minted within the
            staleness window, STALE otherwise (including if none was ever
            minted).
          title: Pull Destination Health
        refresh_interval_secs:
          description: Seconds between scheduled syncs. Defaults to 14400 -- four hours.
          title: Refresh Interval Secs
          type: integer
        source_connection_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            For a destination connection, the source whose data it forwards.
            Null on a source connection.
          title: Source Connection Id
        state:
          $ref: '#/components/schemas/ConnectionStateEnum'
          description: >-
            Lifecycle state. `PENDING` until credentials are accepted, then
            `ACTIVE`. `PAUSED` stops syncing without discarding anything;
            `DELETED` is a soft delete and its data is no longer readable.
        timeout_secs:
          description: >-
            How long a single sync may run before it is abandoned. Defaults to
            3600.
          title: Timeout Secs
          type: integer
        updated_at:
          description: When any field on the connection last changed.
          format: date-time
          title: Updated At
          type: string
        vendor:
          description: >-
            The tool this connection reads from or writes to, e.g. `SNYK`,
            `QUALYS`.
          title: Vendor
          type: string
      required:
        - id
        - vendor
        - is_active
        - refresh_interval_secs
        - timeout_secs
        - organization_id
        - state
        - created_at
        - updated_at
        - health
      title: Connection
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ConnectionDirectionEnum:
      enum:
        - SOURCE
        - PUSH_DESTINATION
        - PULL_DESTINATION
      title: ConnectionDirectionEnum
      type: string
    ConnectionHealthRespModel:
      properties:
        description:
          title: Description
          type: string
        details:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConnectionHealthUnauthorizedDetail'
              type: array
            - type: 'null'
          title: Details
        name:
          $ref: '#/components/schemas/ConnectionHealthStatusName'
        resolution_owner:
          $ref: '#/components/schemas/ResolutionOwner'
        status:
          $ref: '#/components/schemas/ConnectionHealthStatusEnum'
      required:
        - name
        - status
        - description
        - resolution_owner
      title: ConnectionHealthRespModel
      type: object
    ConnectionStateEnum:
      enum:
        - PENDING
        - ACTIVE
        - PAUSED
        - DELETED
        - HARD_DELETED
      title: ConnectionStateEnum
      type: string
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ConnectionHealthUnauthorizedDetail:
      properties:
        data_export_type:
          anyOf:
            - $ref: '#/components/schemas/DataExportTypesEnum'
            - type: 'null'
        endpoint:
          title: Endpoint
          type: string
      required:
        - endpoint
      title: ConnectionHealthUnauthorizedDetail
      type: object
    ConnectionHealthStatusName:
      enum:
        - HEALTHY
        - INITIALIZING
        - UNAUTHORIZED
        - CONNECTION_RECONFIGURATION_REQUIRED
        - VENDOR_CLIENT_ERROR
        - VENDOR_SERVER_ERROR
        - EXECUTION_TIMEOUT
        - RATE_LIMIT_EXCEEDED
        - INTERNAL_ERROR
      title: ConnectionHealthStatusName
      type: string
    ResolutionOwner:
      enum:
        - LEEN
        - CUSTOMER
        - VENDOR
      title: ResolutionOwner
      type: string
    ConnectionHealthStatusEnum:
      enum:
        - HEALTHY
        - UNHEALTHY
        - INITIALIZING
      title: ConnectionHealthStatusEnum
      type: string
    DataExportTypesEnum:
      enum:
        - alerts
        - compliances
        - compliance_findings
        - config_users
        - cspm_alerts
        - device_groups
        - device_policies
        - devices
        - idp
        - idp_alerts
        - idp_audit_logs
        - idp_policies
        - issues
        - organization_identities
        - sast_issues
        - sca_issues
        - vms_scan_configs
        - vulnerabilities
        - resources
        - vulnerability_findings_v2
        - grc_entity
        - grc_control
        - grc_evidence
        - grc_assessment_question
        - grc_assessment
        - tprm
        - tprm_company
        - tprm_finding
        - findings
        - itsm_users
        - itsm_groups
        - itsm_projects
        - itsm_tickets
        - itsm_attachments
        - itsm_comments
        - applications
        - siem_events
      title: DataExportTypesEnum
      type: string
  securitySchemes:
    API-Key:
      in: header
      name: X-API-KEY
      type: apiKey

````

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