• How
  • to
  • call
  • http
  • requests

How to Call HTTP Requests in n8n

Amit Hariyale

Amit Hariyale

Full Stack Web Developer, Gigawave

8 min read · April 14, 2026

You're building an n8n workflow that needs to pull data from a third-party API, but the HTTP Request node's 47 configuration options feel overwhelming. You copy a cURL command, paste it into n8n, and hit execute—only to get a 401 Unauthorized error...

This is the reality for most developers and automation engineers working with n8n. The HTTP Request node is powerful but unforgiving. Misconfigure authentication, headers, or body format and your workflow fails silently or worse, returns cryptic errors that waste hours of debugging...

Key Concepts Covered

callhttprequestsn8n
  • n8n HTTP Request node
  • REST API integration
  • Workflow automation
  • OAuth2 and API key authentication
  • n8n expressions and dynamic data
  • Error handling in n8n workflows
  • Response format parsing (JSON, binary, string)

Context Setup

n8n is an open-source workflow automation tool that connects services through a visual node-based interface. The HTTP Request node is its Swiss Army knife for external API communication—supporting REST, GraphQL, and raw HTTP calls.

Prerequisites: - n8n instance running (cloud or self-hosted v1.0+) - Basic understanding of HTTP methods (GET, POST, PUT, DELETE) - API endpoint URL and authentication credentials for your target service

Problem Breakdown

  • Webhook triggers fire but downstream systems never receive data
  • OAuth tokens expire mid-workflow with no refresh mechanism
  • Binary data (PDFs, images) corrupts during transfer due to incorrect response format handling

Solution Overview

Chosen Approach: Master the HTTP Request node through methodical configuration—starting with simple GET requests, progressing to authenticated POSTs with JSON bodies, and implementing robust error handling.

Why This Over Alternatives: - n8n's dedicated app nodes (Stripe, Slack, etc.) are limited; HTTP Request handles any REST API - Custom Code nodes add maintenance burden; HTTP Request is native and version-controlled - Webhook nodes are inbound-only; HTTP Request...

Basic Auth:** Username/password for legacy systems

snippet-1.text
1filename: n8n-http-get-config.json 2language: json 3purpose: HTTP Request node configuration for a simple GET call with query parameters 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "GET", 9 "url": "https://api.example.com/v1/users", 10 "sendQuery": true, 11 "queryParameters": { 12 "parameters": [ 13 { 14 "name": "limit", 15 "value": "10" 16 }, 17 { 18 "name": "status", 19 "value": "active" 20 } 21 ] 22 }, 23 "options": { 24 "response": { 25 "response": { 26 "responseFormat": "json" 27 } 28 } 29 } 30 }, 31 "name": "Get Users", 32 "type": "n8n-nodes-base.httpRequest", 33 "typeVersion": 4.1 34 } 35 ] 36}

Header Auth:** API keys passed in custom headers

snippet-2.text
1filename: n8n-http-post-auth.json 2language: json 3purpose: HTTP Request node configuration for authenticated POST with dynamic JSON body 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "POST", 9 "url": "https://api.example.com/v1/orders", 10 "authentication": "genericCredentialType", 11 "genericAuthType": "httpHeaderAuth", 12 "sendBody": true, 13 "bodyParameters": { 14 "parameters": [ 15 { 16 "name": "customer_id", 17 "value": "={{ $json.customerId }}" 18 }, 19 { 20 "name": "items", 21 "value": "={{ JSON.stringify($json.items) }}" 22 }, 23 { 24 "name": "total", 25 "value": "={{ $json.total }}" 26 } 27 ] 28 }, 29 "options": { 30 "bodyContentType": "json", 31 "response": { 32 "response": { 33 "responseFormat": "json" 34 } 35 } 36 } 37 }, 38 "name": "Create Order", 39 "type": "n8n-nodes-base.httpRequest", 40 "typeVersion": 4.1 41 } 42 ] 43}

OAuth2:** For services requiring token exchange

