Workspace APIs
Create Workspace
Create a new workspace with datasource, datamart, multi-datasource, or multi-datamart configuration to organize your analytics environment.
POST
Create workspaces to organize your analytics environment by connecting datasources or datamarts. Workspaces serve as containers for dashboards and metrics, providing structured access to your data.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.
Choose a
connectionType that matches how this workspace will use data. For DATASOURCE or DATAMART, the corresponding datasourceName or datamartName must already exist in your organization. For MULTI_DATASOURCE or MULTI_DATAMART, those name fields are not required in the request body (see connectionType below).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 workspace to create. Must be unique within your organization.
Type of connection for the workspace. Must be one of:
DATASOURCE, DATAMART, MULTI_DATASOURCE, or MULTI_DATAMART.Name of the datasource to connect to this workspace.Required when
connectionType is DATASOURCE.Name of the datamart to connect to this workspace.Required when
connectionType is DATAMART.Optional primary LLM name for workspace-level AI features. Must match an existing LLM configured in your organization.
Optional list of LLM names available for AI Copilot in this workspace. Every value must match an existing organization LLM name.
Optional flag to enable AI-powered metric suggestions in this workspace. Defaults to
false when omitted.Optional flag to enable AI-generated metric summaries in this workspace. Defaults to
false when omitted.Summary mode used when metric summaries are enabled. Must be one of:
technicalAndInsightSummary, forecastAndTrendAnalysis, comparativeAndAnomalyDetection, custom.Required when isEnableMetricSummary is true.Custom summary instruction prompt for AI-generated summaries.Required when
summaryType is custom.Optional workspace theme name. Must match an existing theme configured in your organization.
Response
Contains the created workspace information on success.
Error object if the request failed, otherwise
null for successful requests.Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - Workspace created 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 |
WORKSPACE_NAME_ALREADY_EXISTS | 400 | Workspace name already exists |
INVALID_DATASOURCE_NAME | 400 | Datasource not found |
INVALID_DATAMART_NAME | 400 | Datamart not found |
INVALID_LLM_NAME | 400 | Invalid LLM name provided |
INVALID_AI_COPILOT_LLMS | 400 | Invalid AI Copilot LLM list |
INVALID_THEME_NAME | 400 | Invalid theme name provided |
INVALID_DATA_APP_API_KEY | 401 | Invalid API key |
INTERNAL_SERVER_ERROR | 500 | Server error |
Quick Start Guide
Verify prerequisites
Before creating a workspace, ensure you have:
- A valid API token from your data app
- Either a datasource or datamart already configured
- The exact name of your datasource or datamart (case-sensitive)
Choose your connection type
Decide which connection type fits your use case:
- DATASOURCE: For connecting to a single data source
- DATAMART: For connecting to a pre-configured datamart with table/column configurations
- MULTI_DATASOURCE: For workspaces that need access to multiple datasources
- MULTI_DATAMART: For workspaces that support multiple datamarts (same API shape as multi-datasource: only
nameandconnectionTypein the minimal body)
Create your workspace
Make the API call with your chosen configuration:
Successful response returns the workspace name. Save this for use in embed configurations.

