---
related_nodes: [graphql, upload_media, webhook_trigger]
---

# HTTP Request

Send an HTTP request with structured query params, headers, body fields, authentication, and optional pagination.

## When to Use

- Call a REST API as a step the graph should show: the workflow's main fetch or send
- Fetch paginated resources from APIs such as Discord or GitHub
- Use an existing provider connection for API operations absent from a first-class node
- Submit structured JSON or form bodies with interpolated values
- Receive binary media such as images, audio, or PDFs
- Continue workflow execution based on response payload, status, or headers

## How It Works

The node takes one `input` object and uses it as the interpolation context for URL, query param values, header values, and body fields. There are no separate `url` or `body` sockets. Dynamic request data should be expressed directly in config fields with interpolation.

The node emits a single `output` object. That object always includes `body`. When response metadata is enabled, it also includes `status` and `headers`.

When a response body is not UTF-8, the node emits it as runtime binary in `output.body` and preserves the response MIME type, falling back to `application/octet-stream`. Wire `output.body` directly to a media-capable node. To keep the response as a file, set **Response Handling** `destination` to `library`: the body is saved straight into a Library item and `output.body` is the item's object descriptor.

First-class provider nodes cover common operations. For an operation they do not expose, use the same workspace connection rather than putting credentials in headers. For example, a Discord bot connection can authenticate an unsupported Discord REST operation. Linear's API is GraphQL, so use GraphQL with a Linear connection for advanced Linear operations.

Use this node when the request is a step worth seeing in the graph. When requests are part of larger work, such as a loop over items, several calls whose results are combined, or a page loop with custom stop logic, make them in a JavaScript node with `verdalia.api.http.fetch`. It sends through the same code, connection authentication, and public-address rules as this node.

When pagination is enabled, the node makes repeated requests until it hits the configured stop condition, exhausts `max_pages`, or can no longer compute the next request.

Requests reach public addresses only. The node resolves the host itself and refuses the request when the host is `localhost` or any address it resolves to is loopback, private, link-local (including the cloud metadata address `169.254.169.254`), carrier-grade NAT, multicast, documentation, reserved, or otherwise non-public. An IPv4-mapped IPv6 address is judged as the IPv4 address it carries. The connection goes to the addresses that were checked, so a second DNS answer cannot redirect it.

Redirects are followed up to 10 hops, and every hop is checked the same way, as is every pagination request. A `301`, `302`, or `303` continues as a `GET` without a body; `307` and `308` repeat the method and body. Credentials in `Authorization` and `Cookie` headers are dropped when a redirect leaves the original host or port.

## Configuration

**Method** — HTTP verb for the request.
- Default: `GET`
- Valid values: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`

**URL** — Endpoint to call.
- Supports interpolation such as `https://api.example.com/repos/{{ input.owner }}/{{ input.repo }}`
- Must be `http` or `https` and reach a public address

**Authentication Method** — How the request is authenticated.
- `none`: no auth added
- `connection`: uses a selected connection credential — an OAuth or password-grant token, an API key, or a key/secret header pair such as Alpaca's
- `webhook`: uses a selected webhook connection and overrides the request URL with the webhook URL

**Authentication Connection** — Connection used when method is `connection`.

**Authentication Webhook** — Webhook connection used when method is `webhook`.
- This is an outbound webhook credential (for example a Discord channel webhook)
- This is not the same as workspace incoming webhooks used by trigger nodes

**Query Params** — Structured key/value rows appended to the request URL.
- Blank keys are ignored
- Existing query params already present in the URL are preserved

**Headers** — Structured key/value rows added to the request.
- Blank keys are ignored
- Default `Accept` and `User-Agent` headers are always sent

**Body** — Structured body mode.
- `none`
- `json` (interpolated JSON block)
- `form_urlencoded`

**Timeout Seconds** — Request timeout.
- Default: `30`
- Valid range: `1` to `300`

**Response Handling** — Output shaping and error handling.
- `format`: `auto`, `json`, `text`
- `include_metadata`: include `status` and `headers` in `output`
- `never_error`: return output on non-2xx responses instead of failing the node. A refused or unreachable target still fails the node.
- `destination`: where a successful response body goes. Default `{"to": "output"}`.
  - `output`: decoded into `output.body`, read whole up to 20 MiB.
  - `library`: streamed into a Library item, up to 2 GiB, and `output.body` is the item's object descriptor. `name` (interpolated) names the item; empty takes the response's `Content-Disposition` filename, else the URL's last path segment. With `webhook` authentication the URL is the webhook's secret, so it never names the item: without another name the item is called `HTTP response`.
    - `place` defaults to Folder (`folder`). Choose Other (`other`) to file the item outside every folder. `folder` (interpolated) takes folder slugs or ids from the Library root, separated by `/`. Every folder must already exist. Use the Library node's Create Folder first if you need a new folder.
    - The body is never held whole in memory, and **Timeout Seconds** does not apply: each connection attempt has 30 seconds, and the download fails when nothing arrives for 60 seconds, with the workflow's own timeout bounding the whole run. A non-2xx response is not saved; it is read up to 20 MiB and handled by `never_error` as with `output`. Cannot be combined with pagination.

