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 withcurl, 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: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 aPOST 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_name → configure_sources → configure_fields → patch (optional) → validate.
1. Create the Datasource
id — reuse it as <datasource_id> in every step below.
2. Name it
Theconfigure_name payload is the name string itself.
3. Configure the source
Describe the upstream call with aurl 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.*.
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 withselected: true.
configure_fields with selected: true on the fields to keep. Field names must match ^[a-z][a-z0-9_-]*$ and be unique.
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. Thepatch 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.
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 itsdefault. - A filter on a response field (
price,inStock) is applied by Reelevant to the rows returned by the API.
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. Thequery 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.
entries, the total count, and pagination metadata:
Error handling
Related
- Authentication — obtaining an access token.
- Query a datasource — the endpoint used to test the live Datasource.
- Datasources API reference — full endpoint reference.
- Custom Fetchers — Proxy Lock and Proxy Aggregation for real-time Datasources.
- Datasource Data Node — querying a Datasource inside a Workflow.