snippet-3.text
1filename: n8n-error-handling.json 2language: json 3purpose: Workflow structure showing HTTP Request node with error output connected to notification 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "GET", 9 "url": "https://api.example.com/v1/critical-data", 10 "options": { 11 "timeout": 10000 12 } 13 }, 14 "name": "Fetch Critical Data", 15 "type": "n8n-nodes-base.httpRequest", 16 "typeVersion": 4.1 17 }, 18 { 19 "parameters": { 20 "subject": "API Failure Alert", 21 "message": "={{ \"HTTP request failed: \" + $json.message }}", 22 "toEmail": "ops@example.com" 23 }, 24 "name": "Send Alert", 25 "type": "n8n-nodes-base.emailSend" 26 } 27 ], 28 "connections": { 29 "Fetch Critical Data": { 30 "main": [ 31 [ 32 { 33 "node": "Process Data", 34 "type": "main", 35 "index": 0 36 } 37 ], 38 [ 39 { 40 "node": "Send Alert", 41 "type": "main", 42 "index": 0 43 } 44 ] 45 ] 46 } 47 } 48}

Additional Implementation Notes

  • Generic Credential Type:** For custom auth schemes
  • JSON:** For REST APIs ({"key": "value"})
  • Form-Data:** For file uploads or legacy endpoints
  • Raw:** For XML or custom formats

Best Practices

  • Store API keys and tokens in n8n Credentials, never in node parameters
  • Use Expression mode (={{ }}) for dynamic values, not manual concatenation
  • Set explicit Timeout values based on API SLAs (typically 10-30 seconds)
  • Enable Always Output Data in node settings to prevent workflow stoppage
  • Version-control workflow JSON exports for rollback capability
  • Hardcode secrets in URL parameters (visible in logs)
  • Ignore the error output branch — always handle failures
  • Use responseFormat: string for JSON APIs (adds manual parsing step)

