Skip to content

Data sources ​

Data sources and connections, and the data and parameters a template reads.

POST /v1/templates/{id}/data ​

The data a preview would use, by the render policy (for the designer).

Runs the data plan without rendering: live datasets where the caller may use live data (data: live for drafts), else the sources' samples. Datasets that use the document's own samples are left out. Agents, MCP tools and read-only callers get samples; data: live where that isn't allowed is 403.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Request body (application/json)

FieldTypeRequiredDescription
environmentstring
draftboolean
commitstring
paramsobject
contextobject
dataauto, sample, live

Responses

StatusDescriptionBody
200{datasets: {name: JSON}, origins: {name: {kind, source, bytes, reason}}}
403Live data was asked for where it isn't allowed
404The template is in the trash: {error: "in-trash", message, item}. item, the trash item's id, is there only for callers with template.read.object
409A source's connection has no binding for the environment
413A source passed its cap
422The parameters or sourceParams have errors
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object
502A data source failed

GET /v1/sources ​

The source catalogue of one environment (RFML §10.4), without queries.

Each source's latest version: name, description, kind (sql or http), connection, typed params, the output schema and whether it has a sample, every version, and bound (its connection has a binding in this environment). Needs source.read. Queries are never listed.

Parameters

NameInTypeRequiredDescription
environmentquerystring

Responses

StatusDescriptionBody
200{environment, sources: [{name, version, versions, description, kind, connection, params, schema, hasSample, bound}]}
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object
503No source catalogue (sourceControl.driver is not git)

POST /v1/sources ​

Add a source version (source.manage).

Writes sources/<name>/<version>/{source.json,schema.json,sample.json} on the environment branch. Versions are immutable: an existing one is 409. The connection must exist and be of the definition's kind. With describe: true the query is run once (needs data.live) to fill in the schema and, when none is given, the sample. Agents can't define sources.

Request body (application/json)

FieldTypeRequiredDescription
environmentstring
definitionSourceDefinitionyes
schemaobject
sampleany
describeboolean
paramsobjectParameter values for describe.

Responses

StatusDescriptionBody
201The stored version, with its query
409The version exists, or the branch moved
422The definition is not valid
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

GET /v1/sources/{name} ​

One source version (the latest, or ?version=) with its schema and sample.

The query is included only for callers with source.manage, and never through MCP tools.

Parameters

NameInTypeRequiredDescription
namepathstringyesA dotted source name, e.g. billing.bill
environmentquerystring
versionquerystring

Responses

StatusDescriptionBody
200
404No such source or version in the environment
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

GET /v1/sources/{name}/versions ​

Every version of a source in one environment, oldest first.

Parameters

NameInTypeRequiredDescription
namepathstringyesA dotted source name, e.g. billing.bill
environmentquerystring

Responses

StatusDescriptionBody
200{name, environment, versions: [{version, description, tree, hasSample}]}
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

POST /v1/sources/{name}/describe ​

Run a source once and describe its result.

Runs a stored version, or an unsaved definition, through the environment's connection and returns a JSON Schema, the SQL columns and up to 20 rows. It reads live data: it needs source.manage and data.live, and agents and MCP tools can't.

Parameters

NameInTypeRequiredDescription
namepathstringyesA dotted source name, e.g. billing.bill

Request body (application/json)

FieldTypeRequiredDescription
environmentstring
versionstring
definitionSourceDefinition
paramsobject

Responses

StatusDescriptionBody
200{schema, columns: [{name, databaseType, type, nullable}], sample}
403No source.manage or data.live, or an agent
409The connection has no binding for the environment
413The result passed the connection's row or byte cap
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object
502The source failed; the message names no connection details

POST /v1/sources/{name}/promote ​

Copy one source version from one environment to another.

Needs source.read in from and source.manage in to. Copying a version the target holds unchanged does nothing; one that differs is 409.

Parameters

NameInTypeRequiredDescription
namepathstringyesA dotted source name, e.g. billing.bill

Request body (application/json)

FieldTypeRequiredDescription
versionstringThe version; empty for the latest.
fromstring
tostringDefaults to the environment after from.

Responses

StatusDescriptionBody
200The version in the target environment, with bound
409The target holds a different copy of the version
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

GET /v1/connections ​

The operator's connections and their health, never their secrets.

Per environment the caller has source.read in: status unbound (no binding), unchecked, ok or error. check=true pings each binding; messages name no hosts, users or driver errors.

Parameters

NameInTypeRequiredDescription
environmentquerystring
checkqueryboolean

Responses

StatusDescriptionBody
200{connections: [{name, driver, kind, maxRows, maxBytes, timeoutSec, environments: [{environment, status, message, latencyMs}]}]}
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

GET /v1/templates/{id}/params ​

The template's parameters as prompts, with picklist choices.

Every declared parameter in order, with its bound value and its options. Computed options that read datasets are evaluated against data loaded by the render policy (samples for agents, MCP tools, read-only callers and drafts; live where the caller has data.live). X-Data-Origins says where each loaded dataset came from.

Parameters

NameInTypeRequiredDescription
idpathstringyes
environmentquerystring
draftquerybooleanRead the draft (or the published copy when no draft is written yet).
commitquerystring
valuesquerystringParameter values chosen so far, as a JSON object (for cascading picklists).
dataqueryauto, sample, live

Responses

StatusDescriptionBody
200{id, environment, commit, draft, params: [{name, type, label, description, required, multiple, hidden, value, options: [{value, label}], optionsData}], values, data, diagnostics}
403Live data was asked for without data.live
404The template is in the trash: {error: "in-trash", message, item}. item, the trash item's id, is there only for callers with template.read.object
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object