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

# Disconnect Integration

> Best-effort revoke at the third-party provider, then soft-delete the row and clear encrypted tokens.

Disconnect a connected integration. The endpoint:

1. Best-effort revokes the refresh token at the third-party provider (e.g. `https://oauth2.googleapis.com/revoke`). Provider revoke failures are logged but **do not** fail the request — the local-side disconnect always proceeds.
2. Clears `access_token_encrypted` and `refresh_token_encrypted`.
3. Sets `deleted_at = now()` and `status = 'disconnected'`.

Required scope: `integrations:manage`.

The row is **soft-deleted**, not removed, because `flow_versions` from the past may still reference its `id`. Calls placed against active flow agents that reference a disconnected integration will hit the integration-call node's `error` transition with a structured `integration_disconnected` result.

To re-connect the same Google account, finish the OAuth flow from the dashboard's Integrations page (the public API does not expose a connect endpoint). The OAuth callback finds the existing soft-deleted row (matched by `(company_id, provider, account_label)`), revives it, and writes fresh tokens.

Returns `204 No Content` on success.


## OpenAPI

````yaml DELETE /integrations/{id}
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /integrations/{id}:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
    delete:
      tags:
        - Integrations
      summary: Disconnect an integration
      description: >-
        Best-effort revoke at the third-party provider, then soft-delete the row
        and clear encrypted tokens.
      operationId: deleteIntegration
      responses:
        '204':
          description: Disconnected
        '404':
          description: Integration not found
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**.

````