Pro Tips

  • Batch Requests: Use n8n's Split In Batches node with HTTP Request inside to process large datasets without memory...
  • Credential Scoping: Create separate credentials for read-only vs. write operations; n8n's RBAC can restrict node access per credential
  • Response Caching: For expensive or slow APIs, insert Function node to cache responses in static data: `$getWorkflowStaticData('global').cache =...
  • Webhook Response Simulation: Use HTTP Request node against https://webhook.site to inspect exact headers and body your API receives
  • Binary Uploads: For file uploads, use bodyContentType: multipart-form-data and reference binary data from previous nodes with `={{ $binary.data...

Resources

Final Thoughts

The HTTP Request node is n8n's escape hatch when no dedicated integration exists. Master it and you can connect any REST API to your automation stack. The configuration complexity is the tradeoff for universal compatibility.

Next Step: Export your first working HTTP Request workflow, then modify it to call a production API you use daily. Start with read-only GET requests before implementing state-changing POST/PUT operations.

Full Generated Content (Unabridged)

Only real code appears in code blocks. Other content is rendered as normal headings, lists, and text.

Blog Identity

  • title: How to Call HTTP Requests in n8n
  • slug: how-to-call-http-requests-n8n
  • primary topic keyword: n8n HTTP Request node
  • target stack: n8n, workflow automation, REST APIs

SEO Metadata

  • seoTitle: How to Call HTTP Requests in n8n (Complete Guide)
  • metaDescription: Learn to call HTTP requests in n8n using the HTTP Request node. Master GET, POST, authentication, and error handling with practical examples.
  • suggestedTags: n8n, HTTP Request, workflow automation, REST API, no-code automation
  • suggestedReadTime: 8 min

Hero Hook

You're building an n8n workflow that needs to pull data from a third-party API, but the HTTP Request node's 47 configuration options feel overwhelming. You copy a cURL command, paste it into n8n, and hit execute—only to get a 401 Unauthorized error with no clear path forward.

This is the reality for most developers and automation engineers working with n8n. The HTTP Request node is powerful but unforgiving. Misconfigure authentication, headers, or body format and your workflow fails silently or worse, returns cryptic errors that waste hours of debugging time.

Context Setup

n8n is an open-source workflow automation tool that connects services through a visual node-based interface. The HTTP Request node is its Swiss Army knife for external API communication—supporting REST, GraphQL, and raw HTTP calls.

Prerequisites:

  • n8n instance running (cloud or self-hosted v1.0+)
  • Basic understanding of HTTP methods (GET, POST, PUT, DELETE)
  • API endpoint URL and authentication credentials for your target service

Problem Breakdown

Key Failure Points:

PitfallSymptomRoot Cause
Authentication misconfiguration401/403 errorsWrong auth type or credential format
Body format mismatch400 Bad RequestSending JSON as form-data or wrong Content-Type
Missing headersUnexpected 200 with empty dataAPI requires specific headers (Accept, User-Agent)
SSL/TLS issuesConnection refusedSelf-signed certs or outdated TLS versions
Rate limiting429 Too Many RequestsNo retry logic or delay between calls

Real Project Symptoms:

  • Webhook triggers fire but downstream systems never receive data
  • OAuth tokens expire mid-workflow with no refresh mechanism
  • Binary data (PDFs, images) corrupts during transfer due to incorrect response format handling

Solution Overview

Chosen Approach: Master the HTTP Request node through methodical configuration—starting with simple GET requests, progressing to authenticated POSTs with JSON bodies, and implementing robust error handling.

Why This Over Alternatives:

  • n8n's dedicated app nodes (Stripe, Slack, etc.) are limited; HTTP Request handles any REST API
  • Custom Code nodes add maintenance burden; HTTP Request is native and version-controlled
  • Webhook nodes are inbound-only; HTTP Request enables outbound integration

Implementation Steps

Step 1: Add and Configure the HTTP Request Node

Drag the HTTP Request node onto your canvas. Double-click to open configuration.

Set Method to GET for data retrieval. Paste your API endpoint into URL. For public APIs, start with https://httpbin.org/get to verify connectivity.

Step 2: Configure Authentication

Click Authentication dropdown. Select the method matching your API:

  • Basic Auth: Username/password for legacy systems
  • Header Auth: API keys passed in custom headers
  • OAuth2: For services requiring token exchange
  • Generic Credential Type: For custom auth schemes

Create credentials via the Select Credential dropdown → Create New Credential.

Step 3: Set Headers and Query Parameters

Expand Options → Add Option → Headers. Common requirements:

HeaderValueWhen Needed
Content-Typeapplication/jsonPOST/PUT with JSON body
Acceptapplication/jsonAPI returns multiple formats
User-Agentn8n-workflow/1.0APIs blocking default agents

For query parameters, use Send Query Parameters instead of hardcoding in URL.

Step 4: Configure Request Body (POST/PUT)

Set Body Content Type to match your API's expectation:

  • JSON: For REST APIs ({"key": "value"})
  • Form-Data: For file uploads or legacy endpoints
  • Raw: For XML or custom formats

Use n8n expressions {{ $json.fieldName }} to inject dynamic data from previous nodes.

Step 5: Handle Response and Errors

In Options, enable Response Format → JSON for automatic parsing. Set Timeout to prevent hanging requests (default 300000ms).

Add an Error Trigger node or connect the HTTP Request's second output (error branch) to handle failures gracefully.

Code Snippets

Snippet 1: Basic GET Request Configuration

code-snippet-1.text
1filename: n8n-http-get-config.json 2language: json 3purpose: HTTP Request node configuration for a simple GET call with query parameters 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "GET", 9 "url": "https://api.example.com/v1/users", 10 "sendQuery": true, 11 "queryParameters": { 12 "parameters": [ 13 { 14 "name": "limit", 15 "value": "10" 16 }, 17 { 18 "name": "status", 19 "value": "active" 20 } 21 ] 22 }, 23 "options": { 24 "response": { 25 "response": { 26 "responseFormat": "json" 27 } 28 } 29 } 30 }, 31 "name": "Get Users", 32 "type": "n8n-nodes-base.httpRequest", 33 "typeVersion": 4.1 34 } 35 ] 36}

Snippet 2: POST Request with JSON Body and Bearer Token

