Datamarts help organize data sources by defining which tables and columns are accessible. Each datamart requires tenancy settings for multi-tenant data isolation. Ensure your datasource exists before creating a datamart.
Endpoint Formats
- New Endpoint (Recommended)
- Legacy Endpoint (Deprecated Soon)
Authentication
All API requests must include your API key in the Authorization header. Get your API token when creating a data app - see our data app creation guide for details. Finding your API token: For detailed instructions, see the API Token guide.Headers
Bearer token for API authentication. Use your API key from the data app.
Must be set to
application/json for all requests.Request Body
Name of the datamart to create. Must be unique within your organization.
The datasource to which this datamart belongs. Must match an existing datasource in your organization.
Array of tables with columns to include in the datamart. Must be non-empty.
Table name from your datasource.
Optional schema name (required only for schema-based datasources like PostgreSQL, SQL Server).
List of column objects for this table. Must be non-empty.
Column name from the table.
Optional alias for the column to display a different name.
Optional label for the column for better readability.
Optional flag to hide the column from the datamart interface.
Multi-tenant configuration for the datamart. Defines how data is isolated between different tenants/clients.
The level at which tenant isolation occurs. Must be either
TABLE or DATABASE.TABLE: Client mapping is stored in a specific table (most common)DATABASE: Each client has a separate database instance
Data type of the client identifier column. Must be either
NUMBER or STRING.Required when tenancyLevel is TABLE.Schema name where the client mapping table is located.Required when
tenancyLevel is TABLE.Name of the table that contains client mapping information.Required when
tenancyLevel is TABLE.Column name in the mapping table that stores the client identifier.Required when
tenancyLevel is TABLE.Primary key column of the client mapping table.Required when
tenancyLevel is TABLE.Response
The name of the created datamart (same as the input name).
Error object if the request failed, otherwise
null for successful requests.Examples
Error Codes
Invalid request body - Check required fields, table list cannot be empty
Invalid datasource name - The specified datasource doesn’t exist or you don’t have access
Server error - Contact support if error persists
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - Datamart created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Access denied to datasource |
404 | Not Found - Datasource not found |
409 | Conflict - Datamart name already exists |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error occurred |
Possible Errors
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters |
DATASOURCE_NAME_ERROR | 404 | Datasource not found |
DUPLICATE_DATAMART_NAME | 409 | Datamart name already exists |
EMPTY_TABLE_LIST | 400 | Table list cannot be empty |
INVALID_COLUMN_CONFIG | 400 | Invalid column configuration |
MISSING_TENANCY_SETTINGS | 400 | Tenancy settings are required |
INVALID_TENANCY_LEVEL | 400 | Invalid tenancy level |
MISSING_TENANCY_FIELDS | 400 | Required tenancy fields missing |
AUTHENTICATION_ERROR | 401 | Invalid API key |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
INTERNAL_SERVER_ERROR | 500 | Server error |
Quick Start Guide
1
Verify your datasource
Ensure your datasource exists and is properly configured. You’ll need the exact datasource name as it appears in your DataBrain workspace.
2
Prepare your table structure
Identify the tables and columns you want to include in your datamart:
3
Create your datamart
Make the API call to create your datamart:
4
Use your datamart
Reference your new datamart in embed configurations:

