curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1' \
--header 'Authorization: Bearer dbn_live_abc123...'
{
"data": [
{
"name": "sales-analytics",
"datamartOrganization": {
"tenancyLevel": "TABLE",
"schemaName": "public",
"tableName": "organizations",
"clientColumnType": "STRING",
"tableClientNameColumn": "name",
"tablePrimaryKeyColumn": "id"
},
"companyIntegration": {
"name": "postgres-prod"
},
"datamartTables": [
{
"schemaName": "public",
"tableName": "customers",
"label": "Customer Records",
"clientColumn": "id",
"isHide": false,
"datamartTableColumns": [
{
"columnName": "id",
"datatype": "integer",
"alias": "customer_id",
"label": "Customer ID",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "created_at",
"datatype": "timestamp",
"alias": "created_at",
"label": "Created At",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": true
}
]
}
]
}
],
"datamartRelationships": [
{
"parentTableName": "orders",
"parentColumnName": "customer_id",
"childTableName": "customers",
"childColumnName": "id",
"relationshipName": "orders_to_customers",
"cardinality": "ManyToOne",
"join": "LEFT JOIN"
}
]
}
],
"error": null
}
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1' \
--header 'Authorization: Bearer dbn_live_abc123...'
{
"data": [
{
"name": "sales-analytics",
"datamartOrganization": {
"tenancyLevel": "TABLE",
"schemaName": "public",
"tableName": "organizations",
"clientColumnType": "STRING",
"tableClientNameColumn": "name",
"tablePrimaryKeyColumn": "id"
},
"companyIntegration": {
"name": "postgres-prod"
},
"datamartTables": [
{
"schemaName": "public",
"tableName": "customers",
"label": "Customer Records",
"clientColumn": "id",
"isHide": false,
"datamartTableColumns": [
{
"columnName": "id",
"datatype": "integer",
"alias": "customer_id",
"label": "Customer ID",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "created_at",
"datatype": "timestamp",
"alias": "created_at",
"label": "Created At",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": true
}
]
}
]
}
],
"datamartRelationships": [
{
"parentTableName": "orders",
"parentColumnName": "customer_id",
"childTableName": "customers",
"childColumnName": "id",
"relationshipName": "orders_to_customers",
"cardinality": "ManyToOne",
"join": "LEFT JOIN"
}
]
}
],
"error": null
}
Retrieve a list of all datamarts in your data app with their configurations and access settings.
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1' \
--header 'Authorization: Bearer dbn_live_abc123...'
{
"data": [
{
"name": "sales-analytics",
"datamartOrganization": {
"tenancyLevel": "TABLE",
"schemaName": "public",
"tableName": "organizations",
"clientColumnType": "STRING",
"tableClientNameColumn": "name",
"tablePrimaryKeyColumn": "id"
},
"companyIntegration": {
"name": "postgres-prod"
},
"datamartTables": [
{
"schemaName": "public",
"tableName": "customers",
"label": "Customer Records",
"clientColumn": "id",
"isHide": false,
"datamartTableColumns": [
{
"columnName": "id",
"datatype": "integer",
"alias": "customer_id",
"label": "Customer ID",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "created_at",
"datatype": "timestamp",
"alias": "created_at",
"label": "Created At",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": true
}
]
}
]
}
],
"datamartRelationships": [
{
"parentTableName": "orders",
"parentColumnName": "customer_id",
"childTableName": "customers",
"childColumnName": "id",
"relationshipName": "orders_to_customers",
"cardinality": "ManyToOne",
"join": "LEFT JOIN"
}
]
}
],
"error": null
}
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1' \
--header 'Authorization: Bearer dbn_live_abc123...'
{
"data": [
{
"name": "sales-analytics",
"datamartOrganization": {
"tenancyLevel": "TABLE",
"schemaName": "public",
"tableName": "organizations",
"clientColumnType": "STRING",
"tableClientNameColumn": "name",
"tablePrimaryKeyColumn": "id"
},
"companyIntegration": {
"name": "postgres-prod"
},
"datamartTables": [
{
"schemaName": "public",
"tableName": "customers",
"label": "Customer Records",
"clientColumn": "id",
"isHide": false,
"datamartTableColumns": [
{
"columnName": "id",
"datatype": "integer",
"alias": "customer_id",
"label": "Customer ID",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": false
},
{
"columnName": "created_at",
"datatype": "timestamp",
"alias": "created_at",
"label": "Created At",
"isHide": false,
"isCustomColumn": false,
"sql": "",
"isApplyTimezone": true
}
]
}
]
}
],
"datamartRelationships": [
{
"parentTableName": "orders",
"parentColumnName": "customer_id",
"childTableName": "customers",
"childColumnName": "id",
"relationshipName": "orders_to_customers",
"cardinality": "ManyToOne",
"join": "LEFT JOIN"
}
]
}
],
"error": null
}
/api/v2/data-app/datamarts. The old endpoint /api/v2/dataApp/datamarts will be deprecated soon. Please update your integrations to use the new endpoint format.expandDetails parameter when you only need names and organization metadata and want a smaller payload: when expandDetails is false, datamartTables and datamartRelationships are omitted from each item (see Query Parameters).GET https://api.usedatabrain.com/api/v2/data-app/datamarts
POST https://api.usedatabrain.com/api/v2/dataApp/datamart/list
Content-Type: application/json
{
"isPagination": true,
"pageNumber": 1,
"expandDetails": false
}
application/json. The same getDatamartListSchema rules apply: optional isPagination (boolean), pageNumber (number), expandDetails (boolean).Send isPagination and pageNumber as JSON boolean and number — string values (for example "true") usually fail Joi validation. For expandDetails, the route normalizes the body value before validation (booleans or string forms such as "true" / "false"); if expandDetails is omitted, getDatamartList defaults to expanded details, same as GET when the query parameter is omitted. Set it to false to omit datamartTables and datamartRelationships from each datamart.Authorization: Bearer dbn_live_abc123...
"true" to enable pagination with a limit of 10 per page.Note: Query parameters are passed as strings. Use "true" or "false" (not boolean values)."true". Must be a numeric string (e.g., "1", "2", "3").datamartTables (with datamartTableColumns) and datamartRelationships in the response.expandDetails query parameter is omitted, the route passes expandDetails: true into getDatamartList (expanded)."true" or "false" (the server compares to 'true').false), each item still includes name, createdAt, updatedAt, datamartOrganization, and companyIntegration.Legacy POST accepts expandDetails in the JSON body; the route coerces it to a boolean before getDatamartListSchema runs (see the Legacy tab). Omit expandDetails to default to expanded details.Note: On GET, query parameters are strings — use "true" or "false", not raw booleans.getDatamartListSchema allows optional isPagination (boolean), pageNumber (number), and expandDetails (boolean). On GET /api/v2/data-app/datamarts, query strings are mapped first: isPagination is true only when equal to "true"; pageNumber uses parseInt when present; expandDetails defaults to true when the query parameter is omitted, otherwise it is true only when the string equals "true". On POST /api/v2/dataApp/datamart/list, isPagination and pageNumber are taken from the JSON body as-is; expandDetails is normalized from the body, then the same schema validates the combined payload inside getDatamartList.datamartTables and datamartRelationships fields documented below are present only when expanded details are enabled (expandDetails not set to false). With expandDetails=false, rely on name, createdAt, updatedAt, datamartOrganization, and companyIntegration only.null when not set.false.false.true when the column was created with isCustomColumn: true.isCustomColumn is false.true, datetime values are converted at query time using the timezone specified in params.timezone of the guest token. Defaults to false.ManyToMany, ManyToOne, OneToMany, OneToOne, or null if not specified.INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, or null if not specified.| Status Code | Description |
|---|---|
| 200 | OK - Request successful |
| 400 | Bad Request - Invalid request parameters or missing API key |
| 401 | Unauthorized - Invalid or expired API token |
| 500 | Internal Server Error - Unexpected server error |
| Code | Message | HTTP Status |
|---|---|---|
| INVALID_DATA_APP_API_KEY | Missing or invalid data app | 400 |
| INTERNAL_SERVER_ERROR | Unexpected failure | 500 |
// Get all datamarts
const datamarts = await listDatamarts();
console.log(`Total datamarts: ${datamarts.data.length}`);
// Get first page of datamarts
const datamarts = await listDatamarts({
isPagination: true,
pageNumber: 1
});
console.log(`Page 1 datamarts: ${datamarts.data.length}`);
// Process each datamart
const datamarts = await listDatamarts();
datamarts.data.forEach(datamart => {
console.log(`Datamart: ${datamart.name}`);
console.log(`Tables: ${datamart.datamartTables.length}`);
console.log(`Datasource: ${datamart.companyIntegration.name}`);
});
Get your API token
List all datamarts
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts' \
--header 'Authorization: Bearer dbn_live_abc123...'
Use pagination for large lists
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1' \
--header 'Authorization: Bearer dbn_live_abc123...'