Skip to content

HTTP Request

Category: Action

Makes an HTTP request to any URL and captures the full response — status code, headers, and body. This is your gateway to external APIs, webhooks, and third-party services.

When to use

  • Fetch data from external APIs (weather, energy prices, public transit)
  • Send data to third-party services (Slack, Discord, IFTTT)
  • Call REST APIs to trigger external systems
  • Log automation events to an external endpoint

Configuration

  • URL — The endpoint to call. Supports template expressions: {{ variables.apiUrl }}
  • MethodGET, POST, PUT, or DELETE

Output data

The full HTTP response is captured for downstream nodes:

  • {{ nodes['<id>'].data.status }} — HTTP status code (200, 404, 500, etc.)
  • {{ nodes['<id>'].data.statusText }} — Status text ("OK", "Not Found", etc.)
  • {{ nodes['<id>'].data.ok }}true if status is in the 200–299 range
  • {{ nodes['<id>'].data.body }} — Parsed response body (JSON object if Content-Type is JSON, raw text otherwise)
  • {{ nodes['<id>'].data.headers }} — Response headers as an object

For JSON responses, access nested fields directly:

  • {{ nodes['<id>'].data.body.temperature }}
  • {{ nodes['<id>'].data.body.results[0].name }}

Examples

Fetch weather and adjust lighting:

  1. Schedule → every hour
  2. HTTP Request → GET https://api.weather.com/current?lat=51&lon=0
  3. Code → return { bright: input.nodes.http1.data.body.cloud_cover < 50 }
  4. IF → nodes.code1.data.bright == true
  5. Set Device → dim lights (then) or brighten lights (else)

Send Slack notification:

  1. Device Changed → smoke detector triggered
  2. HTTP Request → POST https://hooks.slack.com/services/... with body { "text": "Smoke detected!" }

Tips

  • HTTP request failures (network errors) do not stop the automation by default — use the Error Handling config to change this behaviour
  • JSON response bodies are automatically parsed — access fields with dot notation
  • Use the Code node after an HTTP Request to transform complex API responses
  • Requests have a 30-second timeout
  • For authenticated APIs, set the Authorization header in your request configuration