Skip to content

Dataset programs: backfill, refresh

The Dataset Verbs backfill, refresh as MCP do programs, with inputs, result, refusals and an example.

Dataset.refreshMode do
curl -X POST https://api.sb/ratebook.dev/datasets/dataset_UDQXk0KsJB/refresh \
  -H "Authorization: Bearer $SB_TOKEN"
API referenceDataset.refresh
npx startup-builder do Dataset.refresh --data '{"dataset":"dataset_UDQXk0KsJB"}'
CLI referenceDataset.refresh
{
  "name": "do",
  "arguments": {
    "code": "return await $.Dataset.refresh({ dataset: 'dataset_UDQXk0KsJB' })"
  }
}
MCP referenceDataset.refresh
import { $ } from 'startup-builder'

const dataset = await $.Dataset.refresh({ dataset: 'dataset_UDQXk0KsJB' })
SDK referenceDataset.refresh

Reference for Dataset, one group of Dataset programs.

Dataset.backfill

Backfill reads one Source of a Dataset over a past date range and records every value observed in it. Verb page.

Text
do: return await $.Dataset.backfill(input)

Emits Dataset.backfilled.

Inputs

InputTypeRequiredDescription
datasetDatasetrequiredThe Dataset.
sourceSourcerequiredThe Source to read.
fromdaterequiredThe first day of the range.
todaterequiredThe last day of the range.

Returns

OutputTypeRequiredDescription
datasetDatasetrequiredThe Dataset, with the range filled.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
dataset is missing, or is not a datasetinvalid-inputSend dataset as a dataset, then call it again.None.
source is missing, or is not a sourceinvalid-inputSend source as a source, then call it again.None.
from is missing, or is not a dateinvalid-inputSend from as a date, then call it again.None.
to is missing, or is not a dateinvalid-inputSend to as a date, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Dataset.backfill({ dataset: 'dataset_UDQXk0KsJB', source: 'source_DIdhfB6mF5', from: '2026-10-22', to: '2026-10-22' })",
    "idempotencyKey": "ratebook-dataset-backfill-1"
  }
}

Dataset.refresh

Refresh re-reads a Dataset’s Sources now instead of on schedule, and records what changed. Verb page.

Text
do: return await $.Dataset.refresh(input)

Emits Dataset.refreshed.

Inputs

InputTypeRequiredDescription
datasetDatasetrequiredThe Dataset.
sourceSourceOne Source to read; absent, every Source.

Returns

OutputTypeRequiredDescription
datasetDatasetrequiredThe Dataset, with refreshedAt set.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
dataset is missing, or is not a datasetinvalid-inputSend dataset as a dataset, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

JSON
{
  "name": "do",
  "arguments": {
    "code": "return await $.Dataset.refresh({ dataset: 'dataset_UDQXk0KsJB' })",
    "idempotencyKey": "ratebook-dataset-refresh-1"
  }
}