All Posts

n8n HTTP Requests: Building Custom API Integrations

Pre-built integrations only get you so far—eventually you need to call custom APIs. Master n8n's HTTP Request node to connect any system with proper authentication, pagination, and error handling.

n8n HTTP Requests: Building Custom API Integrations

Published on
February 22, 2026

Overview

Pre-built integrations handle the obvious connections—Salesforce to HubSpot, Slack to Google Sheets, the workflows everyone needs. But GTM engineering demands more. You need to pull data from that niche enrichment API, push leads to your custom-built scoring service, or sync with an internal tool your company built last quarter. That's where n8n's HTTP Request node becomes indispensable.

The HTTP Request node transforms n8n from a visual automation platform into a universal API connector. Any system with an API—whether it's documented or obscure, REST or GraphQL—becomes accessible to your workflows. For GTM engineers managing complex multi-tool stacks, this capability is the difference between building workarounds and building solutions.

This guide walks you through building custom API integrations with n8n's HTTP Request node. You'll learn authentication patterns, pagination handling, error management, and the practical techniques that separate brittle integrations from production-ready workflows. Whether you're connecting to Clay's enrichment APIs or your company's internal lead scoring system, these patterns apply universally.

Why HTTP Requests Matter for GTM Engineers

GTM stacks are rarely simple. The average revenue team uses 10+ tools, and those tools don't always talk to each other natively. When you need to coordinate Clay, CRM, and sequencer in one flow, pre-built integrations only get you so far.

Consider common scenarios where HTTP Request nodes become essential:

  • Custom enrichment sources: Your company subscribes to a specialized data provider that doesn't have n8n integration
  • Internal APIs: Engineering built a lead scoring service or product usage tracker that needs to feed your outbound workflows
  • Newer tools: That hot new GTM tool hasn't been around long enough for integration coverage
  • Advanced features: The pre-built node doesn't expose the API endpoint you need
  • Webhook receivers: You need to transform incoming webhook data before routing it downstream

Tools like Octave recognize this fragmentation challenge, providing context layers that help unify data across disparate systems. But the plumbing—the actual API calls that move data between tools—still requires solid HTTP fundamentals.

HTTP Request Node Fundamentals

The HTTP Request node supports all standard HTTP methods, authentication schemes, and request configurations. Understanding its architecture helps you build integrations faster.

Request Methods

The method determines what action you're taking against the API:

Method Use Case GTM Example
GET Retrieve data Fetch enrichment data, pull lead scores, get account info
POST Create resources Create contacts, submit leads to scoring API, trigger sequences
PUT Replace resources Update entire contact record, replace account data
PATCH Partial updates Update specific fields like lead score or status
DELETE Remove resources Remove contacts from sequences, delete test data

Core Configuration Options

Every HTTP Request node requires these decisions:

  • URL: The endpoint you're calling. Use expressions to inject dynamic values: https://api.example.com/contacts/{{ $json.contact_id }}
  • Authentication: How you prove you're allowed to make the request (covered in detail below)
  • Headers: Metadata about your request, like Content-Type or custom API version headers
  • Query Parameters: Data appended to the URL for filtering or pagination
  • Body: The payload you're sending (for POST, PUT, PATCH requests)
Expression Syntax

n8n uses double curly braces for expressions. Reference previous node data with {{ $json.fieldName }}. This becomes essential when you're mapping fields between CRM, sequencer, and analytics.

Authentication Patterns for API Integrations

Authentication failures cause most HTTP Request frustrations. Understanding the patterns helps you debug faster and build more secure integrations.

API Key Authentication

The simplest pattern. The API provides a key; you include it in every request. Location varies by API:

1
Header authentication: Add a custom header like X-API-Key: your_key_here or Authorization: ApiKey your_key_here
2
Query parameter: Append to URL as ?api_key=your_key_here (less secure, avoid when possible)
3
n8n credentials: Create a "Generic Credential" in n8n settings to avoid hardcoding keys in workflows

Bearer Token / OAuth

Most modern APIs use bearer tokens, often obtained through OAuth flows:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

For OAuth-protected APIs, n8n offers several approaches:

  • OAuth2 credential type: n8n handles token refresh automatically
  • Manual token management: Store tokens in n8n credentials, build refresh logic into your workflow
  • Service accounts: Some APIs offer long-lived tokens for server-to-server communication

Basic Authentication

Username and password encoded in Base64. Still common with legacy systems and some enrichment providers:

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

n8n's HTTP Request node handles Basic auth natively—just select the authentication type and enter credentials.

Security Best Practice

Never hardcode credentials in workflow nodes. Always use n8n's credential store. This protects secrets when sharing workflows and enables credential rotation without editing every workflow.

Handling API Pagination

APIs returning large datasets implement pagination to manage response sizes. When you're pulling thousands of contacts or enrichment records, handling pagination correctly separates functional integrations from complete ones.

