Create datamarts to organize your data sources into logical business units. Datamarts provide structured access to your datasource tables and columns with optional schema support.
Endpoint Migration Notice: We’re transitioning to kebab-case endpoints. The new endpoint is /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.
Datamarts help organize data sources by defining which tables and columns are accessible. Tenancy settings are optional and can be omitted if multi-tenant data isolation is handled at the application level. Ensure your datasource exists before creating a datamart.
This endpoint requires a service token in the Authorization header. Service tokens differ from data app API keys and provide organization-level permissions.To access your service token:
Go to your Databrain dashboard and open Settings.
Navigate to Settings.
Find the Service Tokens section.
Click the “Generate Token” button to generate a new service token if you don’t have one already.
Use this token as the Bearer value in your Authorization header.
Optional column name in this table that identifies the client/tenant. This column is used for multi-tenant data isolation at the table level. Must exist in the table schema.
Show Client column usage
Used for table-level tenancy when tenancyLevel is TABLE
The column should contain client/tenant identifiers
Optional label for the table to provide a human-readable display name. When provided, this label can be used in the UI instead of the technical table name for better readability.
Show Label usage
Provides a user-friendly display name for the table
Useful when table names are cryptic or technical
Does not affect the actual table reference in queries
SQL expression that defines the calculated value for a custom column. Required whenisCustomColumn is true. The expression can reference other columns from the same table.
Optional flag to indicate if this column should be treated as an aggregate column. When true, the column is marked as AGGREGATE drop type for metric calculations.
Show Aggregate column usage
Aggregate columns are used for pre-aggregated metrics
Affects how the column behaves in metric calculations and drag-drop operations
Common for SUM, COUNT, AVG type pre-calculated values
Multi-tenant configuration for the datamart. Defines how data is isolated between different tenants/clients. Optional - if not provided, the datamart will be created without explicit tenancy settings.
Show Tenancy configuration details
TABLE level: Uses a dedicated table to map client identifiers
DATABASE level: Each client has a separate database
Optional - can be omitted if tenancy is handled at the application level
Optional array of table relationships to define how tables in the datamart are connected. Relationships enable joins between tables for more complex queries.
Show Relationship configuration
Define how tables relate to each other (e.g., orders.customer_id → customers.id)
Supports different join types and cardinalities
Useful for creating metrics that span multiple tables
Optional - datamarts can work without relationships for single-table queries
The cardinality of the relationship. Must be one of: ManyToMany, ManyToOne, OneToMany, OneToOne.Optional: Can be omitted or set to null if not specified.