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
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false
}
]
}
]
}
],
"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
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false
}
]
}
]
}
],
"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
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false
}
]
}
]
}
],
"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
},
{
"columnName": "name",
"datatype": "varchar",
"alias": "customer_name",
"label": "Customer Name",
"isHide": false
}
]
}
]
}
],
"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.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
}
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").null when not set.false.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...'