Common Pagination Patterns

Pattern How It Works Implementation
Offset-based Request page by number or offset ?page=2 or ?offset=100&limit=100
Cursor-based API returns cursor for next page ?cursor=abc123 from previous response
Link header Next page URL in response headers Parse Link header for rel="next"

Building a Pagination Loop

n8n's Loop Over Items node combined with HTTP Request handles pagination elegantly:

1
Initial request: Make first API call, capture total count or next cursor from response
2
Loop setup: Use IF node to check if more pages exist (cursor not null, page < total pages)
3
Subsequent requests: HTTP Request node inside loop, incrementing page/offset or using cursor
4
Aggregate results: Merge node combines all pages into single dataset for downstream processing

This pattern matters especially when you're pulling data for prospect research automation or syncing large contact lists between systems.

Error Handling and Retry Logic

APIs fail. Networks timeout. Rate limits trigger. Production-ready integrations anticipate these failures and handle them gracefully.

Common API Error Responses

Status Code Meaning Recommended Action
400 Bad request Check your request format, required fields
401 Unauthorized Verify credentials, check token expiration
403 Forbidden Check permissions, API access level
404 Not found Verify endpoint URL, check if resource exists
429 Rate limited Implement backoff, respect Retry-After header
500 Server error Retry with exponential backoff

Implementing Retry Logic

The HTTP Request node includes built-in retry options, but you can build more sophisticated logic:

  • Built-in retries: Configure retry count and wait time in node settings
  • Error branch: Use n8n's error handling to route failures to notification or logging nodes
  • Conditional retry: IF node checks status code, retry only on 429 or 5xx errors
  • Exponential backoff: Wait 1s, 2s, 4s between retries to avoid overwhelming the API

This robustness is especially critical when you're handling Clay rate limits and API quotas in high-volume outbound workflows.

Rate Limit Headers

Many APIs return rate limit information in response headers: X-RateLimit-Remaining, X-RateLimit-Reset. Parse these to implement proactive throttling instead of waiting for 429 errors.

Practical GTM Integration Examples

Theory becomes useful when applied. Here are HTTP Request patterns that GTM engineers use daily.

Example 1: Custom Enrichment API

Calling an enrichment provider that doesn't have n8n integration:

Method: POST
URL: https://api.enrichmentprovider.com/v2/company
Headers:
  Authorization: Bearer {{ $credentials.enrichmentApiKey }}
  Content-Type: application/json
Body:
{
  "domain": "{{ $json.company_domain }}",
  "fields": ["employee_count", "industry", "technologies"]
}

The response feeds into your AI-powered research and scoring workflow.

Example 2: Internal Lead Scoring Service

Your engineering team built a custom scoring model. Connect it to your GTM workflow:

Method: POST
URL: https://internal-api.yourcompany.com/scoring/predict
Headers:
  X-Internal-Token: {{ $credentials.internalApiToken }}
  Content-Type: application/json
Body:
{
  "company_size": {{ $json.employee_count }},
  "industry": "{{ $json.industry }}",
  "technologies": {{ $json.tech_stack }},
  "engagement_signals": {{ $json.signals }}
}

The score returned can then route leads using confidence-weighted sequencing to pick the right cadence.

Example 3: Syncing to Custom CRM Fields

Pushing enrichment data to CRM via API when the native integration doesn't support custom objects:

Method: PATCH
URL: https://api.salesforce.com/services/data/v57.0/sobjects/Contact/{{ $json.salesforce_id }}
Headers:
  Authorization: Bearer {{ $credentials.sfAccessToken }}
  Content-Type: application/json
Body:
{
  "Custom_Score__c": {{ $json.lead_score }},
  "Qualification_Reason__c": "{{ $json.qualification_reason }}",
  "Last_Enriched__c": "{{ $now.toISOString() }}"
}

This pattern is essential when syncing Clay data to CRM with scores, reasons, and next steps.

Advanced HTTP Request Techniques

Beyond basic requests, several advanced patterns elevate your integrations.

Dynamic URL Construction

Build URLs from workflow data using expressions:

https://api.example.com/v2/{{ $json.resource_type }}/{{ $json.resource_id }}/{{ $json.action }}

This enables single HTTP Request nodes to handle multiple resource types based on incoming data.

Response Transformation

APIs rarely return data in exactly the format you need. Use the Set node or Code node after HTTP Request to transform responses:

  • Flatten nested objects: Convert company.details.employee_count to employee_count
  • Rename fields: Match your downstream system's expected field names
  • Type conversion: Parse strings to numbers, format dates
  • Filter fields: Strip unnecessary data to reduce payload size

Batching Requests

Some APIs support batch endpoints. Instead of 100 individual calls, send one request with 100 items:

Method: POST
URL: https://api.example.com/v2/contacts/batch
Body:
{
  "contacts": {{ JSON.stringify($items.map(i => i.json)) }}
}

