> ## 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.

# HTTP API Integration in ChatSyncs

> How to connect ChatSyncs to any external REST API — configure the endpoint and body, test it, map the response into bot variables, or let the AI API Builder do it for you.

<Frame>
  <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-01-http-api-list.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=7c74fa7ba8576e33d1580d892da1246b" alt="ChatSyncs left navigation with Chatbot Manager selected, the Integrations tab highlighted, the HTTP API sub-tab highlighted, and the HTTP API list with a Create button" width="1268" height="546" data-path="images/learn/http-api-integration/step-01-http-api-list.png" />
</Frame>

**Chatbot Manager → Integrations → HTTP API** connects ChatSyncs to any
external REST API (**GET**, **POST**, **PUT**, **PATCH**, **DELETE**) — the general-purpose way
to hook a bot flow up to a system ChatSyncs doesn't natively integrate with: a CRM, an order
tracker, a payment gateway, a booking system, an ERP, or an inventory system.

## Add HTTP API

<Frame>
  <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-02-add-http-api.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=45854c25ebbce90a3c76ff990662477f" alt="Add HTTP API page showing the four-step flow: API Details, Request Data, Test and Verify, Response Mapping, with an AI API Builder panel on the right" width="1127" height="489" data-path="images/learn/http-api-integration/step-02-add-http-api.png" />
</Frame>

**Real-world example:** an e-commerce store wants its bot to answer "Where is my order?" by
calling its own Order API.

> **Customer:** Where is my order?
> **Bot:** Please enter your Order ID.
> **Customer:** ORD12345

The bot sends an HTTP request to the store's Order API and gets back:

```json theme={null}
{
  "order_id": "ORD12345",
  "status": "Shipped",
  "courier": "BlueDart",
  "tracking_id": "BD987654321"
}
```

The bot replies:

> Your order has been **Shipped** via **BlueDart**.
> Tracking ID: **BD987654321**

Here's the full four-step setup that makes that possible:

<Steps>
  <Step title="API Details">
    Enter the **API Name** (e.g. `Get Order Details`), **Method** (e.g. `POST`), and
    **API Endpoint URL** (e.g. `https://api.mystore.com/orders/details`).

    <Frame>
      <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-03-api-details-and-request-body-real-example.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=bb359c687ffbe33763d1ff17aa355f46" alt="Edit HTTP API wizard showing API Details filled in with API Name Wovenly Order Status, Method GET, and an API Endpoint URL, next to the Request Data Body tab and the AI API Builder panel on the right" width="1645" height="737" data-path="images/learn/http-api-integration/step-03-api-details-and-request-body-real-example.png" />
    </Frame>

    This is a real example: an API called **Wovenly Order Status**, set to **GET**, pointed at
    an endpoint that looks up an order by ID.
  </Step>

  <Step title="Request Data">
    Choose the request **Body** format — **Default**, **Form Data**,
    **x-www-form-urlencoded**, **JSON**, or **Binary**.

    Use a dynamic variable for whatever the customer typed:

    ```json theme={null}
    { "order_id": "{{order_id}}" }
    ```

    If the customer enters `ORD12345`, the actual request sent becomes
    `{ "order_id": "ORD12345" }`.

    Add whatever else the API needs:

    * **Headers** — e.g. `Authorization: Bearer YOUR_ACCESS_TOKEN`, `Content-Type: application/json`
    * **Option Data** — extra parameters some APIs require, e.g. `language = en`, `store = bangalore`
    * **Cookies** — only if the API needs session cookies for authentication; leave empty
      otherwise

    **Another real example** — a lookup API that needs three pieces of customer data. Each
    **Key** (`Name`, `Number`, `Email`) is set to **Type: Dynamic Value**, then wired to the
    matching field ChatSyncs already knows about the subscriber (**Full Name**, **Phone
    Number**, **Email**) — so the request is built automatically from data already collected
    in the conversation, with nothing for the customer to retype:

    <Frame>
      <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-04-request-body-dynamic-fields.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=800bb6986014ff45ac482d0956120bdf" alt="Request Data Body panel with three Key/Type/Value rows: Name set to Dynamic Value Full Name, Number set to Dynamic Value Phone Number, and Email set to Dynamic Value Email" width="1024" height="543" data-path="images/learn/http-api-integration/step-04-request-body-dynamic-fields.png" />
    </Frame>
  </Step>

  <Step title="Test & Verify">
    Enable **Use Sample Data (Recommended)** so detected variables get filled with sample
    values automatically, then click **Send Test Request**. A working API returns something
    like:

    ```json theme={null}
    {
      "order_id": "ORD12345",
      "status": "Delivered",
      "courier": "BlueDart",
      "tracking_id": "BD987654321",
      "delivery_date": "2026-06-28"
    }
    ```

    Don't move on until this test succeeds — an untested endpoint can fail silently mid-flow
    later.

    Continuing the Name/Number/Email example from Step 2, ChatSyncs detects the three variables
    and lets you type in test values, then shows the real response it got back:

    <Frame>
      <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-05-test-verify-real-response.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=0ab2a37d4074134e3c79d3f01e9d97a3" alt="Test & Verify panel with Detected Variables Full Name, Phone Number, and Email test-value fields, and a Last Response panel showing a successful reply with Name Rahul Reddy, Email, Mobile, Package, and Package ID" width="1571" height="368" data-path="images/learn/http-api-integration/step-05-test-verify-real-response.png" />
    </Frame>
  </Step>

  <Step title="Response Mapping">
    Map each field in the response to a variable the bot can use anywhere:

    | API Response    | Variable            |
    | --------------- | ------------------- |
    | `status`        | `{{status}}`        |
    | `courier`       | `{{courier}}`       |
    | `tracking_id`   | `{{tracking_id}}`   |
    | `delivery_date` | `{{delivery_date}}` |

    The bot can now reply with any combination of these:

    ```
    Your order is {{status}}.
    Courier: {{courier}}
    Tracking ID: {{tracking_id}}
    Delivered On: {{delivery_date}}
    ```

    which the customer sees as:

    > Your order is **Delivered**.
    > Courier: **BlueDart**
    > Tracking ID: **BD987654321**
    > Delivered On: **28 June 2026**

    <Frame>
      <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-06-response-mapping-real-example.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=0e2e7688f2fe15c7744a6512e496e239" alt="Response Mapping panel with the response field containing Name, Email, Mobile, Package, and Package ID selected, next to a Map To Custom Field search box, and the Data Formatters panel on the right" width="1566" height="468" data-path="images/learn/http-api-integration/step-06-response-mapping-real-example.png" />
    </Frame>
  </Step>
