Saltar al contenido principal

API

Category: Integration
Node id: api

Makes HTTP API requests with configurable method, headers, authentication, and retry logic

What it does​

  • Full HTTP client with all standard methods (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS)
  • Authentication: Bearer token, Basic auth, API key, or custom headers
  • Query parameters from config (templated) and from inputs (inputs win per key)
  • Configurable redirect following behavior
  • Retries with exponential backoff and jitter; Retry-After honoured on 429/503
  • Automatic JSON response parsing when Content-Type is application/json
  • Response duration tracking in milliseconds

Use cases​

  • Call external REST APIs to fetch or submit data within a pipeline
  • Integrate with healthcare APIs (Epic, Cerner) using bearer tokens
  • Query third-party services and pass structured responses downstream
  • Perform authenticated API calls with automatic retry on transient failures

Runtime​

  • Performance tier: variable

Input ports​

NameTypeRequiredDescription
urltextNoRequest URL (overrides config)
bodyanyNoRequest body payload
query_paramsjsonNoQuery parameters as key-value pairs

Output ports​

NameTypeRequiredDescription
resultjsonNoFull API response object with status_code, headers, body, and body_json
successbooleanNoWhether the request was successful (2xx)

Settings​

Basic​

SettingNameTypeRequiredDefaultAllowed valuesDescription
URLurlstringNoAPI endpoint URL
HTTP MethodmethodenumNoGETGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONSHTTP method
Query Parametersquery_paramsjsonNoQuery parameters as key-value pairs; values may use {{variables}}. The query_params input overrides a key

Auth​

SettingNameTypeRequiredDefaultAllowed valuesDescription
Auth Typeauth_typeenumNobearer, basic, api_key, customAuthentication type
Bearer Tokenauth_tokensecretNoBearer token for authentication
Usernameauth_usernamestringNoUsername for basic authentication
Passwordauth_passwordsecretNoPassword for basic authentication
API Keyapi_keysecretNoAPI key value
API Key Headerapi_key_headerstringNoX-API-KeyHeader name for API key

Advanced​

SettingNameTypeRequiredDefaultAllowed valuesDescription
HeadersheadersjsonNoCustom HTTP headers as key-value pairs
Timeout (seconds)timeoutnumberNo30min 1Request timeout in seconds
Follow Redirectsfollow_redirectsbooleanNotrueWhether to follow HTTP redirects
Retry Countretry_countnumberNo0min 0; max 10Number of retry attempts on failure
Retry Delay (ms)retry_delay_msnumberNo1000min 0Delay before the first retry in milliseconds; later retries multiply it by retry_backoff_factor
Backoff Factorretry_backoff_factornumberNo2min 1; max 10Multiplier applied to the delay after each failed attempt (1 = fixed delay)
Max Retry Delay (ms)retry_max_delay_msnumberNo30000min 1Upper bound for any single wait, including a server's Retry-After (at least 1 ms; a Retry-After above it waits the bound)
Retry Jitterretry_jitterbooleanNotrueRandomise each delay by ±10% so parallel callers do not retry in lockstep
Error Body Excerpt (bytes)error_body_bytesnumberNo0min 0; max 256Quote up to this many bytes of a non-2xx response body in the failure message (0 = none, the default). The excerpt may contain patient data and is stored in run history and logs; enable only for endpoints whose error bodies are known to carry none

Errors​

CodeDescription
MISSING_URLURL is required via config or input but was not provided
REQUEST_FAILEDAPI request failed after all retry attempts
AUTH_TOKEN_MISSINGauth_token is required for bearer authentication but was empty
AUTH_CREDENTIALS_MISSINGUsername is required for basic authentication but was empty
UNSUPPORTED_AUTH_TYPEProvided auth_type is not one of: bearer, basic, api_key, custom

Runtime notes​

  • result.body_json is only present when the response Content-Type is application/json — always check before wiring to JSON-expecting nodes
  • success is true for any 2xx status; non-2xx responses still populate result with status_code and body for error handling
  • URL from the input port overrides the config URL — use this for dynamic endpoint routing in loops
  • Retries wait retry_delay_ms × retry_backoff_factor^(n-1) (±10% jitter, capped at retry_max_delay_ms); on 429/503 a Retry-After header sets a longer wait. After the last attempt the node errors with the attempt count and HTTP status (plus a body excerpt only when error_body_bytes > 0 — it may contain patient data and lands in run history)
  • With retry_count 0 a 429/503 error still carries Retry-After, so the node-level retry middleware waits at least that long

See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.

¿Algo no está claro? Envíe sus comentarios sobre la documentación por correo electrónico..