n8n API Integration Tutorial
n8n ships with hundreds of pre-built app integrations, but its real flexibility comes from the HTTP Request node, which can call any API that exists, whether or not a dedicated n8n node has been built for it. This tutorial covers the core patterns for doing that reliably.
Step 1: Understand the API's authentication method
Most APIs use one of a few common patterns: an API key in a header, an OAuth2 token, or Basic Auth. n8n's HTTP Request node has built-in credential types for each of these, so the setup is usually a matter of selecting the right credential type and entering the required keys, not writing custom authentication code.
Step 2: Making your first request
Set the HTTP Request node's method (GET, POST, etc.), URL, and any required headers or body parameters. n8n lets you test the node individually before connecting it to the rest of the workflow, which makes it easy to confirm the request works before building around it.
Step 3: Handling paginated responses
Many APIs return data in pages rather than all at once. n8n's HTTP Request node supports pagination settings that automatically follow "next page" links or increment a page parameter, looping until all records are retrieved, instead of requiring a manually built loop for every paginated API.
Step 4: Building in error handling
Real APIs occasionally return errors, rate limits, or unexpected data shapes. Using n8n's error-handling options (continue-on-fail settings, IF nodes checking the response, and a dedicated error workflow) keeps one failed API call from silently breaking or crashing the entire workflow.
A worked example
Connecting to a CRM that has no dedicated n8n node: authenticate with an API key header, GET the list of contacts with pagination enabled, transform the response into the format your next step needs, and POST an update back, with an IF node checking for error responses at each step.
For more advanced multi-step integration patterns, see building complex integrations with n8n.