Skip to Content

Semantic Layer APIs

Delete a semantic layer

Clear all descriptions, synonyms and column types of a datamart.

DELETE
/api/v2/data-app/datamarts/semantic-layer

The datamart, its tables, columns and joins stay. Only the semantic text goes, and the completion score becomes 0.

curl --request DELETE \  "https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=Sales" \  --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"

You cannot undo this. Read the layer with GET first if you want to keep a copy.

Auth

A service token only. See Authentication.

Authorization

ServiceToken
headerAuthorizationBearer <token>

A service token. A data app API token is refused.

Query

datamartNamestringrequired

The datamart.

Response

{ "id": "Sales" }

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYdatamartName is missing
400INVALID_DATAMARTNo datamart has this name
403AUTHENTICATION_ERRORYou used a data app API token
404SEMANTIC_LAYER_NOT_FOUNDThe datamart has no semantic layer, or you already deleted it
409LAYER_MANAGED_BY_V2The datamart belongs to a semantic model. Edit it in the app

For errors that every endpoint returns, see Authentication.

Example Request
curl -X DELETE 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=string'
Example Response
{  "id": "Sales"}