curl --request PUT \
--url https://api.usedatabrain.com/api/v2/workspace \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"name": "Sales Analytics",
"connectionType": "DATASOURCE",
"datasourceName": "postgres-production"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/workspace \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"name": "Sales Analytics",
"connectionType": "DATASOURCE",
"datasourceName": "postgres-production"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
Update an existing workspace’s connection settings to change datasource, datamart, multi-datasource, or multi-datamart configuration.
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/workspace \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"name": "Sales Analytics",
"connectionType": "DATASOURCE",
"datasourceName": "postgres-production"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
curl --request PUT \
--url https://api.usedatabrain.com/api/v2/workspace \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"name": "Sales Analytics",
"connectionType": "DATASOURCE",
"datasourceName": "postgres-production"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
Authorization: Bearer dbn_live_abc123...
application/json for all requests.Content-Type: application/json
Show Finding workspace names
DATASOURCE, DATAMART, MULTI_DATASOURCE, or MULTI_DATAMART.Show Connection type details
MULTI_DATASOURCE or MULTI_DATAMART, datasourceName and datamartName are optional; the API clears prior single-datasource or single-datamart links and enables the selected multi mode. For DATASOURCE or DATAMART, datasourceName or datamartName is required (respectively), and multi-datasource / multi-datamart modes are turned off.connectionType is DATASOURCE.Show Datasource considerations
connectionType is DATAMART.Show Datamart considerations
technicalAndInsightSummary, forecastAndTrendAnalysis, comparativeAndAnomalyDetection, custom.Required when isEnableMetricSummary is true.summaryType is custom.Show data properties
| Status Code | Description |
|---|---|
200 | OK - Workspace updated successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error - Server error occurred |
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters |
WORKSPACE_DOES_NOT_EXIST | 400 | Workspace not found |
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 |