# How to use Call API component

<figure><img src="/files/s6Mn5metVQALsWhEJydW" alt=""><figcaption></figcaption></figure>

#### <mark style="color:$primary;">**What Is the Call API Action Component?**</mark>

The Call API action component in DoubleTick's Bot Studio allows you to **connect your bot journey to any external or internal API**. This means your bot can fetch real-time data, send information to your CRM or backend system, trigger actions in third-party tools, or retrieve dynamic content — all without leaving the bot flow.

Whether you want your bot to check order status, validate a customer's input against your database, or push lead data to your internal system, the Call API component makes it possible.

***

#### <mark style="color:$primary;">**Where Do You Use It?**</mark>

You can add the Call API component at any point in your bot journey — wherever you need the **bot to communicate with an external or internal system**. Common use cases include:

* Fetching product or order details based on a customer's input
* Sending collected lead information to a CRM
* Add a collaborator to the chat&#x20;

***

<figure><img src="/files/GNuBz7mQLTJYgNyxSLz1" alt=""><figcaption></figcaption></figure>

#### <mark style="color:$primary;">**How to Add the Call API Component to Your Journey**</mark>

1. Open **Bot Studio** and **navigate to the journey** you are building or editing.
2. Go to the **Actions** section in the component panel.
3. Find the **Call API component** and drag it to the point in your journey where you want the API call to happen.
4. Drop it onto the canvas at the desired position.

On the component, locate the dropdown labeled **Select an API** and click on it. From the options displayed, choose the green **Create New API** option to set up a new API configuration.

You now have **two options** to configure your API:

#### <mark style="color:$primary;">**Option 1: Fill In the Details Manually**</mark>

If you have your API details handy, you can enter them one by one. Here is what you need to fill in:

* **Name**: Give your API a clear, recognizable name so you can identify it later.
* **Method**: Select the HTTP method — GET, POST, PUT, DELETE, etc.
* **API URL**: Enter the full endpoint URL.
* **Headers**: Add any required headers. This is where your API key or authorization token typically goes.
* **Body**: Enter the request body in JSON format if your API requires it.

Once all details are filled in:

1. Click on **Test API** to send a test request.
2. The API response will appear on the right side of the panel under API Response.
3. If the response looks correct, click **Save API** to save the configuration.

***

#### <mark style="color:$primary;">**Option 2: Import from cURL**</mark>

If you already have a cURL command for your API, this option saves you time by auto-filling all the details in one go.

1. At the **bottom left corner** of the API configuration panel, click **Import from cURL.**
2. A text box will appear. **Paste your cURL command** into the box.
3. Give your API a **name** in the Name field (for example: "Test").
4. Click **Test API** to send the request.
5. Once the response appears in the API Response field on the right, click **Save API** to save it.

**All your API details — method, URL, headers, and body — will be automatically extracted from the cURL and populated into the respective fields.**

***

#### <mark style="color:$primary;">**After Saving**</mark>

Once the API is saved, it will appear in the Select an API dropdown going forward. You can reuse the same API across multiple journeys without having to configure it again.

After selecting your saved API in the journey, connect the component's output nodes to the next steps in your flow based on whether the API call succeeds or fails. This allows you to define different bot responses depending on the API's result.

***

#### <mark style="color:$primary;">Things to Keep in Mind</mark>

* Always test your API before saving to ensure you are getting the expected response.
* If your API requires authentication, make sure the API key or token is added correctly in the Headers section.
* When entering the request body, ensure it is valid JSON. Invalid formatting will cause the API call to fail.
* You can edit a saved API at any time by going back into the Call API component and selecting the API from the dropdown.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.doubletick.io/bot-studio/actions/data-and-apis/how-to-use-call-api-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
