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, or multi-datasource 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, or MULTI_DATASOURCE.Show Connection type details
connectionType is DATASOURCE.Show Datasource considerations
connectionType is DATAMART.Show Datamart considerations
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_DATA_APP_API_KEY | 401 | Invalid API key |
INTERNAL_SERVER_ERROR | 500 | Server error |