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
| Param | Type | Notes |
|---|---|---|
url! | String | The endpoint |
query | Object | URL query parameters |
headers | Object | Request headers |
bearer | String | Bearer token (sets Authorization) |
body | Any | Request body (post/put/patch only) |
timeout | Number | Request timeout |
extract | Object | Field extraction map |
Outputs
Each call returns:
| Field | Type |
|---|---|
body | Any (parsed) |
status_code | Number |
headers | Object |
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
| Method | Body? | Use for |
|---|---|---|
http.get | no | Fetch data |
http.post | yes | Create |
http.put | yes | Replace |
http.patch | yes | Partial update |
http.delete | no | Remove |
See also
- Error handling
- Recipes → http.retry
- Standard Library → Integrations — pre-built API wrappers