API Request
Makes HTTP requests to external APIs with full control over authentication, request body, and response handling.
Overview
The API Request node sends HTTP requests and returns the response. It supports authentication, query parameters, form data uploads, and choosing how to handle the response (JSON, text, or file download). Use it to:
- Integrate with REST APIs that require authentication
- Upload files via multipart form data
- Download files from external services
- Fetch or send data to any HTTP endpoint
Parameters
Request
| Parameter | Description | Required |
|---|---|---|
| Method | HTTP method (GET, POST, PUT, PATCH, DELETE) | Yes |
| URL | Request endpoint (supports expressions) | Yes |
Query Parameters
Add URL query parameters as name-value pairs. Both names and values support expressions.
| Name | Value |
|---|---|
| page | {{\$item.data.page}} |
| limit | 10 |
| search | {{\$item.data.searchTerm}} |
These are appended to the URL automatically, so https://api.example.com/users with the above becomes https://api.example.com/users?page=1&limit=10&search=test.
Headers
Add custom HTTP headers as name-value pairs. Both names and values support expressions.
Body
| Parameter | Description | Required |
|---|---|---|
| Content Type | Format of request body | Yes |
| Body | Request body content (for JSON or Plain Text) | Conditional |
| Form Data Fields | Fields for multipart/form-data uploads | Conditional |
Content Type Options
| Type | Description |
|---|---|
| JSON (application/json) | Send JSON data |
| Form Data (multipart/form-data) | Send form fields and file uploads |
| Plain Text (text/plain) | Send raw text |
| None | No body (typical for GET/DELETE) |
Form Data Fields
When using multipart/form-data, each field has:
- Field Name - the form field name
- Field Value - a text value (optional)
- File - a file to upload (optional)
Each field can have either a text value or a file, not both.
Response
| Parameter | Description | Required |
|---|---|---|
| Response Type | Expected format of the response | Yes |
| File Destination | Where to save the file (when Response Type is File) | Conditional |
| File Name | Name for the downloaded file (optional) | No |
Response Type Options
| Type | Description | Output key |
|---|---|---|
| JSON | Parse response body as JSON (default) | data |
| Text | Return response body as a raw string | body |
| File | Download response as a file | file |
Authorization
| Parameter | Description | Required |
|---|---|---|
| Auth Type | Authentication method | Yes |
Auth Type Options
| Type | Additional Parameters |
|---|---|
| None | No authentication |
| Bearer Token | Bearer Token |
| Basic Auth | Username, Password |
| API Key | Key Name, Key Value, Add To (Header or Query) |
Output
The output item shape depends on the Response Type setting.
JSON (default)
{
"statusCode": 200,
"headers": { "content-type": "application/json" },
"data": { "id": 123, "name": "Example" }
}
The response body is parsed as JSON. If the response is not valid JSON, the node will error.
Text
{
"statusCode": 200,
"headers": { "content-type": "text/plain" },
"body": "Hello, World!"
}
The response body is returned as a raw string.
File
{
"statusCode": 200,
"headers": { "content-type": "application/pdf" },
"file": {
"type": "fileData",
"name": "report.pdf",
"mimeType": "application/pdf"
}
}
The response body is saved to the configured File Destination. The file name is derived from the response Content-Disposition header or URL path, unless overridden by the File Name parameter.
Examples
GET with Bearer Auth
Fetch data from an authenticated API:
- Method:
GET - URL:
https://api.example.com/users/{{\$item.data.userId}} - Auth Type:
Bearer Token - Bearer Token:
{{\$item.data.token}} - Response Type:
JSON
POST with JSON Body
Create a record:
- Method:
POST - URL:
https://api.example.com/orders - Content Type:
JSON - Body:
{"name": "{{$item.data.name}}", "email": "{{$item.data.email}}"} - Response Type:
JSON
Upload a File
Send a file via form data:
- Method:
POST - URL:
https://api.example.com/upload - Content Type:
Form Data - Form Data Fields:
- Field Name:
document, File:{{\$item.file}} - Field Name:
description, Value:{{\$item.data.description}}
- Field Name:
- Auth Type:
API Key - Key Name:
X-API-Key - Key Value:
{{\$item.data.apiKey}} - Add To:
Header
Download a File
Save a file from an API response:
- Method:
GET - URL:
https://api.example.com/reports/{{\$item.data.reportId}}/download - Auth Type:
Bearer Token - Bearer Token:
{{\$item.data.token}} - Response Type:
File - File Destination: Google Drive / OneDrive / Temporary
API Key in Query String
Some APIs expect the key as a query parameter:
- Method:
GET - URL:
https://api.example.com/data - Auth Type:
API Key - Key Name:
api_key - Key Value:
my-secret-key - Add To:
Query Parameter
This sends: https://api.example.com/data?api_key=my-secret-key
Error Handling
HTTP error responses (4xx, 5xx) are returned as normal output items with the corresponding statusCode. They do not cause the node to error. Check statusCode in downstream nodes to handle error responses.
The node will error (sending items to the error output) for:
- Invalid JSON when Response Type is JSON
- Network errors or timeouts
- DNS resolution failures
- Authentication issues with file storage destinations