> For the complete documentation index, see [llms.txt](https://docs.ownchat.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ownchat.app/bot/connections/api-call.md).

# API Call

The **API Call** action allows chatbot builders to connect Ownchat with external systems and APIs to send, retrieve, update, or delete data in real time.

This connection-based action helps businesses integrate chatbot workflows with:

* CRMs
* Payment systems
* Order management systems
* Inventory platforms
* Third-party applications
* Custom backend services

The walkthrough demonstrates configuring API methods, request URLs, headers, query parameters, JSON request bodies, response variables, and publishing the workflow.

{% embed url="<https://app.supademo.com/demo/cmn4kd7y71k4uz3qmw1zo33l5?utm_source=link>" %}

### When to Use API Call &#x20;

Use the API Call action whenever your chatbot needs to communicate with an external server or service.

### Common Use Cases &#x20;

* Creating customer orders
* Retrieving product information
* Updating CRM records
* Fetching delivery status
* Sending payment requests
* Synchronizing chatbot data with external systems

**Example Interaction** &#x20;

Bot: ✅ Your order has been placed successfully.

The chatbot sends the order details to an external API and receives a response in real time.

### How to Add API Call &#x20;

Follow these steps to add the **API Call** action to your bot workflow.

1. Open **Bot Builder**
2. Click the **Add Node** button
3. Open the **Connections** tab
4. Select **API Call**
5. Configure the API request settings
6. Configure the response storage variable
7. Click **Create**
8. Click **Publish** to deploy the workflow

The walkthrough demonstrates selecting the API Call action from the Connections section.

### Accessing the Connections Section &#x20;

To access the API Call action:

1. Click **Add Node**

{% embed url="<https://app.supademo.com/demo/cmpc4k0el02jcv70jlrgns82x?utm_source=link>" %}

2. Open the action selection panel
3. Click the **Connections** tab

{% embed url="<https://app.supademo.com/demo/cmpc4m5vu02jev70jyavg464q?utm_source=link>" %}

The walkthrough specifically notes:

Connection is used to link the bot to external services for real-time data and actions.

### Selecting API Call &#x20;

Inside the Connections tab:

1. Locate **API Call**<br>

{% embed url="<https://app.supademo.com/demo/cmpc4nvpu0c9pz70jcjvv0ioe?utm_source=link>" %}

2. Click the action to open the configuration panel

The walkthrough describes the API Call action as:

API Call Action – to send requests to external APIs and get or update data in real time for your bot actions.

### API Call Configuration &#x20;

When configuring the **API Call** action, several fields must be completed.

#### Action Name &#x20;

The **Action Name** identifies the API request workflow inside the bot builder.

This name is visible only within the workflow editor.<br>

{% embed url="<https://app.supademo.com/demo/cmpc4p2o30cjrxa0j2hh44143?utm_source=link>" %}

Example &#x20;

Create Order API\
Update Customer API\
Get Product Details

The walkthrough demonstrates renaming the default action to:

API call

before saving the configuration.

### HTTP Methods &#x20;

The **Method** field defines the type of API request being performed.

Available methods shown in the walkthrough include:

* GET
* POST
* PUT
* PATCH
* DELETE

#### GET Method &#x20;

Used to retrieve data from the server.<br>

{% embed url="<https://app.supademo.com/demo/cmpc4r0b60c9rz70jbzijie0v?utm_source=link>" %}

**Example** &#x20;

GET /products

The walkthrough specifically notes:

GET method is used to retrieve data from the server.

#### POST Method &#x20;

Used to create new data on the server.<br>

{% embed url="<https://app.supademo.com/demo/cmpc4wtxx0c9tz70jn7i4iacg?utm_source=link>" %}

**Example** &#x20;

POST /create-order

The walkthrough selects:

POST

as the active request method.

#### PUT Method &#x20;

Used to fully update an existing resource.<br>

{% embed url="<https://app.supademo.com/demo/cmpc4xnqd0001xi0jw3kxvi6c?utm_source=link>" %}

Example &#x20;

PUT /customer/101

#### PATCH Method &#x20;

Used to partially update an existing resource.

{% embed url="<https://app.supademo.com/demo/cmpc4ylhf0003xi0js6ww720t?utm_source=link>" %}

**Example** &#x20;

PATCH /customer/status

#### DELETE Method &#x20;

Used to remove data from the server.<br>

{% embed url="<https://app.supademo.com/demo/cmpc502sa0cjxxa0jnzba616n?utm_source=link>" %}

Example &#x20;

DELETE /order/1001

#### URL &#x20;

The **URL** field specifies the API endpoint where the request should be sent.

{% embed url="<https://app.supademo.com/demo/cmpc50zst0ck4xa0jc4k6dbuo?utm_source=link>" %}

**Example** &#x20;

<https://api.example.com/create-order>

The walkthrough specifically notes:

Enter the URL, which is the address where the bot sends the request to access or update data.

### Content Type &#x20;

The **Content Type** field defines the request payload format.<br>

{% embed url="<https://app.supademo.com/demo/cmpc526lo0005xi0jpzjqraq6?utm_source=link>" %}

The walkthrough specifies:

JSON

as the mandatory content type selection.

### Headers &#x20;

The **Headers** section allows additional request information to be sent with the API request.<br>

{% embed url="<https://app.supademo.com/demo/cmpc547hh0007xi0jzcddd500?utm_source=link>" %}

Headers are commonly used for:

* Authentication
* Content type validation
* API access tokens

To configure:

1. Enter the header key<br>

{% embed url="<https://app.supademo.com/demo/cmpc569jz0009xi0jbthcphxb?utm_source=link>" %}

2. Enter the corresponding value<br>

{% embed url="<https://app.supademo.com/demo/cmpc580ii000dxi0jo94gxqf5?utm_source=link>" %}

Example &#x20;

Key: Content-Type\
Value: application/json

The walkthrough demonstrates configuring the Content-Type header.

### Query Parameters &#x20;

The **Query Parameters** section allows additional URL parameters to be sent with the request.<br>

{% embed url="<https://app.supademo.com/demo/cmpc5adt402n1v70ja38nmk4y?utm_source=link>" %}

To configure:

1. Enter the parameter key
2. Enter the corresponding value

**Example** &#x20;

store\_id = 123456\
source = Chatbot

The walkthrough demonstrates adding multiple query parameters to the API request.

#### Request Body &#x20;

The **Body** section contains the API request payload in JSON format.<br>

{% embed url="<https://app.supademo.com/demo/cmpc5biqb0cmdxa0jji5yduny?utm_source=link>" %}

The walkthrough specifically notes:

The API Call body is used to define the action in JSON format.

#### Example JSON Body &#x20;

{\
&#x20; "customer\_name": "{{customer.name}}",\
&#x20; "phone": "{{customer.phone}}",\
&#x20; "order\_item": "{{bot.selected\_item}}",\
&#x20; "quantity": "{{bot.quantity}}",\
&#x20; "address": "{{bot.delivery\_address}}"\
}

The walkthrough demonstrates dynamically inserting chatbot variables into the JSON request body.

### Variable Type &#x20;

The **Variable Type** field defines how the API response should be stored.

Available types shown include:

* Object
* Array

The walkthrough specifically selects:

Array

when the API response contains multiple items or values.<br>

{% embed url="<https://app.supademo.com/demo/cmpc5d27x0cmfxa0jltq3bymc?utm_source=link>" %}

### Store Response Variable &#x20;

The **Store Response Variable** field defines where the API response should be saved.

To configure:

1. Select an existing variable\
   or
2. Create a new variable

The walkthrough demonstrates creating:

order\_response

as the API response variable.<br>

{% embed url="<https://app.supademo.com/demo/cmpc5e6fa000hxi0jieolv01v?utm_source=link>" %}

### Creating the API Call Action &#x20;

After configuring all API request settings:

1. Review the request configuration
2. Click the **Create** button<br>

{% embed url="<https://app.supademo.com/demo/cmpc5fdlz02nqv70ju0k1vl1w?utm_source=link>" %}

The API Call node will now appear inside the workflow canvas.

### Workflow Behavior &#x20;

Once triggered, the **API Call action**:

* Sends requests to external APIs
* Retrieves or updates real-time data
* Supports all major HTTP methods
* Stores API responses dynamically
* Enables third-party workflow integrations

The walkthrough demonstrates creating an order request and storing the response dynamically inside the chatbot workflow.

### Example Workflow &#x20;

#### Example Chatbot Workflow &#x20;

Collect Order Details\
&#x20;       ↓\
API Call\
&#x20;       ↓\
Send Order Data to Server\
&#x20;       ↓\
Receive API Response\
&#x20;       ↓\
Send Confirmation Message

**Example Interaction** &#x20;

Bot: Your order has been submitted successfully ✅\
Order ID: 45872

The chatbot sends customer data to the API and receives a confirmation response.

### Publishing the Bot Changes &#x20;

After configuring the API Call workflow:

1. Review the request configuration
2. Click the **Publish** button
3. Deploy the updated workflow to production

{% embed url="<https://app.supademo.com/demo/cmpc5gewo000jxi0jlgjcq6tw?utm_source=link>" %}

The walkthrough concludes by publishing the API-integrated chatbot workflow successfully.

### Best Practices &#x20;

Follow these recommendations when using **API Call.**

### Use meaningful action names &#x20;

Clearly identify the purpose of each API request.

### Validate API endpoints &#x20;

Ensure the API URL is correct and accessible.

### Use proper HTTP methods &#x20;

Choose GET, POST, PUT, PATCH, or DELETE appropriately.

### Secure sensitive data &#x20;

Avoid exposing API tokens or confidential credentials.

### Test API responses before publishing &#x20;

Verify that the chatbot handles successful and failed responses correctly.

### Summary &#x20;

The **API Call** action allows chatbot builders to connect Ownchat with **external APIs and third-party systems in real time.**

With **API Call**, you can:

* Send and retrieve real-time data
* Integrate external platforms and services
* Use all major HTTP request methods
* Send dynamic JSON request payloads
* Store API responses in chatbot variables

This connection action helps businesses create **powerful integrated chatbot workflows and real-time automation experiences within Ownchat**
