Skip to Content

Semantic Layer APIs

Get a semantic layer

Read the descriptions, synonyms and column types of every table in a datamart.

GET
/api/v2/data-app/datamarts/semantic-layer
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.

Authorization

ServiceToken
headerAuthorizationBearer <token>

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

Query

datamartNamestringrequired

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"  }}
FieldDescription
tablesEvery table of the datamart, also those with no text yet
feedbackThe note on the datamart, or null
completionScore0 to 100: how many tables and columns have a description, synonyms and a column type
lastUpdatedWhen 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

Statuserror.codeWhy
400INVALID_DATAMARTdatamartName is missing, or no datamart has this name
403AUTHENTICATION_ERRORYou used a data app API token

For errors that every endpoint returns, see Authentication.

Example Request
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"  }}