> For the complete documentation index, see [llms.txt](https://docs.taqnyat.sa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taqnyat.sa/product-docs/core-concepts/building-a-chatbot-scenario/api-call.md).

# API Call

The **API Call** unit allows the chatbot to communicate with external systems such as CRM or ERP platforms by sending or receiving data through an API.&#x20;

It can be used to retrieve live information or send data collected during the conversation to another system.

## Steps

{% stepper %}
{% step %}

### Add an API Call unit

Add the **API Call** unit at the point where the chatbot needs to exchange data with an external system.
{% endstep %}

{% step %}

### Configure the request

The unit supports:

* **Request URL** — The endpoint the chatbot should call.
* **Method** — `GET` or `POST`.
* **Headers** — Add required tokens, credentials, or other header values.
* **Data / Payload** — Add the request data that should be sent.
  {% endstep %}

{% step %}

### Handle the response

The API response can be stored and reused inside the chatbot scenario.

The unit includes:

* **Key** — The variable name where the returned value will be stored.
* **Value** — The data received from the external system.&#x20;

#### Example

The guide provides an example of sending feedback to an external system using a `POST` request:

```http
POST https://api.example.com/feedback
```

Example headers:

```
access-token: your_API_key
mobile: 966508292156
Content-Type: application/json
```

Example payload:

```json
{
  "number": "12021626",
  "feedback": [
    {
      "category_id": "1",
      "category_value": "1",
      "category_note": "I was happy"
    }
  ]
}
```

Example response:

```json
{
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "status": "OK"
  }
}
```

{% endstep %}
{% endstepper %}

### What’s next?

Continue to **Chatbot Editor Tools** to learn how to use filters, built-in variables, conditions, and other tools while building the scenario.
