curl --request POST \
--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-main"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
curl --request POST \
--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-main"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
Create a new workspace with datasource, datamart, or multi-datasource configuration to organize your analytics environment.
curl --request POST \
--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-main"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
curl --request POST \
--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-main"
}'
{
"data": {
"name": "Sales Analytics"
},
"error": null
}
Authorization: Bearer dbn_live_abc123...
application/json for all requests.Content-Type: application/json
Show Naming guidelines
DATASOURCE, DATAMART, or MULTI_DATASOURCE.Show Connection type details
connectionType is DATASOURCE.Show Finding datasource names
connectionType is DATAMART.Show Finding datamart names
Show data properties
| 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 |
| 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_DATA_APP_API_KEY | 401 | Invalid API key |
INTERNAL_SERVER_ERROR | 500 | Server error |
Verify prerequisites
Choose your connection type
Create your workspace
curl --request POST \
--url https://api.usedatabrain.com/api/v2/workspace \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"name": "My Analytics Workspace",
"connectionType": "DATASOURCE",
"datasourceName": "postgres-main"
}'