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

# Disconnect an email account

> Soft-disconnects the account: stops the mailbox watch (Gmail `users.stop`, Outlook subscription delete), marks the `EmailAccount` `isActive: false`, and clears `historyId` / `watchExpiration`. The stored OAuth tokens are kept on the document but the account no longer participates in sync.



## OpenAPI

````yaml /api-reference/openapi.yaml delete /api/email/accounts/{accountId}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/email/accounts/{accountId}:
    delete:
      tags:
        - Email
      summary: Disconnect an email account
      description: >-
        Soft-disconnects the account: stops the mailbox watch (Gmail
        `users.stop`, Outlook subscription delete), marks the `EmailAccount`
        `isActive: false`, and clears `historyId` / `watchExpiration`. The
        stored OAuth tokens are kept on the document but the account no longer
        participates in sync.
      operationId: delete_email_accounts_accountId
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            type: string
          description: Internal `_id` of the `EmailAccount` document.
      responses:
        '200':
          description: Account disconnected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailAccountDisconnectResponse'
        '404':
          description: Account not found or not owned by the caller
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailErrorResponse'
        '500':
          description: Unable to disconnect account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    EmailAccountDisconnectResponse:
      type: object
      description: Response from `DELETE /api/email/accounts/{accountId}`.
      properties:
        success:
          type: boolean
          enum:
            - true
      required:
        - success
      additionalProperties: true
      example:
        success: true
    EmailErrorResponse:
      type: object
      description: >-
        Error envelope returned by Email feature endpoints. Most paths only set
        `error`; a few include `code` for diagnostic context (e.g. provider
        mismatches).
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
      required:
        - error
      additionalProperties: true
      example:
        error: Email account not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````