http

Makes HTTP requests to external APIs and endpoints. The response is stored in a variable for further processing.

{% http url: "https://api.example.com/data", method: "GET" as response %}

{% if response.ok %}
  {% log "Request successful: " | append: response.status %}
{% endif %}

Syntax

{% http url: endpoint, method: http_method, headers: headers_object, body: body_object as result_variable %}

Parameters

Parameter
Required
Description

url

Yes

The endpoint URL to call

method

Yes

HTTP method: "GET", "POST", "PUT", "PATCH", "DELETE"

headers

No

Object containing request headers

body

No

Request payload (automatically JSON-stringified unless Content-Type specifies otherwise)

raw

No

Set to true to return raw text instead of parsed JSON

Result Object

Property
Type
Description

url

string

The final URL (after redirects)

status

number

HTTP status code (200, 404, 500, etc.)

statusText

string

HTTP status message ("OK", "Not Found", etc.)

headers

object

Response headers as key-value pairs

ok

boolean

true if status is 200-299

body

object/string

Parsed JSON response (or raw text if raw: true)

Example result:

Examples

Simple GET request:

POST request with JSON body:

PUT request to update resource:

Form-urlencoded POST request:

Send data to webhook:

GET raw text response (e.g., CSV):

Send XML data:

Integrate with external CRM:

Notes

  • Consumes 1 credit per request

  • Request body is automatically JSON-stringified unless Content-Type is:

    • application/x-www-form-urlencoded

    • multipart/form-data

    • text/plain

    • text/xml

  • Rate limited responses (429) are automatically retried with backoff

  • Server errors are retried up to 3 times before failing

  • Request timeout is 5 minutes

  • Use raw: true when expecting non-JSON responses (CSV, XML, plain text)

Last updated