> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an Integration

> Remove an integration (or a single connection) from a linked account.

Remove an integration from a linked account. If `auth_type` is supplied, only that single connection within the integration is removed. When no connections remain, the workflow-side installation is deleted, related caches and dataslot keys are cleared, a webhook event is emitted, and a token-revoke job is enqueued for apps that support it.

The updated linked account is returned. The call succeeds even if the integration was not present (the account is returned unchanged).

## Authentication

<ParamField header="x-api-key" type="string" required>
  Your Refold API key. Find it in **Settings → Credentials**.
</ParamField>

<ParamField header="linked_account_id" type="string" required>
  The linked account to operate on. May also be passed as a query parameter.
</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>
  The application slug of the integration to remove.

  **Example:** `hubspot`
</ParamField>

## Query Parameters

<ParamField query="linked_account_id" type="string" required>
  The linked account ID (required as header or query parameter).
</ParamField>

<ParamField query="auth_type" type="string">
  Remove only a single connection of this auth type (e.g. `oauth2`, `keybased`) instead of the whole integration.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    Returns the updated linked account.

    <ResponseField name="_id" type="string">Internal record ID.</ResponseField>
    <ResponseField name="account_id" type="string">Your unique identifier for the account.</ResponseField>
    <ResponseField name="environment" type="string">Environment: `test` or `live`.</ResponseField>
    <ResponseField name="name" type="string">Display name.</ResponseField>
    <ResponseField name="integrations" type="array">Remaining integrations after removal.</ResponseField>
  </Tab>

  <Tab title="401 Unauthorized">
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category.</ResponseField>
    <ResponseField name="error" type="string">Internal error code.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "_id": "6a3134fdc71d10070e78923e",
    "associated_org": "6500a1b2c3d4e5f6a7b8c9d0",
    "account_id": "user_12345",
    "environment": "test",
    "name": "Acme Inc.",
    "udf": [],
    "integrations": [],
    "createdAt": "2026-06-16T11:35:25.951Z",
    "updatedAt": "2026-06-16T11:36:00.774Z",
    "__v": 0
  }
  ```

  ```json 401 theme={null}
  {
    "status_code": 401,
    "http_error_type": "UNAUTHORIZED",
    "error": "SERVER_ERROR",
    "message": "Invalid Credentials"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://app.refold.ai/api/v2/public/linked-account/integration/{slug}?linked_account_id=YOUR_LINKED_ACCOUNT_ID" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash cURL (single connection) theme={null}
  curl -X DELETE "https://app.refold.ai/api/v2/public/linked-account/integration/{slug}?linked_account_id=YOUR_LINKED_ACCOUNT_ID&auth_type=oauth2" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</RequestExample>
