Skip to content
MyAppBuilder
StableAction

Call API

Overview

Calls one of the APIs you configured under APIs (a shipping-rate service, a payment provider, your accounting tool…) and keeps the response for the next actions.

Purpose

The call runs on the server, so API keys stored as secrets are injected there and never reach the browser. Use the response to fill fields, show a message or create records.

Inputs

  • API — an API source (shown as METHOD Name). It must have Allow from published apps enabled.
  • Parameters — values for the {{params.name}} placeholders used in the API's URL, headers, query or body. Add a parameter name, then give it a static value or dynamic data.
  • Save result as — a result key, for example weather, so later actions can pick Action results › weather.

Configuration

  • Create and test the API first under APIs; the test request records sample fields for the Data Picker.
  • Reference parameters in the API definition as {{params.postcode}} and supply postcode here.
  • Use a Show message or Set state action afterwards to display the result.

Outputs

  • Action results › <key> and last result — the response data (after the API's Response path, if set). Use dotted paths in templates: {{results.weather.current.temp}}.
  • The HTTP status and ok flag are returned with the call but only the data is kept in results.

Example

Look up a delivery estimate

Example
Button “Check delivery” › On click:
  1. Call API
     API: GET Delivery estimate
     Parameters: postcode = Form › postcode
     Save result as: delivery
  2. Set state  Page state › eta = Action results › delivery   (template: {{results.delivery.eta}})

Errors

  • “This API can only be used from workflows.” — enable Allow from published apps on the API source.
  • “API "Name" needs the secret X in production.” — the API's authentication secret is not configured for this environment.
  • “API returned more than 2 MB.” — responses are capped at 2 MB.
  • Network errors, timeouts (the API's timeout, 0.5–30 s) and blocked private addresses surface as an error message.

Limitations

  • Limited to 60 calls per minute per user. Responses are not cached by this action.
  • If an action fails, the remaining actions in the list are skipped and an error message is shown to the user.

Advanced

  • Schema: { type: "api_call", apiSourceId, params?, resultKey? }. Server-side via executeApiSource; secrets are interpolated with the environment's plain variables, and safeFetch blocks private/loopback hosts.
  • The server returns { result: data, status, ok }; only result is stored under the result key.

Related

Was this helpful?