**Retry** — Sends a request again after a failure that passes. See [Retries](#retries).
- Default: `off`
- `bounded`: `max_attempts`, `initial_delay_ms`, `max_delay_secs`

**Pagination** — Optional multi-request behavior.
- Modes: `off`, `parameter`, `next_url`
- Parameter location: `query`, `header`, or `body`
- `next_url` with `link_header` supports a custom header name (default: `Link`)
- Cursor paths support JSONPath, including last-item patterns like `$[-1].id`
- `items_path` optionally points at an array inside each page response, such as `$.data`

## Retries

Turn on **Retry** for a request to an API that fails now and then for reasons that pass: rate limits, a busy or restarting server, a dropped connection. Reads are the clear case.

- A `GET`, `PUT` or `DELETE` request, or any request with an `Idempotency-Key` header, is sent again after a connection or DNS failure, a timeout or dropped connection, or a `408`, `425`, `429`, `500`, `502`, `503` or `504` response.
- A write (`POST`, `PATCH`) is sent again only when the server provably did not act on it: after a connection or DNS failure, or a `425` or `429` response. A write that carries an `Idempotency-Key` header the API honours is sent again like a `GET`; set one when the API supports it. Wrapper steps already know which of their operations only read.
- A retried `DELETE` can report "not found" because the first attempt worked.
- Every other response or failure is final at once.

Settings of `bounded`:
- `max_attempts` (**Attempts**): `2` to `10`, counting the first. Default: `3`.
- `initial_delay_ms` (**First wait (ms)**): `100` to `60000`. The wait doubles before each later retry, with jitter. Default: `500`.
- `max_delay_secs` (**Longest wait (s)**): `1` to `300`, the longest single wait. Default: `30`.

A response's `Retry-After` header, in seconds or as a date, sets the wait before the next attempt. A long `Retry-After` stops the retries rather than stalling the run: raise the longest wait to allow it.

With pagination, each page request is retried on its own; the request interval between pages is unchanged.

Leave retries off when the workflow already repeats the step itself (a loop, a schedule, a Streams sweep), or attempts multiply.

When attempts run out, the step fails with the last error, exactly as without retries, and with `never_error` the last response becomes `output`. Choose what happens then with the step's failure handling.

```json
{
  "retry": {
    "mode": "bounded",
    "max_attempts": 4,
    "initial_delay_ms": 500,
    "max_delay_secs": 30
  }
}
```

`verdalia.api.http.fetch` and `verdalia.api.graphql.query` in a JavaScript node take the same `retry` setting.

## Inputs

**input** — Upstream workflow data used for interpolation.

Expected shape:
- any JSON value, though object-shaped input is the most useful for interpolation

## Outputs

**output** — Structured HTTP response object.

Minimum shape:

```json
{
  "body": { "ok": true }
}
```

With metadata enabled:

```json
{
  "body": { "ok": true },
  "status": 200,
  "headers": {
    "content-type": "application/json"
  }
}
```

Binary responses cannot be represented as replayable JSON. Public previews show redacted metadata similar to:

```json
{
  "body": {
    "bytes": "<binary>",
    "mime_type": "image/png",
    "filename": null,
    "size_bytes": 12345
  }
}
```

`bytes: "<binary>"` is a preview placeholder, not Base64. Preserve the runtime value by wiring the socket rather than copying the preview.

Paginated responses return all collected page bodies flattened into a single array in `output.body`.

With `destination` `library`, `output.body` is the saved item's object descriptor, beside `status` and `headers` when metadata is enabled:

```json
{
  "body": {
    "object_id": "01J...",
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "size_bytes": 48213,
    "metadata": {}
  }
}
```

## Examples

### Example 1: Authenticated GET request

```json
{
  "method": "GET",
  "url": {
    "type": "inline",
    "content": "https://api.github.com/repos/{{ input.owner }}/{{ input.repo }}"
  },
  "authentication_method": "connection",
  "authentication_connection": "<github_connection_id>",
  "headers": [
    {
      "key": "X-Workflow-Run",
      "value": { "type": "inline", "content": "{{ input.run_id }}" }
    }
  ]
}
```

Result: fetches one repository and returns the parsed response body as `output.body`.

### Example 2: Cursor pagination in a query parameter

```json
{
  "method": "GET",
  "url": {
    "type": "inline",
    "content": "https://discord.com/api/v10/users/@me/guilds"
  },
  "authentication_method": "connection",
  "authentication_connection": "<discord_connection_id>",
  "query_params": [
    {
      "key": "limit",
      "value": { "type": "inline", "content": "100" }
    }
  ],
  "pagination": {
    "config": {
      "mode": "parameter",
      "location": "query",
      "name": "after",
      "strategy": {
        "type": "cursor",
        "response_path": "$[-1].user.id"
      }
    },
    "limits": {
      "max_pages": 20,
      "request_interval_ms": 0,
      "stop_when": { "type": "response_empty" }
    }
  }
}
```

Result: keeps requesting more guild pages until a page comes back empty or the page limit is reached.

### Example 3: Cursor pagination with list envelopes

```json
{
  "method": "GET",
  "url": {
    "type": "inline",
    "content": "https://do.featurebase.app/v2/help_center/articles"
  },
  "headers": [
    {
      "key": "Featurebase-Version",
      "value": { "type": "inline", "content": "2026-01-01.nova" }
    }
  ],
  "query_params": [
    {
      "key": "limit",
      "value": { "type": "inline", "content": "100" }
    }
  ],
  "pagination": {
    "config": {
      "mode": "parameter",
      "location": "query",
      "name": "cursor",
      "strategy": {
        "type": "cursor",
        "response_path": "$.nextCursor"
      }
    },
    "items_path": "$.data",
    "limits": {
      "max_pages": 100,
      "request_interval_ms": 0,
      "stop_when": { "type": "response_empty" }
    }
  }
}
```

Result: collects article objects from each page's `data` array into one flat `output.body` array.

### Example 4: Store a PDF returned by an external conversion API

Configure HTTP Request to `POST` HTML using the provider's documented JSON or form body and authenticate with an explicit workspace connection. When the provider returns `application/pdf`, connect:

```text
HTTP Request.output → JavaScript.input
JavaScript.output → Upload Media.input
```

The JavaScript node should return `inputs.input.body` so Upload Media receives the runtime binary. Configure Upload Media with `kind_hint: "pdf"` and the desired filename. The HTML is sent to the external provider; use only a provider whose data handling is acceptable for the document.

## Runtime Errors

| Error | Cause | Remediation |
|-------|-------|-------------|
| `URL is required` | URL resolved to an empty string | Set a URL or fix interpolation |
| `HTTP request failed with status <code>: <body>` | Response was non-2xx and `never_error` is false. With **Retry** on, this is the last attempt's response. The message ends with the server's full response body | Read the body for the server's reason, then fix the request; or enable `never_error` to route the response downstream |
| `URL resolves to a non-public address` | The URL, a redirect, or a pagination URL points at a loopback, private, link-local, or other non-public address | Use a public hostname; internal services are not reachable from workflows |
| `localhost URLs are not allowed` | The URL host is `localhost` or a `*.localhost` name | Use a public hostname |
| `only http and https URLs are supported` | The URL, or a redirect, uses another scheme | Use an `http` or `https` URL |
| `too many redirects (maximum 10)` | The target redirected more than 10 times | Request the final URL directly |
| `Resolved URL is too large ...` | URL interpolation produced an oversized request URL | Check that interpolated fields are scalar IDs, not full objects or documents |
| `Request header '...' is too large ...` | A credential or configured header resolved to an oversized header value | Check credentials, auth prefix, and header interpolation |
| `Retry attempts must be between 2 and 10, not <n>` (also first wait, longest wait) | A `retry` bound is out of range | Set `max_attempts` `2`–`10`, `initial_delay_ms` `100`–`60000`, `max_delay_secs` `1`–`300` |
| `Body pagination requires a JSON or form body` | Pagination location was `body` while body mode was `none` | Switch body mode to `json` or `form_urlencoded` |
| `Cursor path '...' did not resolve` | Cursor JSONPath did not match the response | Fix the cursor path to target the API response shape |
| `Pagination items path '...' must resolve to an array` | `items_path` matched a scalar or object | Point `items_path` at the page's item array, such as `$.data` |
| `Saving the response into the Library cannot be combined with pagination` | `destination` is `library` while pagination is on. Reported on `response_handling.destination` when the workflow is validated, and fails the step | Set `destination` to `output`, or turn pagination off |
| A Library save failure | With `destination` `library`, the body is over 2 GiB, the storage quota is full, the download stalled for 60 seconds, or storage failed. Nothing is left behind | Check the source and the workspace's storage |

## Common Mistakes

- **Using a separate body socket**
  - The node does not support dedicated `body` or `url` sockets
  - Fix: use interpolation directly in config fields

- **Using body pagination without a body mode**
  - Body pagination has nowhere to write the next value when body mode is `none`
  - Fix: change body mode to `json` or `form_urlencoded`

- **Expecting non-JSON text to parse as an object**
  - `auto` falls back to plain text when JSON decoding fails
  - Fix: switch response format to `text` if plain text is expected

## Tips

- Use query params for the simplest pagination behavior when the remote API supports it
- Use `include_metadata` when downstream nodes need status codes or response headers
- Wire binary `output.body` forward at runtime; do not copy its redacted preview
- Prefer cursor pagination paths that resolve to a scalar string or number, such as `$[-1].id`
