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

# Disconnect WhatsApp account

> Forcibly disconnects the WhatsApp account currently linked to a specific user. If the user has an active WhatsApp connection, the session is terminated, sync is stopped and credentials are revoked. The response includes identifiers of the disconnected WhatsApp account and phone number together with a disconnected=true flag and the disconnection timestamp. If the user has no active WhatsApp account, the operation is treated as an idempotent no-op and returns disconnected=false. The call is still subject to standard partner authentication and workspace ownership checks.



## OpenAPI

````yaml post /workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect
openapi: 3.0.3
info:
  title: Partner API
  version: 1.0.1
  description: >-
    Partner-facing HTTP API used by approved integrators to provision and manage
    TimelinesAI workspaces, users and WhatsApp connections on behalf of their
    customers. All endpoints are versioned under /partner/api/v1 and secured
    with JWT bearer authentication. Obtaining a workspace Public API token,
    together with the capabilities of the Public API such as webhook
    subscriptions, enables partners to build complex integrations for their
    customers.
servers:
  - url: /partner/api/v1
    description: Partner API root URL
security:
  - bearerAuth: []
tags:
  - name: workspaces
  - name: users
  - name: whatsappAccounts
  - name: qr
  - name: publicAPI
paths:
  /workspaces/{workspace_id}/users/{user_id}/whatsapp/disconnect:
    post:
      tags:
        - whatsappAccounts
      summary: Disconnect WhatsApp account
      description: >-
        Forcibly disconnects the WhatsApp account currently linked to a specific
        user. If the user has an active WhatsApp connection, the session is
        terminated, sync is stopped and credentials are revoked. The response
        includes identifiers of the disconnected WhatsApp account and phone
        number together with a disconnected=true flag and the disconnection
        timestamp. If the user has no active WhatsApp account, the operation is
        treated as an idempotent no-op and returns disconnected=false. The call
        is still subject to standard partner authentication and workspace
        ownership checks.
      operationId: disconnectWA
      parameters:
        - $ref: '#/components/parameters/X-TL-Partner-Id'
        - name: workspace_id
          in: path
          required: true
          description: The unique identifier for the workspace.
          schema:
            type: string
        - name: user_id
          in: path
          required: true
          description: The unique identifier for the user.
          schema:
            type: integer
      responses:
        '200':
          description: WhatsApp disconnected
          headers:
            X-TL-API-Version:
              schema:
                type: string
              description: Partner API version. Current version is v1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerAPIDisconnectResponse'
        '404':
          $ref: '#/components/responses/UserNotFound'
components:
  parameters:
    X-TL-Partner-Id:
      name: X-TL-Partner-Id
      in: header
      description: The unique identifier for the partner.
      required: true
      schema:
        type: string
  schemas:
    PartnerAPIDisconnectResponse:
      type: object
      properties:
        workspace_id:
          type: string
          description: Unique identifier for the workspace
        user_id:
          type: integer
          description: Unique identifier for the user
        disconnected:
          type: boolean
          description: Indicates whether a WhatsApp account was disconnected
          default: true
        disconnected_at:
          type: string
          description: Timestamp of the disconnection event
          format: date-time
          example: '2024-01-01T12:00:00Z'
        whatsapp_account_id:
          type: integer
          description: ID of the disconnected WhatsApp account
        phone_number:
          type: string
          description: Phone number associated with the disconnected WhatsApp account
        description:
          type: string
          description: Additional information about the disconnection
      description: >-
        Response payload for a WhatsApp disconnect operation. Indicates whether
        a WhatsApp account was actually disconnected for the given user,
        provides the disconnection timestamp, and, when applicable, echoes the
        workspace_id, user_id, whatsapp_account_id and phone_number involved in
        the operation.
    PartnerAPIError:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code
        status:
          type: integer
          description: HTTP status code
        description:
          type: string
          description: Human-readable error description
      required:
        - error
        - status
      description: >-
        Standard error envelope used by Partner API endpoints. The error field
        contains a machine-readable error code such as partner_not_found,
        partner_not_active, invalid_signature, timestamp_out_of_range,
        workspace_not_found, workspace_not_owned_by_partner or
        workspace_billing_managed. The status field repeats the HTTP status
        code, and description may contain a human-readable explanation suitable
        for logs and troubleshooting.
  responses:
    UserNotFound:
      description: User not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PartnerAPIError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer authentication. The token payload must include partner_id,
        nbf (not-before) and exp (expiry) claims. All Partner API requests must
        be authenticated with Authorization: Bearer <token>.

````