Batching dramatically reduces execution time and API quota consumption—critical when managing large volumes for GTM platforms scaling outbound.

Webhook Response Workflows

n8n can receive webhooks and respond synchronously. The HTTP Request node can call external APIs before returning a response to the webhook caller:

  1. Webhook node receives inbound request
  2. HTTP Request node enriches or validates data
  3. Respond to Webhook node returns enriched data

This pattern enables real-time enrichment for form submissions or chat interactions.

Debugging and Testing HTTP Requests

When integrations fail, systematic debugging saves hours. Here's a practical approach.

Step-by-Step Debugging Process

1
Test outside n8n first: Use Postman, curl, or the API's playground to verify the request works before building in n8n
2
Check authentication: Most failures are auth-related. Verify credentials are correctly configured and not expired
3
Inspect the full response: n8n shows response body, headers, and status. Error details often hide in response body
4
Log intermediate values: Add Set nodes before HTTP Request to inspect what data is being passed
5
Check API documentation: Required fields change, endpoints deprecate. Verify you're calling current endpoints

Common Pitfalls

  • Content-Type mismatch: Sending JSON body but missing Content-Type: application/json header
  • Expression errors: Typos in field names cause undefined values. Check $json.field_name references
  • URL encoding: Special characters in query parameters need encoding
  • SSL/TLS issues: Self-hosted n8n may need SSL certificate configuration for some APIs

The Context Challenge in Custom Integrations

HTTP Request nodes solve the connectivity problem but create another: context fragmentation. When data flows through multiple custom integrations, each system has partial visibility.

Your enrichment API knows company data. Your scoring service knows intent signals. Your CRM knows deal history. But no single system has the complete picture needed for truly personalized outreach.

This is where context engines like Octave complement your HTTP integrations. While n8n moves data between systems, a context layer unifies that data into coherent prospect profiles. The HTTP Request nodes handle the plumbing; the context engine provides the intelligence layer that makes your AI-powered cold email personalization actually work.

GTM engineers who build sustainable stacks think in layers: data movement (n8n and HTTP integrations), data enrichment (Clay, enrichment APIs), and data intelligence (context engines that unify everything). Each layer has its role.

Best Practices for Production HTTP Integrations

Before deploying HTTP Request workflows to production, this checklist catches common issues:

  • Use credentials properly: Never hardcode API keys. Always use n8n's credential store
  • Implement error handling: Every HTTP Request should have an error branch or retry logic
  • Log meaningful data: Track request/response for debugging without logging sensitive data
  • Respect rate limits: Add delays between requests or implement proper throttling
  • Monitor execution: Set up alerts for workflow failures
  • Document your integrations: Future you will thank present you
  • Version your endpoints: Use explicit API versions to avoid breaking changes
  • Handle empty responses: Check for null/empty data before processing

These practices matter especially when integrations feed into automated lead scoring and prioritization workflows where failures impact pipeline quality.

Frequently Asked Questions

When should I use HTTP Request vs. a pre-built n8n node?

Use pre-built nodes when they cover your use case—they handle authentication, pagination, and errors automatically. Switch to HTTP Request when you need endpoints the pre-built node doesn't expose, when no node exists for your API, or when you need more control over request/response handling.

How do I handle APIs that require complex authentication flows?

For OAuth2, use n8n's OAuth2 credential type which handles token refresh. For custom auth flows (like APIs requiring signed requests), you may need a Code node before the HTTP Request to generate signatures or tokens. Some teams create separate "auth workflows" that refresh tokens on schedule.

What's the best way to test HTTP integrations before production?

Test the raw API call in Postman first. Then build in n8n using manual execution with test data. Create a staging workflow that processes a small batch before scaling to full volume. Use n8n's execution log to verify data flows correctly at each step.

How do I handle APIs with inconsistent response formats?

Add a Code node or IF node after the HTTP Request to normalize responses. Check for the presence of expected fields before accessing them. Build defensive transformations that handle missing or null values gracefully.

Building Your Integration Foundation

The HTTP Request node is n8n's escape hatch from integration limitations. When pre-built nodes don't exist or don't do enough, you have the power to connect any API-enabled system to your workflows.

For GTM engineers, this capability is fundamental. Your stack will never be entirely covered by pre-built integrations. New tools emerge. Internal systems need connection. Niche data providers offer competitive advantages. HTTP Request mastery ensures you can always close the gaps.

Start with simple GET requests to fetch data. Progress to POST requests creating resources. Add pagination for large datasets. Implement retry logic for reliability. Layer in error handling for production readiness.

Combined with context infrastructure from tools like Octave and enrichment workflows through Clay, your HTTP integrations become the connective tissue of a sophisticated GTM operation. The fundamentals in this guide apply whether you're connecting your first custom API or your fiftieth—master them once, use them everywhere.

FAQ

Frequently Asked Questions

Still have questions? Get connected to our support team.