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

# Update Chatwoot

> Updates an existing Chatwoot integration (404 NOT_CONNECTED otherwise). enabled toggles mirroring; rotating any credential re-runs the full connect and recreates the inbox; action="reconnect" rebuilds the inbox reusing the saved credentials; channelMode switches the inbox mode.



## OpenAPI

````yaml openapi.json PATCH /v1/chatwoot
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/chatwoot:
    patch:
      tags:
        - Chatwoot
      summary: Update Chatwoot
      description: >-
        Updates an existing Chatwoot integration (404 NOT_CONNECTED otherwise).
        enabled toggles mirroring; rotating any credential re-runs the full
        connect and recreates the inbox; action="reconnect" rebuilds the inbox
        reusing the saved credentials; channelMode switches the inbox mode.
      operationId: patch_chatwoot
      parameters:
        - name: x-whatsapp-number-id
          in: header
          required: false
          description: >-
            Scopes to a single number (required for tenant keys / per-number
            OAuth grants).
          schema:
            type: string
          example: num_01HZX...
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  description: false pauses mirroring without disconnecting; true resumes.
                  example: false
                instanceUrl:
                  type: string
                  description: Base URL of the Chatwoot instance.
                accountId:
                  type: string
                  description: Chatwoot account id (numeric string).
                userAccessToken:
                  type: string
                  description: Chatwoot user access token (agent/admin api_access_token).
                action:
                  type: string
                  enum:
                    - reconnect
                  description: reconnect = rebuild the inbox reusing the saved credentials.
                channelMode:
                  type: string
                  enum:
                    - auto
                    - api
                    - native
                  description: >-
                    Channel preference: auto (default), api (force mirror
                    inbox), native (force whatsapp_cloud inbox when eligible).
      responses:
        '200':
          description: Chatwoot integration status
          content:
            application/json:
              example:
                connected: true
                status: connected
                enabled: true
                inboxId: '42'
                instanceUrl: https://app.chatwoot.com
                accountId: '1'
                hasToken: true
                channelMode: auto
                lastError: null
                lastErrorCode: null
                lastSyncAt: '2026-07-13T12:00:00.000Z'
        '400':
          description: Validation error, or Chatwoot rejected the credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Validation error
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '404':
          description: Chatwoot is not connected for this number
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Chatwoot is not connected for this number
                code: NOT_CONNECTED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````