Skip to main content

HTTP

Call any external API with http.*. Five methods are available: get, post, put, patch, delete.

Making a request

res = http.get(url: "https://api.example.com/users/42") on error {
send.text("⚠️ Service unavailable.")
stop
}
send.text(`Status: ${res.status_code}`)
warning

Always attach on error { } to mission-critical calls. A bare call that fails aborts the flow silently. For flaky endpoints, use the http.retry recipe.

danger

Pass API keys and tokens from global.* variables (set in the Variables panel) — never hardcode a secret in the URL, headers, or bearer.

Parameters

ParamTypeNotes
url!StringThe endpoint
queryObjectURL query parameters
headersObjectRequest headers
bearerStringBearer token (sets Authorization)
bodyAnyRequest body (post/put/patch only)
timeoutNumberRequest timeout
extractObjectField extraction map

Outputs

Each call returns:

FieldType
bodyAny (parsed)
status_codeNumber
headersObject
res = http.post(
url: "https://api.example.com/orders",
bearer: global.api_key,
headers: { "Content-Type": "application/json" },
body: { item: "coffee", qty: 2 }
) on error {
send.text("Couldn't place the order.")
stop
}

when res.status_code == 201 {
set { flow.order_id = res.body.id }
send.text(`✅ Order ${flow.order_id} placed.`)
} else {
send.text(`Server returned ${res.status_code}.`)
}

Reading the body

The body is parsed automatically. Read fields directly, or use json.path for deep lookups:

set { flow.name = res.body.user.name }
set { flow.id = json.path(res.body, "data.user.id") }

Methods at a glance

MethodBody?Use for
http.getnoFetch data
http.postyesCreate
http.putyesReplace
http.patchyesPartial update
http.deletenoRemove

See also