Calling external APIs

Use the HTTP request block to call any API and save the response into variables.

The HTTP request block lets your bot call any HTTP API — fetch data, submit a form, trigger another service — and pull the response into variables.

Configuring a request

  • MethodGET, POST, PUT, DELETE.
  • URL — templatable, e.g. https://api.example.com/users/{{user.id}}.
  • Headers — key/value pairs (e.g. Authorization: Bearer …).
  • Body — templatable; send JSON or form data.

Reading the response

The JSON path → variable map extracts fields from the JSON response into variables. The left side is a path into the response; the right side is the variable name to store it in.

GET https://api.exchangerate.host/latest?base=USD
save_to:
  rates.EUR → eur
Send "1 USD = {{var.eur}} EUR"

Branching on success

The block has two outcomes: ok (2xx response) and error (network failure or non-2xx). Connect both to handle failures gracefully.

HTTP request
 ├─ ok    → Send "Done: {{var.result}}"
 └─ error → Send "Service is unavailable, try later"