</Steps>

## Data Formatters

Next to Response Mapping, the **Data Formatters** panel lets you transform a mapped field before
the bot uses it — for example, reformatting a date, or trimming extra text out of a value the
API returned. Click **New** to create one.

<Frame>
  <img src="https://mintcdn.com/chatsyncs/HNsP4MLygnS_qtAH/images/learn/http-api-integration/step-07-data-formatters-new.png?fit=max&auto=format&n=HNsP4MLygnS_qtAH&q=85&s=947645027e608c341a699a57909d5b8e" alt="Data Formatters panel with a search box, an empty Formatter Definition table, and a New button highlighted" width="509" height="414" data-path="images/learn/http-api-integration/step-07-data-formatters-new.png" />
</Frame>

<Note>
  You don't need a formatter for most APIs — only reach for one when the raw value an API returns
  isn't already in the shape you want to show the customer.
</Note>

## AI API Builder (Beta)

Instead of manually filling in every field, the **AI API Builder** panel next to the form can
generate the whole configuration for you from one of:

* **Describe in English** — e.g. "I have an Order API that accepts an Order ID and returns the
  order status, courier name, tracking ID, and delivery date."
* **Paste cURL**
* **Paste your API Docs**
* **Paste JSON**

The AI fills in the **API Endpoint**, **Request Method**, **Headers**, **Request Body**,
**Variables**, and **Response Mapping** automatically.

<Tip>
  Always review and **Send Test Request** on an AI-generated configuration before relying on it in
  a live bot flow — treat it as a first draft, not a finished, verified integration.
</Tip>

## Complete workflow

<Steps>
  <Step title="Enter API Details">API Name, Method, and Endpoint URL.</Step>
  <Step title="Configure the request">Body format (JSON, Form Data, etc.), Headers, Option Data, Cookies.</Step>
  <Step title="Send a test request">Use sample data, then confirm the response looks right.</Step>
  <Step title="Map the response">Assign each response field to a bot variable.</Step>
  <Step title="Save the API">It's now available to any flow.</Step>
  <Step title="Use the mapped variables">Reference them anywhere in your chatbot flow.</Step>
</Steps>

## Use cases

* **CRM integration** — look up or update a customer record.
* **Order tracking** — the walkthrough above.
* **Payment verification** — confirm a transaction before continuing a flow.
* **Customer lookup** — pull account details by phone number or email.
* **Booking systems** — check availability or confirm a reservation.
* **ERP / inventory integration** — check stock before promising a delivery date.

## Frequently asked

<AccordionGroup>
  <Accordion title="How do I connect my store's own Order API to my WhatsApp bot?">
    Use **Chatbot Manager → Integrations → HTTP API → Create**: enter the endpoint and method, configure the
    request body with a dynamic variable like `{{order_id}}`, test it, then map the response
    fields (status, courier, tracking ID, etc.) to bot variables you can use in a reply.
  </Accordion>

  <Accordion title="Can I connect an API without manually configuring every field?">
    Yes — use the **AI API Builder (Beta)** panel: describe the API in plain English, paste a
    cURL command, paste its docs, or paste raw JSON, and it generates the endpoint, headers,
    body, variables, and response mapping for you. Always test the result before using it live.
  </Accordion>

  <Accordion title="My HTTP API request needs authentication — where does that go?">
    Add it under **Headers** in the Request Data step — most APIs expect something like
    `Authorization: Bearer YOUR_ACCESS_TOKEN`. If the API instead uses session cookies, use the
    **Cookies** section.
  </Accordion>
</AccordionGroup>

<Warning>
  **Test an HTTP API before relying on it in a live bot flow** — use **Send Test Request** with
  sample data first. An untested endpoint can silently fail mid-conversation, leaving the
  customer with a broken reply instead of an error you can catch early.
</Warning>

## Learn From a Use Case

* [Clinic Appointment Booking Automation](/learn/clinic-appointment-booking-automation-with-chatsyncs-business-problem) —
  an optional extension to connect to an external hospital management system.
* [Bank Balance Inquiry Automation](/learn/bank-balance-inquiry-automation-with-chatsyncs-business-problem) — a full
  request/response call to an external n8n workflow, with Response Mapping driving the reply.
