Workspace APIs
Delete Workspace
Permanently delete a workspace from your organization by name.
DELETE
Permanently delete a workspace. The workspace is identified by the
name query parameter. The payload is validated with name: required string (Joi.string().required()).
This action is irreversible. Ensure no dashboards, metrics, or embeds still depend on this workspace before deleting it.
Endpoint
Self-hosted Databrain Endpoint
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.
Query Parameters
Workspace name to delete. Must match an existing workspace in your organization (case-sensitive, same string as returned by list/create).If
name is omitted, validation fails with INVALID_REQUEST_BODY and the Joi validation message (for example "name" is required).Response
On success, the API returns a top-leveldata object (same shape as other /api/v2/workspace handlers).
On success,
error is omitted or null. On failure, contains code and message (see examples below).Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK — Workspace deleted successfully |
400 | Bad Request — Missing/invalid API key (middleware), Joi validation failed, or workspace not found |
401 | Unauthorized — Invalid/expired token or missing required scopes (middleware) |
500 | Internal Server Error — Delete mutation failed or unexpected error |
Possible Errors
| Error code | HTTP status | When it occurs |
|---|---|---|
AUTHENTICATION_ERROR | 400 | Authorization missing or malformed (isPrivateApp middleware) |
INVALID_REQUEST_BODY | 400 | deleteWorkspaceSchema validation failed (e.g. missing name) |
WORKSPACE_ID_ERROR | 400 | No workspace with that name for your company |
AUTHENTICATION_ERROR | 401 | Service token invalid, expired, or missing required scopes |
INTERNAL_SERVER_ERROR | 500 | Delete mutation returned no row, GraphQL error, or handler catch |
Next Steps
List Workspaces
List remaining workspaces in your organization
Create Workspace
Create a new workspace after deletion
Update Workspace
Update workspace settings instead of deleting

