Skip to Content

Datamart APIs

List datamarts

Get every datamart in your organization, with its tables, columns, joins and tenancy.

GET
/api/v2/data-app/datamarts
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.

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Query

true returns 10 datamarts per page. Without it you get all.

Default: false
pageNumberinteger

Page, from 1. Used only with isPagination=true

Default: 1

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            }          ]        }      ]    }  ]}
FieldDescription
idThe datamart UUID
nameThe datamart name. Use it as datamartName
companyIntegration.idThe datasource id
companyIntegration.nameThe datasource type, for example Postgres. Not your datasource name
datamartOrganizationThe tenancy, or null when the datamart has none
datamartRelationships, datamartTablesOnly with expandDetails on. Same fields as create

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYpageNumber is not a number
500INTERNAL_SERVER_ERRORThe list could not be read, for example a negative pageNumber

For errors that every endpoint returns, see Authentication.

Example Request
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            }          ]        }      ]    }  ]}