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

# Disconnect an Integration

> Soft-disconnect the workspace's active tax, CRM, or storage integration; the provider falls back to platform defaults.

Deactivates the workspace's active connection for a `(category, provider)`.
The record is kept (soft-disconnect) but its credentials stop being used —
the feature that relied on it falls back to the platform's own configuration,
if any. Owner/admin only. To rotate credentials instead, call
[Connect an Integration](/api-reference/integration-connections/create) again
without disconnecting first: it deactivates the old row (and any other active
provider in the same category) and inserts a new connection with a new `id`.

## Parameters

| Parameter  | Type          | Required | Description                                                                           |
| ---------- | ------------- | -------- | ------------------------------------------------------------------------------------- |
| `category` | string (path) | Yes      | `tax`, `crm`, or `storage`                                                            |
| `provider` | string (path) | Yes      | The provider within that category — `taxjar`, `avalara`, `ziptax`, `hubspot`, or `s3` |

## Example Request

```bash theme={null}
curl -X DELETE "https://api.recurso.dev/v1/integration-connections/crm/hubspot" \
  -H "Authorization: Bearer $API_KEY"
```

## Response

The response is a bare status object, not a `{data}` envelope.

```json theme={null}
{
  "status": "disconnected"
}
```

## Errors

| Status | Code                | When                                                       | Fix                                                                                                       |
| ------ | ------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `400`  | `validation_failed` | `(category, provider)` in the path is not a supported pair | Use a pair shown by [List Integration Connections](/api-reference/integration-connections/list)           |
| `401`  | `unauthorized`      | Missing or invalid API key / session                       | Send `Authorization: Bearer $API_KEY`                                                                     |
| `403`  | `forbidden`         | The session user is not an owner or admin                  | Ask an owner/admin to disconnect                                                                          |
| `404`  | `not_found`         | No active connection exists for that pair                  | Nothing to disconnect — check [List Integration Connections](/api-reference/integration-connections/list) |
| `500`  | `internal_error`    | Deactivating the connection failed                         | Retry; contact support if it persists                                                                     |

Errors use the standard envelope — see [Errors](/api-reference/errors).


## OpenAPI

````yaml DELETE /v1/integration-connections/{category}/{provider}
openapi: 3.1.0
info:
  title: Recurso API
  version: 1.0.0
  description: |
    The Recurso billing engine REST API.

    Authenticate by passing your API key as a bearer token:

        Authorization: Bearer <api_key>

    Obtain an API key by registering a tenant via `POST /auth/register`.
    All authenticated endpoints live under the `/v1` prefix. Mutating
    endpoints support idempotency via the `Idempotency-Key` header.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://billing.example.com
    description: >-
      Example deployment — substitute the base URL of your own Recurso
      deployment.
security:
  - bearerAuth: []
tags:
  - name: System
    description: Health, version, and API metadata
  - name: Auth
    description: Tenant registration
  - name: Plans
    description: Product catalog plans
  - name: Customers
    description: Customer management
  - name: Subscriptions
    description: Subscription lifecycle
  - name: Invoices
    description: Invoices, PDFs, and Indian GST e-invoicing
  - name: Coupons
    description: Discounts
  - name: Usage
    description: Metered usage events
  - name: Credit Notes
    description: Customer credits
  - name: Quotes
    description: Quote-to-invoice lifecycle
  - name: Webhooks
    description: Webhook endpoint management and event feed
  - name: Analytics
    description: Revenue analytics
  - name: Checkout
    description: Public hosted checkout for invoices
  - name: Payments
    description: Payment order creation
  - name: Inbound Webhooks
    description: Receivers for payment-gateway callbacks (Razorpay, Stripe)
  - name: Customer Portal
    description: Customer-facing portal — magic-link auth and session-scoped data
  - name: Developer
    description: API key management
  - name: Account
    description: Tenant account settings
  - name: Finance
    description: Ledger accounts, entries, reconciliation, and revenue recognition
  - name: Settings
    description: Tax (GST) and e-invoicing (IRP) configuration
  - name: Consents
    description: Consent records for RBI-compliant recurring billing
  - name: Referrals
    description: Customer referral program
  - name: Gifts
    description: Gift subscriptions
  - name: Mandates
    description: UPI Autopay mandates
  - name: Offline Payments
    description: Virtual accounts and manually recorded payments
  - name: Organizations
    description: Multi-entity organizations grouping several tenants
  - name: Accounting
    description: QuickBooks / Xero accounting integrations
  - name: Churn
    description: Churn risk scoring and alerts
  - name: Cancel Flows
    description: Configurable retention flows shown at cancellation time
  - name: Dunning
    description: Dunning analytics and multi-channel dunning campaigns
paths:
  /v1/integration-connections/{category}/{provider}:
    delete:
      tags:
        - Integration Connections
      summary: Disconnect a tax/CRM/storage integration
      description: Soft-disconnects the tenant's active connection. Owner/admin only.
      operationId: deleteIntegrationConnection
      parameters:
        - name: category
          in: path
          required: true
          schema:
            type: string
            enum:
              - tax
              - crm
              - storage
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Disconnected.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: disconnected
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials (API key or session cookie).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated but not permitted (insufficient role).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error detail.
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
              examples:
                - validation_failed
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - rate_limited
                - internal_error
                - invalid_api_key
                - key_mode_mismatch
                - over_refund
                - invoice_not_paid
                - invoice_already_paid
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Tenant API key obtained from `POST /auth/register` or `POST
        /v1/developer/keys`.

````