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

# External AI Agent Support — Solution

> How ChatSyncs' Incoming Webhook and Developer API let a company's own external AI agent (built in n8n, OpenAI, or any other stack) receive and reply to WhatsApp messages, with ChatSyncs acting purely as the WhatsApp transport layer instead of the AI itself. Use this when a customer wants their existing AI agent to own the reasoning while ChatSyncs just moves the messages.

* Every customer message ChatSyncs receives is instantly forwarded to the company's own server
  via the Incoming Webhook — the same AI agent already running elsewhere gets to see it, with no
  retraining or duplicate setup inside ChatSyncs.
* That AI agent — with its own tools, memory, and training — decides what to say, exactly as it
  already does on its other channels.
* The AI's reply is sent back to the customer through ChatSyncs' Developer API, as a plain text
  message or as interactive Reply Buttons, whichever the AI decides fits the moment.
* ChatSyncs never sees the AI's training data or internal tools — it only relays the incoming
  message out and the finished reply back in, so nothing sensitive has to move into a
  third-party Knowledge Base.

## Business Benefits

* Reuse an AI agent that's already built, trained, and proven — no second implementation to
  maintain in parallel
* Keep proprietary data, tools, and business logic entirely on infrastructure the company
  already controls
* Replies can be plain text or interactive buttons, so the AI isn't limited to one message
  format
* WhatsApp customers get the same quality of answer as every other channel that AI already
  supports

## Workflow Diagram

```mermaid theme={null}
flowchart TD
    Customer -->|WhatsApp message| ChatSyncs[ChatSyncs Bot]
    ChatSyncs --> Incoming["Incoming Webhook: POST to external server"]
    Incoming --> N8N["n8n Webhook Node"]
    N8N --> Agent["AI Agent: Chat Model + Memory"]
    Agent --> Switch{"Switch: reply type"}
    Switch -->|Interactive| SendButtons["ChatSyncs API: Send Interactive Buttons"]
    Switch -->|Text| Code["Code in JavaScript: format reply"]
    Code --> SendText["ChatSyncs API: Send Text Message"]
    SendButtons --> CustomerReply[Customer receives reply]
    SendText --> CustomerReply
```

<CardGroup cols={2}>
  <Card title="Previous: Business Problem" icon="arrow-left" href="/learn/external-ai-agent-support-business-problem">
    Why this is worth solving.
  </Card>

  <Card title="Next: Implementation Guide" icon="arrow-right" href="/learn/external-ai-agent-support-implementation">
    Build it step by step.
  </Card>
</CardGroup>
