Skip to main content
curl --request POST \
  --url 'https://api.usedatabrain.com/api/v2/dataApp/datamart/delete' \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "datamartName": "sales-analytics"
  }'
{
  "id": "sales-analytics",
  "error": null
}
DELETE
/
api
/
v2
/
data-app
/
datamart
curl --request POST \
  --url 'https://api.usedatabrain.com/api/v2/dataApp/datamart/delete' \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "datamartName": "sales-analytics"
  }'
{
  "id": "sales-analytics",
  "error": null
}
Permanently delete a datamart from your organization. This will remove the datamart and all its associated configurations.
Endpoint Migration Notice: We’re transitioning to kebab-case endpoints. The new endpoint is /api/v2/data-app/datamart. The old endpoint /api/v2/dataApp/datamart will be deprecated soon. Please update your integrations to use the new endpoint format.
This action is irreversible. Once a datamart is deleted, all its data configurations and associated embed configurations will be permanently removed.

Endpoint Formats

Authentication

All API requests must include your API key in the Authorization header. Get your API token when creating a data app - see our data app creation guide for details. Finding your API token: For detailed instructions, see the API Token guide.

Headers

Authorization
string
required
Bearer token for API authentication. Use your API key from the data app.
Authorization: Bearer dbn_live_abc123...

Query Parameters

datamartName
string
required
The name of the datamart to delete. Must match an existing datamart name in your organization.

Response

id
string
The name of the deleted datamart for confirmation.
error
null
Error field, null when successful.

Examples

Legacy Endpoint Examples

The following examples use the deprecated POST endpoint. These are provided for reference only. Please use the DELETE endpoint examples above for all new integrations.

Error Codes

INVALID_REQUEST_BODY
string
Invalid request body - Check that datamartName is provided and valid
INTERNAL_SERVER_ERROR
string
Unexpected failure - Internal server error occurred

HTTP Status Code Summary

Status CodeDescription
200OK - Datamart deleted successfully
400Bad Request - Invalid request parameters or datamart not found
401Unauthorized - Invalid or expired API token
500Internal Server Error - Unexpected server error

Possible Errors

CodeMessageHTTP Status
INVALID_REQUEST_BODYDatamart not found400
INTERNAL_SERVER_ERRORUnexpected failure500

Best Practices

Check Dependencies

Before deleting, verify no embed configurations depend on this datamart

Backup Data

Consider exporting important configurations before deletion

Test Environment

Test deletion process in a non-production environment first

Documentation

Document the deletion for audit and compliance purposes

Quick Start Guide

1

List your datamarts

First, see which datamarts you have available to identify the one to delete:
curl --request GET \
  --url https://api.usedatabrain.com/api/v2/data-app/datamarts \
  --header 'Authorization: Bearer dbn_live_abc123...'
2

Check dependencies

Before deleting, ensure no embed configurations are using this datamart. Use the List Embeds API to verify.
3

Delete the datamart

Make the deletion request with the exact datamart name as a query parameter:
curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamart?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...'
4

Update dependent configurations

Update any embed configurations that were using this datamart to reference a different datamart:
// Update embeds that used the deleted datamart
await updateEmbed({
  embedId: 'embed_123',
  accessSettings: {
    datamartName: 'replacement-datamart'
  }
});
Critical: This action permanently deletes the datamart and cannot be undone. Ensure all dependent configurations are updated before deletion.

Next Steps

I