Skip to main content

Overview

A proxy Datasource turns an external HTTP API into a queryable Datasource. Reelevant does not fetch and store the data on a schedule — instead it calls your API live on every request and returns the parsed response, so your Workflows always see the latest data. This guide builds a proxy Datasource end to end with curl, against a fake product API. Every call goes to the datasources API at https://api.reelevant.com/v2/datasources and needs an access token — see Authentication for how to obtain one.
Use proxy mode when the upstream data must be fresh on every request (live stock, live pricing, per-user recommendations) or when it cannot be replicated into Reelevant. For large, slow-changing catalogues, prefer a worker Datasource so queries are served from Reelevant storage.

The upstream API

Assume you own a product API that takes a category and a user identifier in the request body and returns a list of products. A live call and its response look like this:
Reelevant will call this endpoint on every query, substituting the userId and category at request time from variables you declare below.

Build the Datasource

Configuration is a sequence of steps applied to the Datasource’s draft version. Each step is a POST https://api.reelevant.com/v2/datasources/{id}/steps call with a { name, payload } body. Fetch the current step at any time with GET https://api.reelevant.com/v2/datasources/{id}/steps. The proxy step sequence is: configure_nameconfigure_sourcesconfigure_fieldspatch (optional) → validate.

1. Create the Datasource

The response contains the new Datasource id — reuse it as <datasource_id> in every step below.

2. Name it

The configure_name payload is the name string itself.

3. Configure the source

Describe the upstream call with a url source. Runtime values are declared as variables and referenced as {{name}} placeholders in the url, body, headers, and query. Because the response wraps the rows under products, set the JSON rootPath to products.*.
Reelevant validates the source by calling the API with the variables’ default values and stores one sample row. If the URL is unreachable or returns an error, the step fails — see Error handling.

Variable definition

Variables never leak as post-fetch filters: a name consumed by the request template is only used to build the upstream call, not to filter the response.

4. Map the fields

Ask Reelevant to analyse the sample response and suggest fields, then send the fields you want to keep with selected: true.
Send the same array back through configure_fields with selected: true on the fields to keep. Field names must match ^[a-z][a-z0-9_-]*$ and be unique.
Each field’s rulesPerSources maps the source index ("0" for the first source) to a path rule that extracts the value from the response row.

5. Configure caching (optional)

Because proxy Datasources call the upstream on every request, a short cache protects a rate-limited or slow API. The patch step sets the cache window and lets you ignore specific upstream status codes.
For heavy fan-out (one delivery triggering many identical calls) or on-the-fly aggregation of the live response, ask your Technical Account Manager about the Proxy Lock and Proxy Aggregation custom fetchers.

6. Validate to go live

validate promotes the draft version to live. Proxy Datasources go live immediately — no verification job runs, because nothing is stored.
Read back the live version and its sample row to confirm:

Querying at runtime

Once live, the Datasource is consumed inside a Workflow through a Datasource Data Node. The node’s filters supply the variable values for the live call:
  • A filter on a variable (userId, category) sets the value sent upstream. Omitting a variable falls back to its default.
  • A filter on a response field (price, inStock) is applied by Reelevant to the rows returned by the API.
For example, filtering category = "boots" and inStock = true calls POST https://api.example.com/products/boots, then keeps only the returned rows where inStock is true.

Test it from the API

You do not need a Workflow to verify the Datasource — call the Query a datasource endpoint directly. The query field is a JSON-encoded filter (see Datasource query filters for its structure and operators); variables and response fields are filtered exactly as in a Data Node. Pass pagination as query parameters.
The response returns the parsed rows in entries, the total count, and pagination metadata:
Send an empty query ("query": "{}") to fetch with the variables’ default values.

Error handling

The upstream host must be publicly reachable. Requests that resolve to private or internal IP ranges are rejected with UrlNotReachable, both when configuring the source and on every live query.