Reference > Nodes

HTTP Request Node

Reference for the n8n HTTP Request node -- methods, authentication, pagination, and common API patterns.

ReferenceIntermediate6 min read

The HTTP Request node sends HTTP requests to any URL and processes the response. It is the most versatile node in n8n, used for calling REST APIs, downloading files, submitting forms, and connecting to services that do not have a dedicated node.

Authentication Methods

Method Description
None No authentication. Suitable for public APIs or endpoints that handle auth via query parameters.
Basic Auth Sends a username and password encoded in the Authorization: Basic header.
Header Auth Sends a custom header (e.g., X-API-Key) with a configured value. Most common for API-key-based services.
OAuth2 Performs a full OAuth2 flow using client credentials or authorization code. Configure the grant type, token URL, and scopes in the credential.
Custom Auth Allows arbitrary credential injection via headers, query parameters, or body fields. Use this when none of the built-in methods fit.
Predefined Credential Select credentials from another node type (e.g., Slack, GitHub) to reuse their auth without a dedicated node.

Tip

When an API requires both a header token and a query parameter (e.g., api_key in the URL), use Custom Auth and define both locations in a single credential.

HTTP Methods

Method Typical Use
GET Retrieve data from an API endpoint.
POST Send a JSON or form payload to create a resource.
PUT Replace a resource entirely.
PATCH Update specific fields on a resource.
DELETE Remove a resource.
HEAD Retrieve response headers without a body.
OPTIONS Check allowed methods or CORS preflight.

Request Body Options

The body configuration depends on the selected Send Body type:

Body Type When to Use
JSON Most REST APIs. Define key-value pairs or provide raw JSON.
Form Data (Multipart) File uploads or APIs that expect multipart/form-data.
Form URL-Encoded APIs that expect application/x-www-form-urlencoded (common in OAuth token exchanges).
Binary Send raw binary data (e.g., uploading a PDF or image). Set the input data property that holds the binary.
Raw Send an arbitrary string body with a custom Content-Type header (e.g., XML, plain text).

Response Handling

Response Type Behavior
JSON Parses the response body as JSON and outputs it as $json. This is the default.
Text Returns the response body as a plain string in $json.data.
Binary Stores the response as a binary property for downstream processing (file write, email attachment).
File Shortcut for downloading a file. Automatically sets the binary property name to data.

Key Parameters

Parameter Description
URL The full endpoint URL. Supports expressions (e.g., https://api.example.com/users/{{ $json.userId }}).
Send Headers Add custom request headers as key-value pairs.
Send Query Parameters Add URL query parameters as key-value pairs.
Timeout Maximum time (in milliseconds) to wait for a response. Default is 300000 (5 minutes).
Redirect > Follow Redirects Whether to follow HTTP 3xx redirects automatically. Enabled by default.
Redirect > Max Redirects Maximum number of redirects to follow (default 21).
Ignore SSL Issues When enabled, accepts self-signed or expired certificates. Use only in development.
Batching > Items per Batch Process items in batches to respect API rate limits. Combine with Batch Interval (ms).
Proxy Route the request through an HTTP or SOCKS proxy.

Pagination

The HTTP Request node has built-in pagination support. Enable it under Options > Pagination and choose a strategy:

Strategy How It Works
Offset-Based Increments an offset (or page) parameter with each request until no more results are returned. Configure the limit parameter name, offset parameter name, and page size.
Cursor-Based Extracts a next cursor or URL from each response and passes it to the next request. Provide an expression to locate the cursor (e.g., $response.body.next_cursor).
URL-Based Follows a next URL returned in the response body or headers (common in APIs that return a Link header).

Pagination stops when the stop condition is met: no more results, a maximum number of pages, or a custom expression evaluates to true.

Note

Pagination merges items from all pages into a single output. If the API returns thousands of records, the workflow will process them all in one batch. Use the Limit option to cap total results.

Common Patterns

Call a REST API and process the response:

Schedule Trigger --> HTTP Request (GET) --> Code (transform) --> Google Sheets (Append)

Configure the URL and authentication, then transform the JSON response with a Code node before storing results.

Download a file and send it by email:

Trigger --> HTTP Request (GET, Binary response) --> Send Email (attachment)

Set Response Type to Binary. The downloaded file is available as a binary property that the email node can attach directly.

Relay an incoming webhook to another service:

Webhook (POST) --> HTTP Request (POST, JSON body)

Forward the incoming payload to a different API. Use expressions in the body fields to map data from {{ $json.body }}.

Paginate through an API and collect all records:

Manual Trigger --> HTTP Request (GET, Pagination: Cursor-Based) --> Spreadsheet File (write)

Enable cursor-based pagination, set the cursor expression to the response field that contains the next page token, and export the combined results.

Tips and Gotchas

Warning: SSL certificate errors

If you see UNABLE_TO_VERIFY_LEAF_SIGNATURE or similar SSL errors, the target server may use a self-signed certificate. Enable Ignore SSL Issues only for development or internal endpoints. In production, install the correct CA certificates on your n8n server instead.

  • Timeout for slow APIs. The default timeout is 5 minutes. For long-running endpoints, increase the Timeout parameter. For very slow operations, consider using a polling pattern instead of a single long request.
  • Expression in URL. The URL field supports expressions. Use {{ $json.url }} or template literals to build dynamic endpoints. Make sure the result is a fully qualified URL.
  • Error handling. By default, HTTP 4xx and 5xx responses throw an error and stop the workflow. To handle errors gracefully, enable Options > Always Output Data or set Continue on Fail on the node.
  • Rate limiting. Use the Batching options to add a delay between requests. Set Items per Batch to 1 and Batch Interval to the required delay (e.g., 1000 for one request per second).
  • Binary input. When sending a binary body (e.g., uploading a file), make sure the upstream node provides binary data. Use the Move Binary Data node to convert between JSON and binary if needed.
  • Response headers. To access response headers, enable Options > Full Response. The output will include statusCode, headers, and body as separate fields.

Common Errors

UNABLE_TO_VERIFY_LEAF_SIGNATURE or other SSL certificate errors. The target server uses a self-signed or improperly configured certificate. For development, enable Ignore SSL Issues in the node options. For production, install the correct CA certificate on your n8n server or set the NODE_EXTRA_CA_CERTS environment variable to the path of your CA bundle.

Request failed with status code 401 even though credentials are configured. The authentication method or credential may be misconfigured. Verify you selected the correct auth type (Header Auth vs. OAuth2 vs. Basic Auth) and that the credential values (API key, token, etc.) are current and not expired. For OAuth2, try reconnecting the credential to refresh the access token.

Response body is empty or undefined when the API returns data. The Response Type may be set incorrectly. If the API returns JSON, make sure Response Type is set to JSON (the default). If you selected Binary or Text by mistake, the JSON data will not be parsed into $json fields. Also check that Options > Full Response is not enabled unintentionally, which wraps the body inside a body sub-key.

See Also

Want this running in your stack?

I build production n8n and Cloudflare automation for teams — the same engineering behind HarperFlow. Fixed-price, escrow-protected, US-based.