Datamart APIs
Update Datamart
Update an existing datamart’s table configurations and tenancy settings without recreating from scratch.
PUT
Update the table list and tenancy settings of an existing datamart. This endpoint allows you to modify which tables and columns are accessible through the datamart, as well as update multi-tenant configurations.Documentation Index
Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
Use this file to discover all available pages before exploring further.
The datamart name identifies which datamart to update and cannot be changed through this endpoint. To rename a datamart, you’ll need to delete the old one and create a new one with the desired name.
Authentication
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:- In Settings page, navigate to the Service Tokens section.
- Click the “Generate Token” button to create a new service token if you don’t have one already.
Headers
Bearer token for API authentication. Use your service token.
Must be set to
application/json for all requests.Request Body
Name of the existing datamart to update. Must match exactly (case-sensitive).
Array of tables with columns to include in the datamart. Optional - if not provided, only tenancy settings will be updated.
Table name from your datasource. Must exist in the datasource schema.
Optional schema name (required only for schema-based datasources like PostgreSQL, SQL Server).
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.
Optional flag to hide the table from the datamart interface.
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.
Optional wildcard index pattern for OpenSearch tables. When set, this value is used as the table name in queries, enabling you to query multiple OpenSearch indices that match a pattern.
List of column objects for this table. Must be non-empty.
Column name from the table. Must exist in the datasource schema.
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. Defaults to
false.Optional flag to mark this as a custom/calculated column. When
true, the sql field is required to define the column’s SQL expression.SQL expression that defines the calculated value for a custom column. Required when
isCustomColumn 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.Optional flag to enable timezone conversion for this column. When
true, the column’s datetime values are converted using the timezone passed as params.timezone in the guest token at query execution time.This field has no effect unless
params.timezone is set in the guest token. See Timezone Handling in Guest Token for the full setup guide.Multi-tenant configuration for the datamart. Optional - if not provided, existing tenancy settings remain unchanged.
The level at which tenant isolation occurs. Must be one of:
TABLE, DATABASE, or MULTI_DATABASE.TABLE: Client mapping is stored in a specific table (most common)DATABASE: Each client has a separate database instanceMULTI_DATABASE: Tenancy spans multiple databases with optional default routing viaprimaryDatabase
Data type of the client identifier column. Must be either
NUMBER or STRING.Required when tenancySettings.tenancyLevel is set to TABLE in the request.Optional primary database name used for
DATABASE and MULTI_DATABASE tenancy levels.- If
tenancyLevelisDATABASEorMULTI_DATABASE, this value is stored (ornullwhen omitted). - In update requests, if
tenancySettingsis sent withouttenancyLevel, backend logic clearsprimaryDatabasetonull. - If
tenancyLevelisTABLE, backend logic also clearsprimaryDatabasetonull.
Schema name where the client mapping table is located.Required when
tenancySettings.tenancyLevel is set to TABLE in the request.Name of the table that contains client mapping information.Required when
tenancySettings.tenancyLevel is set to TABLE in the request.Column name in the mapping table that stores the client identifier.Required when
tenancySettings.tenancyLevel is set to TABLE in the request.Primary key column of the client mapping table.Required when
tenancySettings.tenancyLevel is set to TABLE in the request.Optional array of table relationships to define how tables in the datamart are connected. Relationships enable joins between tables for more complex queries.
Name of the parent table in the relationship.
Column name in the parent table that participates in the relationship.
Name of the child table in the relationship.
Column name in the child table that participates in the relationship.
A descriptive name for the relationship (e.g., “orders_to_customers”).
The cardinality of the relationship. Must be one of:
ManyToMany, ManyToOne, OneToMany, OneToOne.Optional: Can be omitted or set to null if not specified.The type of SQL join to use. Must be one of:
INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN.Optional: Can be omitted or set to null if not specified.Response
The name of the updated datamart (same as the input datamartName) on success.
Error object returned only when the request fails. Not included in successful responses.
Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - Datamart updated successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error - Server error occurred |
Possible Errors
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters |
INVALID_DATAMART | 400 | Datamart not found |
INVALID_DATA_APP_API_KEY | 401 | Invalid API key |
INTERNAL_SERVER_ERROR | 500 | Server error |
Quick Start Guide
Get current configuration
Retrieve the existing datamart configuration before making changes:
Save this response in case you need to rollback your changes.
Prepare your update
Determine what you want to update:
- Tables/Columns: Prepare the complete new tableList (replaces existing)
- Tenancy: Prepare updated tenancySettings (optional)
- Both: You can update both in a single request
Next Steps
Create Datamart
Create a new datamart from scratch
List Datamarts
View all datamarts in your organization
Delete Datamart
Remove datamarts you no longer need
Datamart Concepts
Learn more about datamarts

