Skip to main content

Dataset References

Manage associations between reports and datasets, including filters, aliases, and snapshot settings.

Overview

Reports can reference multiple datasets, each with:

  • Alias - Unique identifier within the report (e.g., orders, customers)
  • Label - Display name for the dataset
  • Filter - Applied criteria to limit data
  • Chips - Filter UI components
  • Snapshot Settings - Configuration for including historical dataset snapshots

GET /api/reports/{id}/dataset-refs

Get all dataset references for a report with field metadata and record counts.

Authentication: Required

Path Parameters:

ParameterTypeDescription
idstringReport ID

Response:

{
"_links": {
"self": { "href": "/api/reports/{id}/dataset-refs" }
},
"_embedded": {
"inf:dataset-reference": [
{
"id": "orders",
"alias": "orders",
"datasetId": "orders-2024",
"label": "Orders Dataset",
"filter": {
"criteria": []
},
"chips": [],
"count": 12500,
"countWithoutSnapshots": 12500,
"overallCount": 15000,
"snapshots": {
"includeLatest": true,
"type": "n",
"n": 5,
"snapshotDatasets": [
{ "datasetId": "orders-2024-jan" },
{ "datasetId": "orders-2024-feb" }
]
},
"dataset": {
"id": "orders-2024",
"name": "Orders 2024",
"fields": [
{
"name": "orderId",
"label": "Order ID",
"type": "integer"
}
]
}
}
]
},
"start": 0,
"count": 1,
"total": 1
}

Response Fields:

FieldTypeDescription
idstringAlias (same as alias)
aliasstringUnique identifier within report
datasetIdstringReferenced dataset ID
labelstringDisplay name
filterobjectApplied filter criteria
chipsarrayFilter UI components
countintegerFiltered record count (with report-level filters)
countWithoutSnapshotsintegerCount excluding snapshot data
overallCountintegerCount including all snapshots
snapshotsobjectSnapshot configuration (if enabled)
datasetobjectFull dataset metadata including fields

POST /api/reports/{id}/dataset-refs

Add a new dataset reference to a report.

Authentication: Required

Permissions: report:write

Path Parameters:

ParameterTypeDescription
idstringReport ID

Request Body:

{
"reportId": "team:sales-dashboard",
"datasetId": "customers-2024",
"alias": "customers",
"label": "Customer Data",
"filter": {
"criteria": [
{
"field": "region",
"op": "eq",
"value": "West"
}
]
},
"chips": [
{
"field": "region",
"label": "Region: West"
}
],
"snapshots": {
"includeLatest": true,
"type": "n",
"n": 3,
"snapshotDatasets": ["snapshot-1", "snapshot-2"]
}
}

Required Fields:

FieldTypeDescription
reportIdstringReport ID
datasetIdstringDataset to reference
aliasstringUnique alias (1-150 chars, alphanumeric + underscore/hyphen, must start with letter/number/underscore)
labelstringDisplay name (1-150 chars)

Optional Fields:

FieldTypeDefaultDescription
filterobject{}Filter criteria
chipsarray[]Filter UI components
snapshotsobjectnullSnapshot settings

Snapshot Settings:

FieldTypeDefaultDescription
includeLatestbooleantrueInclude the latest dataset data
typestring-Snapshot selection type: n (last N snapshots) or null
ninteger1Number of recent snapshots to include (when type is n)
snapshotDatasetsarray[]Specific snapshot dataset IDs to include

Response:

{
"id": "uuid",
"reportId": "team:sales-dashboard",
"datasetId": "customers-2024",
"alias": "customers",
"label": "Customer Data"
}

Status Code: 201 Created

Location Header: URL of the created dataset reference

Validation:

  • Alias must be unique within the report
  • Alias must match regex: ^[a-zA-Z0-9_][a-zA-Z0-9_-]*$
  • Referenced dataset must exist and be accessible
  • Snapshot dataset IDs must belong to valid snapshots of the specified dataset

GET /api/reports/{id}/dataset-refs/{dataset}

Get a specific dataset reference by alias.

Authentication: Required

Path Parameters:

ParameterTypeDescription
idstringReport ID
datasetstringDataset alias

Response:

{
"id": "uuid",
"alias": "orders",
"datasetId": "orders-2024",
"label": "Orders Dataset",
"filter": {},
"chips": [],
"snapshots": {
"includeLatest": true,
"type": "n",
"n": 5
}
}

PUT /api/reports/{id}/dataset-refs/{dataset}

Update a dataset reference configuration.

Authentication: Required

Permissions: report:write

Path Parameters:

ParameterTypeDescription
idstringReport ID
datasetstringDataset alias

Request Body:

{
"alias": "orders",
"label": "Updated Orders Label",
"filter": {
"criteria": [
{
"field": "status",
"op": "eq",
"value": "completed"
}
]
},
"chips": [],
"snapshots": {
"includeLatest": false,
"type": "n",
"n": 10,
"snapshotDatasets": ["snapshot-3", "snapshot-4"]
}
}

Response:

Returns the updated dataset reference.

Notes:

  • Changing the alias will update all references in the report definition
  • Snapshot dataset associations are replaced (not merged)
  • Invalid snapshot dataset IDs are ignored

DELETE /api/reports/{id}/dataset-refs/{dataset}

Remove a dataset reference from a report.

Authentication: Required

Permissions: report:write

Path Parameters:

ParameterTypeDescription
idstringReport ID
datasetstringDataset alias

Response:

204 No Content on success.

Behavior:

  • Removes the dataset reference
  • Removes all references to the alias from the report definition
  • Deletes associated snapshot settings
  • Does not delete the actual dataset (only the report's reference to it)

Snapshot Settings

Snapshot settings allow reports to include historical versions of datasets alongside current data.

Configuration Options

Include Latest:

{
"includeLatest": true
}

Include the current dataset data along with snapshots.

Last N Snapshots:

{
"type": "n",
"n": 5,
"includeLatest": true
}

Include the 5 most recent snapshots plus current data.

Specific Snapshots:

{
"snapshotDatasets": [
"orders-2024-jan",
"orders-2024-feb",
"orders-2024-mar"
],
"includeLatest": false
}

Include only specific snapshot datasets.

Mixed Approach:

{
"type": "n",
"n": 3,
"includeLatest": true,
"snapshotDatasets": ["orders-2023-dec"]
}

Include last 3 snapshots, current data, and a specific older snapshot.

Record Counts

The GET endpoint returns multiple count fields:

  • count: Records after applying report-level filters and snapshot inclusion
  • countWithoutSnapshots: Records in the base dataset only (excluding snapshots)
  • overallCount: Total records including all configured snapshots

These counts help understand the data volume and snapshot impact.