Datamart APIs
List datamarts
Get every datamart in your organization, with its tables, columns, joins and tenancy.
GET
curl "https://api.usedatabrain.com/api/v2/data-app/datamarts?isPagination=true&pageNumber=1&expandDetails=false" \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"Auth
A service token. See Authentication.
ApiTokenheader
AuthorizationBearer <token>A service token or a data app API token.
Query
expandDetailsstring
true (the default) adds tables, columns and joins. Any other value leaves them out.
The order is not fixed and there is no total count.
Response
{ "data": [ { "id": "0d2e7a3c-5b1f-4c9e-8a6d-3f4b2c1e0a9d", "name": "Sales", "createdAt": "2026-11-02T09:14:00.000Z", "updatedAt": "2026-11-18T16:40:00.000Z", "companyIntegration": { "id": "6f1c2b9e-4d3a-4f8e-9b7c-2a1d0e5f6c7b", "name": "Postgres" }, "datamartOrganization": { "tenancyLevel": "TABLE", "clientColumnType": "STRING", "schemaName": "public", "tableName": "customers", "tableClientNameColumn": "name", "tablePrimaryKeyColumn": "id", "primaryDatabase": null }, "datamartRelationships": [ { "relationshipName": "orders_customers", "parentTableName": "orders", "parentColumnName": "customer_id", "childTableName": "customers", "childColumnName": "id", "cardinality": "ManyToOne", "join": "LEFT JOIN" } ], "datamartTables": [ { "schemaName": "public", "tableName": "orders", "label": "", "clientColumn": "customer_id", "isHide": false, "datamartTableColumns": [ { "columnName": "amount", "datatype": "numeric", "alias": null, "label": "", "isHide": false, "isCustomColumn": false, "sql": null, "isApplyTimezone": false, "allowAggregate": true, "defaultAggregation": "SUM", "defaultSort": null } ] } ] } ]}| Field | Description |
|---|---|
id | The datamart UUID |
name | The datamart name. Use it as datamartName |
companyIntegration.id | The datasource id |
companyIntegration.name | The datasource type, for example Postgres. Not your datasource name |
datamartOrganization | The tenancy, or null when the datamart has none |
datamartRelationships, datamartTables | Only with expandDetails on. Same fields as create |
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | pageNumber is not a number |
| 500 | INTERNAL_SERVER_ERROR | The list could not be read, for example a negative pageNumber |
For errors that every endpoint returns, see Authentication.
curl -X GET 'https://api.usedatabrain.com/api/v2/data-app/datamarts'Example Response
{ "data": [ { "id": "0d2e7a3c-5b1f-4c9e-8a6d-3f4b2c1e0a9d", "name": "Sales", "createdAt": "2026-11-02T09:14:00.000Z", "updatedAt": "2026-11-18T16:40:00.000Z", "companyIntegration": { "id": "6f1c2b9e-4d3a-4f8e-9b7c-2a1d0e5f6c7b", "name": "Postgres" }, "datamartOrganization": { "tenancyLevel": "TABLE", "clientColumnType": "STRING", "schemaName": "public", "tableName": "customers", "tableClientNameColumn": "name", "tablePrimaryKeyColumn": "id", "primaryDatabase": null }, "datamartRelationships": [ { "relationshipName": "orders_customers", "parentTableName": "orders", "parentColumnName": "customer_id", "childTableName": "customers", "childColumnName": "id", "cardinality": "ManyToOne", "join": "LEFT JOIN" } ], "datamartTables": [ { "schemaName": "public", "tableName": "orders", "label": "", "clientColumn": "customer_id", "isHide": false, "datamartTableColumns": [ { "columnName": "amount", "datatype": "numeric", "alias": null, "label": "", "isHide": false, "isCustomColumn": false, "sql": null, "isApplyTimezone": false, "allowAggregate": true, "defaultAggregation": "SUM", "defaultSort": null } ] } ] } ]}