# API Request Tool

### What is the API Request Tool?

The **API Request Tool** enables AI Agents to make live calls to external APIs within a conversation. This tool allows BotPenguin’s AI Agents to fetch or send data dynamically — extending their capabilities far beyond static responses.

***

### Benefits of the API Request Tool

* ⚙️ **Enhances automation:** Lets agents fetch or update external data in real time.
* 🌐 **Improves interoperability:** Integrates with any third-party API through standard request mapping.
* 💬 **Personalizes user experience:** Tailors responses using live information from external sources.
* 📊 **Simplifies data handling:** Automatically manages parameters and attributes for each call.
* 🚀 **Speeds up configuration:** Allows creating, testing, and mapping APIs directly from the platform.

***

### How to Use the API Request Tool

1. Log in to your BotPenguin platform and click on “Agents” from the left sidebar.
2. Select a previously built agent or click on “Create New Agent.”

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

3. If creating new: choose “Build From Scratch” and click “Next.”

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

4. You will arrive at the Agent Personality and Instructions section. Navigate to Prompt to edit or add instructions for your AI Agent.

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

5. To access the API Request Tool, click on the backslash (“/”) icon within the prompt editor conversations flow instructions. A dropdown will appear listing all available tools.
6. Scroll or search for “API Request” and click to select it.

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

7. A configuration card will appear containing:

* Dropdown to Select API
* Buttons: “Add and Save” and “Add and Next”

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

8. From the Select API dropdown, choose an existing API to be used by your Agent.

* If no API exists or a new one is required, click “Create API Request” — you’ll be redirected to the third party Api section.

{% content-ref url="/pages/cu0HvGLfTpAxBz37qQwN" %}
[Using Third-Party APIs with BotPenguin](/developers-guide/using-third-party-apis-with-botpenguin.md)
{% endcontent-ref %}

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

9. Click “Add and Save” to finalize configuration or “Add and Next” to continue adding prompts.

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

10. Enter the API Prompt, which defines how the Agent should interact with the API.

> Be descriptive — specify what data the API needs, the type of request, and expected outcomes.

11. Once added, the API call will be embedded into the Agent’s prompt at that exact point in the conversation flow.

**Recommendation:**\
Always describe before and after the API call in the prompt — specify:

* What the API request is for.
* Where in the conversation flow it fits.
* Which data points it requires or generates.

***

### FAQs&#x20;

<details>

<summary>What is the API Request Tool used for?</summary>

It allows your AI Agent to make external API calls directly from within the BotPenguin platform, enabling real-time data exchange.

</details>

<details>

<summary>Can I use multiple APIs in one agent?</summary>

Yes. Multiple API requests can be integrated at different stages of the Agent’s prompt flow.

</details>

<details>

<summary>How can I add a new API?</summary>

Click on **“Create API Request”** under the API selection dropdown. You’ll be redirected to the Third-Party APIs section to configure and save it.

</details>

<details>

<summary>What is the difference between “Add and Save” and “Add and Next”?</summary>

**“Add and Save”** saves the API and exits the setup.\
\&#xNAN;**“Add and Next”** saves the API and keeps the prompt editor open for additional setup.

</details>

<details>

<summary>Where do I map API responses?</summary>

Go to **Developer → Third-Party APIs → Add API**.\
There, you can manage response structure and map data fields to attributes.

</details>

<details>

<summary>Can I store data fetched from an API?</summary>

Yes. Use **Custom Attributes** under the **More** section to store and reuse fetched data in your AI Agent’s logic.

</details>

<details>

<summary>What should be written in the API prompt?</summary>

Describe how the API should behave, the purpose of the request, and what inputs or outputs are expected.

</details>

<details>

<summary>What happens if an API fails?</summary>

If an API call fails, the Agent will continue executing the next prompt step. You can design fallback responses for such cases.

</details>

***

If you still have questions for our team, write to us at [**support@botpenguin.com**](mailto:support@botpenguin.com). We’ll get back to you within 48 hours.


---

# 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://help.botpenguin.com/ai-agents/creating-ai-agents-in-botpenguin/setting-up-your-ai-agent/api-request-tool.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.
