GET /api/database/{id}
Changed onGet 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. Granting data model permissions to non-admins requires Enterprise Edition code and a token with the advanced-permissions feature; without both, this is admin-only. 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.
Request
- Base URL(relative, and the document was published on a file host, not at the API’s origin)
- AuthAPI key in header X-API-Key
Path parameters
value must be an integer greater than zero.
Query parameters
value must be a valid boolean string ('true' or 'false').
value must be a valid boolean string ('true' or 'false').
Response
Successful response
Changes
- info
api operation id
get-api-database-idwas added
- info