Skip to main content
POST
/
team
/
{team_id}
/
datasets
/
quick-create
cURL
curl --request POST \
  --url https://api.chartbrew.com/team/{team_id}/datasets/quick-create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "team_id": 123,
  "project_ids": [
    123
  ],
  "draft": true,
  "name": "<string>",
  "dimension": "<string>",
  "metric": "<string>",
  "metricOperation": "none",
  "dateField": "<string>",
  "dateFormat": "<string>",
  "legend": "<string>",
  "conditions": [
    {
      "id": "<string>",
      "field": "<string>",
      "operator": "is",
      "value": "<string>",
      "displayValues": true
    }
  ],
  "fieldsSchema": {},
  "joinSettings": {
    "joins": [
      {
        "dr_id": 123,
        "join_id": 123,
        "dr_field": "<string>",
        "join_field": "<string>",
        "alias": "<string>"
      }
    ]
  },
  "dataRequests": [
    {
      "connection_id": 123,
      "method": "GET",
      "route": "<string>",
      "headers": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ],
      "body": "<string>",
      "useGlobalHeaders": true,
      "query": "<string>",
      "pagination": false,
      "itemsLimit": 0,
      "offset": "offset",
      "paginationField": "<string>",
      "template": "<string>",
      "conditions": [
        {
          "field": "<string>",
          "operator": "<string>",
          "value": "<string>"
        }
      ],
      "configuration": {
        "populateAttributes": true,
        "mainCollectionSample": "<string>",
        "subCollectionSample": "<string>",
        "selectedSubCollection": "<string>",
        "limit": 123,
        "orderBy": "<string>",
        "orderByDirection": "asc",
        "accountId": "<string>",
        "propertyId": "<string>",
        "metrics": "<string>",
        "dimensions": "<string>",
        "startDate": "<string>",
        "endDate": "<string>",
        "limitToLast": 123,
        "limitToFirst": 123
      },
      "transform": {
        "enabled": true,
        "type": "<string>",
        "configuration": {}
      },
      "variableBindings": [
        {
          "name": "<string>",
          "type": "string",
          "default_value": "<string>",
          "required": false
        }
      ]
    }
  ],
  "main_dr_index": 0,
  "variableBindings": [
    {
      "name": "<string>",
      "type": "string",
      "default_value": "<string>",
      "required": false
    }
  ]
}
'
{
  "id": 123,
  "team_id": 123,
  "project_ids": [
    123
  ],
  "chart_id": 123,
  "connection_id": 123,
  "draft": true,
  "name": "<string>",
  "query": "<string>",
  "xAxis": "<string>",
  "xAxisOperation": "<string>",
  "yAxis": "<string>",
  "yAxisOperation": "none",
  "dateField": "<string>",
  "dateFormat": "<string>",
  "legend": "<string>",
  "fieldsSchema": {},
  "excludedFields": [
    "<string>"
  ],
  "configuration": {},
  "joinSettings": {
    "joins": [
      {
        "dr_id": 123,
        "join_id": 123,
        "dr_field": "<string>",
        "join_field": "<string>"
      }
    ]
  }
}
This endpoint is for creating the reusable dataset and its data requests. Use name as the canonical dataset name.
Legacy binding inputs such as dimension, metric, metricOperation, dateField, dateFormat, conditions, and legend are still accepted for compatibility, but new chart-specific bindings should be added to chartDatasetConfigs[] on the chart quick-create flow instead of the dataset.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

team_id
string
required

ID of the team

Body

application/json

Create a dataset with all its data requests in one API call. This endpoint is dataset-focused. Per-chart bindings should be configured on ChartDatasetConfig when creating or updating charts.

team_id
integer
required

ID of the team

project_ids
integer[]

Array of project IDs where members can access the dataset

draft
boolean
default:true

Whether the dataset is a draft and should be hidden from dashboard viewers

name
string

Canonical dataset name.

dimension
string

[Legacy compatibility] Dataset-level xAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].xAxis.

metric
string

[Legacy compatibility] Dataset-level yAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxis.

metricOperation
enum<string>
default:none

[Legacy compatibility] Dataset-level yAxisOperation fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxisOperation.

Available options:
none,
count,
count_unique,
sum,
avg,
min,
max
dateField
string

[Legacy compatibility] Dataset-level dateField fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateField.

dateFormat
string

[Legacy compatibility] Dataset-level dateFormat fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateFormat.

legend
string

[Legacy compatibility] Previous dataset name field. Prefer name for reusable dataset naming.

conditions
object[]

[Legacy compatibility] Dataset-level filter fallback. New chart-specific filters should be set on chartDatasetConfigs[].conditions.

fieldsSchema
object

Schema of the fields in the dataset key(field name) => value(type). This gets populated automatically whenever the dataset is used in a chart.

joinSettings
object

Join settings for the dataset. Use indices (0-based) in joins array to reference data requests before they are created.

dataRequests
object[]

Array of data requests to create with the dataset

main_dr_index
integer
default:0

Index (0-based) of the main data request in the dataRequests array. Defaults to 0.

variableBindings
object[]

Variable bindings for the dataset. The entity_type and entity_id will be automatically set.

Response

Created dataset with all data requests

id
integer
team_id
integer
project_ids
integer[]
chart_id
integer
connection_id
integer
draft
boolean
default:true
name
string

Canonical dataset name. Prefer this over legend when referring to the reusable dataset itself.

query
string
xAxis
string

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

xAxisOperation
string

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

yAxis
string

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

yAxisOperation
string
default:none

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

dateField
string

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

dateFormat
string

[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.

legend
string

[Legacy compatibility] Previous dataset name field. Prefer Dataset.name for reusable dataset naming.

fieldsSchema
object
excludedFields
string[]
configuration
object
joinSettings
object