Skip to main content

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

ParameterDescriptionRequired
MethodHTTP method (GET, POST, PUT, PATCH, DELETE)Yes
URLRequest endpoint (supports expressions)Yes

Query Parameters

Add URL query parameters as name-value pairs. Both names and values support expressions.

NameValue
page{{\$item.data.page}}
limit10
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

ParameterDescriptionRequired
Content TypeFormat of request bodyYes
BodyRequest body content (for JSON or Plain Text)Conditional
Form Data FieldsFields for multipart/form-data uploadsConditional

Content Type Options

TypeDescription
JSON (application/json)Send JSON data
Form Data (multipart/form-data)Send form fields and file uploads
Plain Text (text/plain)Send raw text
NoneNo 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

ParameterDescriptionRequired
Response TypeExpected format of the responseYes
File DestinationWhere to save the file (when Response Type is File)Conditional
File NameName for the downloaded file (optional)No

Response Type Options

TypeDescriptionOutput key
JSONParse response body as JSON (default)data
TextReturn response body as a raw stringbody
FileDownload response as a filefile

Authorization

ParameterDescriptionRequired
Auth TypeAuthentication methodYes

Auth Type Options

TypeAdditional Parameters
NoneNo authentication
Bearer TokenBearer Token
Basic AuthUsername, Password
API KeyKey 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}}
  • 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