Semantic Layer APIs
Get a semantic layer
Read the descriptions, synonyms and column types of every table in a datamart.
GET
curl "https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=Sales" \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"Auth
A service token only. See Authentication.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Query
The datamart.
Response
{ "data": { "datamartName": "Sales", "tables": [ { "name": "orders", "schemaName": "public", "description": "One row per order.", "synonyms": ["purchases", "sales"], "miscellaneousInfo": null, "columns": [ { "name": "status", "datatype": "varchar", "description": null, "synonyms": [], "miscellaneousInfo": null, "columnType": "ENUM", "columnTypeConfig": { "paid": "Payment received" }, "isIdentifier": false, "isNotIndexed": false } ] } ], "feedback": "Revenue means the sum of paid orders.", "completionScore": 40, "lastUpdated": "2026-11-18T16:40:00.000Z" }}| Field | Description |
|---|---|
tables | Every table of the datamart, also those with no text yet |
feedback | The note on the datamart, or null |
completionScore | 0 to 100: how many tables and columns have a description, synonyms and a column type |
lastUpdated | When the layer last changed, or null |
The fields of a table and a column are the ones on create, plus the column's datatype.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_DATAMART | datamartName is missing, or no datamart has this name |
| 403 | AUTHENTICATION_ERROR | You used a data app API token |
For errors that every endpoint returns, see Authentication.
curl -X GET 'https://api.usedatabrain.com/api/v2/data-app/datamarts/semantic-layer?datamartName=string'Example Response
{ "data": { "datamartName": "Sales", "tables": [ { "name": "orders", "schemaName": "public", "description": "One row per order.", "synonyms": [ "purchases", "sales" ], "miscellaneousInfo": null, "columns": [ { "name": "status", "datatype": "varchar", "description": null, "synonyms": [], "miscellaneousInfo": null, "columnType": "ENUM", "columnTypeConfig": { "paid": "Payment received" }, "isIdentifier": false, "isNotIndexed": false } ] } ], "feedback": "Revenue means the sum of paid orders.", "completionScore": 40, "lastUpdated": "2026-11-18T16:40:00.000Z" }}