code-snippet-2.text
1filename: n8n-http-post-auth.json 2language: json 3purpose: HTTP Request node configuration for authenticated POST with dynamic JSON body 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "POST", 9 "url": "https://api.example.com/v1/orders", 10 "authentication": "genericCredentialType", 11 "genericAuthType": "httpHeaderAuth", 12 "sendBody": true, 13 "bodyParameters": { 14 "parameters": [ 15 { 16 "name": "customer_id", 17 "value": "={{ $json.customerId }}" 18 }, 19 { 20 "name": "items", 21 "value": "={{ JSON.stringify($json.items) }}" 22 }, 23 { 24 "name": "total", 25 "value": "={{ $json.total }}" 26 } 27 ] 28 }, 29 "options": { 30 "bodyContentType": "json", 31 "response": { 32 "response": { 33 "responseFormat": "json" 34 } 35 } 36 } 37 }, 38 "name": "Create Order", 39 "type": "n8n-nodes-base.httpRequest", 40 "typeVersion": 4.1 41 } 42 ] 43}

Snippet 3: Error Handling Workflow Branch

code-snippet-3.text
1filename: n8n-error-handling.json 2language: json 3purpose: Workflow structure showing HTTP Request node with error output connected to notification 4code: { 5 "nodes": [ 6 { 7 "parameters": { 8 "method": "GET", 9 "url": "https://api.example.com/v1/critical-data", 10 "options": { 11 "timeout": 10000 12 } 13 }, 14 "name": "Fetch Critical Data", 15 "type": "n8n-nodes-base.httpRequest", 16 "typeVersion": 4.1 17 }, 18 { 19 "parameters": { 20 "subject": "API Failure Alert", 21 "message": "={{ \"HTTP request failed: \" + $json.message }}", 22 "toEmail": "ops@example.com" 23 }, 24 "name": "Send Alert", 25 "type": "n8n-nodes-base.emailSend" 26 } 27 ], 28 "connections": { 29 "Fetch Critical Data": { 30 "main": [ 31 [ 32 { 33 "node": "Process Data", 34 "type": "main", 35 "index": 0 36 } 37 ], 38 [ 39 { 40 "node": "Send Alert", 41 "type": "main", 42 "index": 0 43 } 44 ] 45 ] 46 } 47 } 48}

Code Explanation

Snippet 1 Breakdown:

  • "method": "GET" — Retrieves data without side effects
  • "sendQuery": true — Enables query parameter builder instead of URL concatenation
  • "responseFormat": "json" — Automatically parses JSON responses into n8n's data structure

What Can Go Wrong: Omitting responseFormat leaves binary or text responses unparsed, forcing manual JSON.parse in downstream nodes.

Snippet 2 Breakdown:

  • "authentication": "genericCredentialType" — Uses credential store instead of hardcoded secrets
  • "value": "={{ $json.customerId }}" — n8n expression injecting data from previous node's output
  • "bodyContentType": "json" — Sets Content-Type: application/json header automatically

What Can Go Wrong: Forgetting JSON.stringify() on array/object fields causes [object Object] to be sent literally. Always stringify nested data in expression mode.

Snippet 3 Breakdown:

  • "timeout": 10000 — Prevents indefinite hangs (10 seconds vs. default 5 minutes)
  • Error output (index 1 in connections) — Captures HTTP 4xx/5xx and network failures separately from success path

Validation Checklist

  • [ ] Execute node with Test Step — confirm 200 OK status in output panel
  • [ ] Verify response data structure matches expectations in JSON view
  • [ ] Check Headers tab for correct Content-Type and Authorization values
  • [ ] Test with invalid credentials — confirm error branch triggers appropriately
  • [ ] Validate expression outputs using Execute Node on preceding node first
  • [ ] Confirm timeout behavior by testing with intentionally slow endpoint

Expected Results:

  • Successful calls return parsed JSON in {{ $json }} variable
  • Failed calls route to error branch with message, description, and httpCode fields
  • Binary responses (images, PDFs) appear as binary property with mimeType metadata

Edge Cases

