API Calling

This section contains essential information and usage guidelines for managing and using the API Request tool within AI Agents on BotPenguin.

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

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

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

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

  2. Scroll or search for “API Request” and click to select it.

  1. A configuration card will appear containing:

  • Dropdown to Select API

  • Buttons: “Add and Save” and “Add and Next”

  1. 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 APIs section.

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

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

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

What is the API Request Tool used for?

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

Can I use multiple APIs in one agent?

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

How can I add a new API?

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.

What is the difference between “Add and Save” and “Add and Next”?

“Add and Save” saves the API and exits the setup. “Add and Next” saves the API and keeps the prompt editor open for additional setup.

Where do I map API responses?

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

Can I store data fetched from an API?

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

What should be written in the API prompt?

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

What happens if an API fails?

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


If you still have questions for our team, write to us at [email protected]. We’ll get back to you within 48 hours.

Last updated

Was this helpful?