API Request

The API Request component lets you connect your flows to external APIs by sending customizable HTTP requests and handling responses.

API Request

Component description

How the API Request component works

API Request Component

The API Request component is a versatile tool designed to facilitate HTTP requests within your AI workflows. It enables your workflow to interact with external APIs or web services by sending requests to one or more URLs and processing the responses. This capability is essential for tasks such as data retrieval, integration with third-party services, or invoking custom endpoints as part of automated or intelligent processes.

What Does the Component Do?

This component allows you to configure and send HTTP requests (GET, POST, PATCH, PUT) to specified URLs. You can customize the request by adding headers, query parameters, and a request body. It also supports handling form data and setting custom timeouts, making it suitable for a wide range of API interactions.

Inputs

The API Request component supports the following configurable inputs:

FieldDescriptionTypeDefault/Options
URLEnter one or more target URLs, separated by commas.String
MethodHTTP method to use for the request.DropdownGET, POST, PATCH, PUT
HeadersCustom headers to include in the request (as a dictionary).Dictionary/Data
BodyData payload for POST, PATCH, or PUT requests (as a dictionary).Dictionary/Data
Query ParametersKey-value pairs to append as URL query parameters.Dictionary/Data
Use Form DataToggle to send data as application/x-www-form-urlencoded.Booleanfalse
TimeoutTime (in seconds) before the request times out.Integer5
Cache TTLHow long to cache the API response. Set to ‘No cache’ to disable.DropdownNo cache, 5 min, … etc.
VerboseIf enabled, prints verbose output for debugging.Booleanfalse
Tool NameName for this API request tool (for use by agents).String
Tool DescriptionDescription to help agents understand how to use this tool.String (multiline)

Outputs

The component produces two main outputs:

Output NameTypeDescription
DataDataThe response data from the API request.
ToolToolMakes this API request available as a “tool” for agent-based workflows.

Why Use This Component?

  • Integration: Connect your AI workflow to any external API or web service, making it easy to augment your processes with new data or actions.
  • Flexibility: Supports multiple HTTP methods, custom headers, bodies, and query parameters—suitable for simple and complex API calls alike.
  • Caching: Optionally caches responses to improve performance and reduce redundant API calls.
  • Form Data Support: Easily submit form-encoded data for compatible endpoints.
  • Agent-Friendly: Define tool names and descriptions so the component can be used as a tool by agent-based AI workflows.

Example Use Cases

  • Retrieve real-time data (e.g., weather, news, finance) from public APIs.
  • Submit information to a third-party service (e.g., CRM, ticketing system).
  • Integrate with custom backend endpoints for data processing or workflow automation.
  • Enable LLM agents to call external APIs as part of their reasoning or task execution.

Summary

The API Request component is an essential building block for any AI process that needs to interact with web services or external data sources. It offers a comprehensive set of configuration options to handle a wide variety of HTTP request scenarios, and its outputs can be used directly or made available as a tool for agent-based AI workflows.

Examples of flow templates using API Request component

To help you get started quickly, we have prepared several example flow templates that demonstrate how to use the API Request component effectively. These templates showcase different use cases and best practices, making it easier for you to understand and implement the component in your own projects.

Frequently asked questions

What does the API Request component do?

The API Request component enables your flow to send HTTP requests (GET, POST, PATCH, PUT) to one or more URLs, letting you connect with any external API or web service.

Can I customize the headers and body of my API requests?

Yes, you can add custom headers and body content to suit your target API. Both can be set using data inputs or dictionaries.

Does it support query parameters and different HTTP methods?

Absolutely. You can append query parameters to your URL and choose from various HTTP methods, including GET, POST, PATCH, and PUT.

Can I cache API responses?

Yes, you can configure how long API responses should be cached, or disable caching entirely, offering control over data freshness and performance.

Is this component suitable for integrating with third-party tools?

Yes, it's designed for seamless integration with virtually any third-party service that exposes an API, making it a core component for automation and advanced workflows.

Connect Flows to Any API

Start adding real-time data, third-party services, or custom integrations to your flows using API Request.

Learn more