ScenarioBehaviorMitigation
Empty response bodyReturns {} or [] depending on responseFormatCheck status code 204 explicitly before parsing
Redirects (3xx)Follows up to 5 redirects automaticallyDisable with followRedirect: false in options if harmful
Large payloads (>10MB)May timeout or memory-limit n8nStream to file using responseFormat: file
Self-signed SSL certificatesConnection fails in productionUpload CA cert or set rejectUnauthorized: false (insecure)
API rate limiting (429)Immediate failureImplement Split In Batches + Wait node retry pattern
OAuth token expiration401 mid-workflowUse n8n's built-in OAuth2 credential with auto-refresh

Best Practices

Do:

  • Store API keys and tokens in n8n Credentials, never in node parameters
  • Use Expression mode (={{ }}) for dynamic values, not manual concatenation
  • Set explicit Timeout values based on API SLAs (typically 10-30 seconds)
  • Enable Always Output Data in node settings to prevent workflow stoppage
  • Version-control workflow JSON exports for rollback capability

Don't:

  • Hardcode secrets in URL parameters (visible in logs)
  • Ignore the error output branch — always handle failures
  • Use responseFormat: string for JSON APIs (adds manual parsing step)
  • Chain HTTP requests without Wait nodes when hitting rate-limited APIs
  • Trust self-signed certificates in production environments

Pro Tips

  • Batch Requests: Use n8n's Split In Batches node with HTTP Request inside to process large datasets without memory issues — set batch size to match API rate limits
  • Credential Scoping: Create separate credentials for read-only vs. write operations; n8n's RBAC can restrict node access per credential
  • Response Caching: For expensive or slow APIs, insert Function node to cache responses in static data: $getWorkflowStaticData('global').cache = $json
  • Webhook Response Simulation: Use HTTP Request node against https://webhook.site to inspect exact headers and body your API receives
  • Binary Uploads: For file uploads, use bodyContentType: multipart-form-data and reference binary data from previous nodes with ={{ $binary.data }}

Resources

Official Sources:

  • n8n HTTP Request Node Documentation (https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)
  • n8n Credentials and Authentication (https://docs.n8n.io/credentials/)
  • n8n Expressions (https://docs.n8n.io/code/expressions/)
  • MDN Web Docs: HTTP Methods (https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
  • MDN Web Docs: HTTP Headers (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)

High-Signal Community References:

  • n8n Community Forum: HTTP Request Best Practices (https://community.n8n.io/c/questions/5)
  • HTTP Bin Testing Service (https://httpbin.org/) — Official testing endpoint for request inspection

Final Thoughts

The HTTP Request node is n8n's escape hatch when no dedicated integration exists. Master it and you can connect any REST API to your automation stack. The configuration complexity is the tradeoff for universal compatibility.

Next Step: Export your first working HTTP Request workflow, then modify it to call a production API you use daily. Start with read-only GET requests before implementing state-changing POST/PUT operations.

Preview Card Data

  • previewTitle: Call HTTP Requests in n8n Like a Pro
  • previewDescription: Master the HTTP Request node with authentication, error handling, and real-world patterns for reliable API automation.
  • previewDateText: Published now
  • previewReadTime: 8 min read
  • previewTags: n8n, HTTP, API, automation, workflow

Image Plan

  • hero image idea: Split-screen visualization showing n8n node canvas on left, HTTP Request configuration panel on right, with glowing connection line between them
  • inline visual 1: Screenshot of HTTP Request node authentication dropdown with credential selector highlighted
  • inline visual 2: Diagram showing error branch routing from HTTP Request node to Email and Slack notification nodes
  • inline visual 3: Side-by-side comparison of raw HTTP response vs. parsed JSON output in n8n data panel
  • alt text intent: "n8n HTTP Request node configuration interface showing method, URL, and authentication settings"

Key Concepts

  • n8n HTTP Request node
  • REST API integration
  • Workflow automation
  • OAuth2 and API key authentication
  • n8n expressions and dynamic data
  • Error handling in n8n workflows
  • Response format parsing (JSON, binary, string)
Pro TipBatch Requests: Use n8n's Split In Batches** node with HTTP Request inside to process large datasets without memory...
Next Blog