Overview
This node performs HTTP POST requests to a user-specified URL with customizable query parameters, JSON body content, and additional headers. It is designed to send data to external APIs or web services that accept POST requests with JSON payloads.
Common scenarios where this node is beneficial include:
- Sending data from n8n workflows to REST APIs for creating or updating resources.
- Integrating with third-party services that require POST requests with specific headers and query parameters.
- Automating data export or synchronization tasks by pushing JSON-formatted data to endpoints.
For example, you could use this node to submit form data to an external CRM system, trigger a webhook with custom headers, or post analytics data to a monitoring service.
Properties
| Name | Meaning |
|---|---|
| URL | The endpoint URL to which the POST request will be sent. |
| Query Parameters | Key-value pairs appended as query string parameters to the URL. |
| JSON Body | The JSON object sent as the POST request body. Can be entered as raw JSON text or object. |
| Additional Headers | Custom HTTP headers to include in the request, specified as name-value pairs. |
Output
The node outputs an array of items, each containing a json field with the following structure:
{
"statusCode": <HTTP status code number>,
"headers": { <response headers as key-value pairs> },
"body": { <parsed JSON response body> }
}
statusCode: The HTTP status code returned by the server.headers: The HTTP response headers.body: The parsed JSON response body from the API.
No binary data output is produced by this node.
Dependencies
- Requires internet access to reach the specified URL.
- No special credentials are enforced by the node itself; however, if the target API requires authentication, users must provide appropriate headers (e.g., Authorization tokens) via the "Additional Headers" property.
- Uses n8n's built-in HTTP request helper for making the POST calls.
Troubleshooting
- Invalid JSON Body: If the JSON Body input is not valid JSON, the node throws an error indicating "Invalid JSON Body". Ensure the JSON is correctly formatted.
- HTTP Request Failed: Errors during the HTTP request (e.g., network issues, non-2xx responses) result in an error message including the HTTP status code and part of the response body for debugging.
- Empty or Missing URL: Since the URL is required, leaving it empty will cause the node to fail.
- Incorrect Query Parameters or Headers Format: Query parameters and headers must be provided as arrays of name-value pairs; incorrect formatting may lead to unexpected behavior.
To resolve errors:
- Validate JSON syntax before running the workflow.
- Verify the URL and network connectivity.
- Check API documentation for required headers and query parameters.
- Use the error messages to identify HTTP status codes and response details.