Skip to main content
curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...'
{
  "id": "sales-analytics"
}
DELETE
/
api
/
v2
/
data-app
/
datamarts
/
semantic-layer
curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...'
{
  "id": "sales-analytics"
}
Permanently remove all semantic layer metadata from a datamart. This clears table descriptions, column metadata (descriptions, synonyms, column types, configs), and feedback. The underlying datamart structure (tables, columns) remains intact.
This action cannot be undone. All semantic metadata — descriptions, synonyms, column types, and feedback — will be permanently removed.
The datamart itself is not deleted. Only the semantic layer enrichments are removed. You can recreate the semantic layer using the POST endpoint.

Authentication

This endpoint requires a service token in the Authorization header. Data app API tokens are not permitted and will be rejected with a 403 error. To access your service token:
  1. Go to your Databrain dashboard and open Settings.
  2. Navigate to Settings.
  3. Find the Service Tokens section.
  4. Click the “Generate Token” button to generate a new service token if you don’t have one already.
Use this token as the Bearer value in your Authorization header.

Headers

Authorization
string
required
Bearer token for API authentication. Use your service token.
Authorization: Bearer dbn_live_abc123...

Query Parameters

datamartName
string
required
The name of the datamart whose semantic layer you want to delete. Must match an existing datamart that has semantic data.

Response

On success, the response body contains only the datamart name. There is no error field in the JSON body when the request succeeds.
id
string
The name of the datamart whose semantic layer was deleted.

Examples

HTTP Status Code Summary

Status CodeDescription
200OK — Semantic layer deleted successfully
400Bad Request — Missing datamartName or datamart not found
401Unauthorized — Invalid or missing API token
403Forbidden — Data app token used instead of service token
404Not Found — No semantic layer exists for this datamart
500Internal Server Error — Server error occurred

Possible Errors

Error CodeHTTP StatusDescription
INVALID_REQUEST_BODY400datamartName query parameter is missing
INVALID_DATAMART400Datamart not found
SEMANTIC_LAYER_NOT_FOUND404No semantic layer exists for this datamart
AUTHENTICATION_ERROR403Data app token used instead of service token
INTERNAL_SERVER_ERROR500Server error

Best Practices

Backup First

Use the GET endpoint to save a copy of the semantic layer before deleting

Check Dependencies

AI chat mode relies on the semantic layer — verify impact before deleting

Quick Start Guide

1

Backup the semantic layer

Retrieve and save the current semantic layer data:
curl --request GET \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  -o semantic-layer-backup.json
2

Delete the semantic layer

curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...'
3

Verify deletion

Retrieve the datamart again to confirm the semantic layer was cleared:
curl --request GET \
  --url 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=sales-analytics' \
  --header 'Authorization: Bearer dbn_live_abc123...'
The response should show null descriptions, empty synonyms, and a completion score of 0.

Next Steps

Create Semantic Layer

Recreate the semantic layer with fresh metadata

Get Semantic Layer

Verify the deletion

Semantic Layer Guide

Configure the semantic layer in the Databrain UI

List Datamarts

View your datamarts