Skip to content

HTTP / REST APIs

The api.call connector makes HTTP requests to external APIs. It supports authentication, template expressions, and batch execution over tables.

fetch-users:
type: service
op: api.call
params:
url: https://api.example.com/users
method: GET
headers:
Accept: application/json
auth:
type: bearer
token: "{{ secrets.API_TOKEN }}"
outputs:
response: { type: Table }

URL, headers, and body fields support {{ field }} templates. Values are interpolated from the input record at execution time.

params:
url: "https://api.example.com/users/{{ user_id }}/profile"
headers:
Authorization: "Bearer {{ secrets.TOKEN }}"
# API key
auth:
type: api_key
header: X-API-Key
key: "{{ secrets.SERVICE_KEY }}"
# Bearer token
auth:
type: bearer
token: "{{ secrets.ACCESS_TOKEN }}"
# OAuth 2.0
auth:
type: oauth
client_id: "{{ secrets.OAUTH_CLIENT_ID }}"
client_secret: "{{ secrets.OAUTH_CLIENT_SECRET }}"
token_url: https://auth.example.com/oauth/token
scopes: [read, write]

When the input is a Record, api.call makes a single request. When the input is a Table, it makes one request per row. Templates resolve against each row.

enrich-contacts:
type: service
op: api.call
params:
url: "https://api.clearbit.com/v1/people/find?email={{ email }}"
method: GET
auth:
type: api_key
header: Authorization
key: "Bearer {{ secrets.CLEARBIT_KEY }}"
inputs:
contacts: { type: Table, from: ref(read-csv.rows) }
outputs:
enriched: { type: Table }

Each response produces: status_code (number), body (parsed JSON), headers (object). Use extract to pull fields into flat output columns. Use artifact to download binary responses to disk.

params:
extract:
name: body.user.name
plan: body.account.plan
artifact:
path: "artifacts/{{ report_id }}.pdf"
content_type: application/pdf
PresetMethodDescription
rest.fetchGETGeneric REST fetch. Sets JSON accept header.
llm.generatePOSTCalls Claude or GPT. Expects prompt, returns text.
tts.generatePOSTText-to-speech. Returns audio artifact.
video.generatePOSTVideo generation. Returns video artifact.
FieldRequiredDefaultDescription
urlYesRequest URL. Supports {{ }} templates.
methodNoGETHTTP method: GET, POST, PUT, PATCH, DELETE.
headersNo{}Request headers. Supports templates.
bodyNoRequest body (POST/PUT/PATCH). Supports templates.
authNoAuthentication config.
extractNoDot-path mappings from response body to output fields.
artifactNoDownload binary responses to disk.
presetNoShorthand preset name.