v12

latestOpenAPI 3.1.0AGPL-3.0raw.githubusercontent.com2026-05-286377631.6 MB
/api/database

GET /api/database/{id}

Get a single Database with id. Optionally pass ?include=tables or ?include=tables.fields to include the Tables belonging to this database, or the Tables and Fields, respectively. If the requestor has write permissions for the DB (i.e. is an admin or has data model permissions), then certain inferred secret values will also be included in the returned details (see [[metabase.secrets.models.secret/expand-db-details-inferred-secret-values]] for full details).

Passing include_editable_data_model will only return tables for which the current user has data model editing permissions, if Enterprise Edition code is available and a token with the advanced-permissions feature is present. In addition, if the user has no data access for the DB (aka block permissions), it will return only the DB name, ID and tables, with no additional metadata.

Independently of these flags, the implementation of [[metabase.models.interface/to-json]] for :model/Database in [[metabase.warehouses.models.database]] uses the implementation of [[metabase.models.interface/can-write?]] for :model/Database in [[metabase.warehouses.models.database]] to exclude the details field, if the requesting user lacks permission to change the database details.

get/api/database/{id}

Path parameters

idinteger required

value must be an integer greater than zero.

Query parameters

include'tables' | 'tables.fields' nullable
include_editable_data_modelboolean
exclude_uneditable_detailsboolean

Response

Successful response