/api/database

GET /api/database

Changed on

Fetch all Databases.

  • include=tables means we should hydrate the Tables belonging to each DB. Default: false.

  • include=schemas hydrates a :schemas list on each DB (only schemas with visible tables the current user can read), matching the per-DB /api/database/:id/schemas response. Lets clients avoid N round-trips when populating a database/schema picker.

  • saved means we should include the saved questions virtual database. Default: false.

  • include_editable_data_model will only include DBs for which the current user has data model editing permissions. (If include=tables, this also applies to the list of tables in each DB). Granting those permissions to non-admins requires Enterprise Edition code and the advanced-permissions feature; without both, this is admin-only.

  • exclude_uneditable_details will only include DBs for which the current user can edit the DB details. Has no effect unless Enterprise Edition code is available and the advanced-permissions feature is enabled.

  • include_only_uploadable will only include DBs into which Metabase can insert new data.

  • include_stubs includes stub DBs, which serialization creates for missing databases. Default: false.

  • can-query will only include DBs for which the current user has query permissions. Default: false.

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

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Query parameters

savedboolean nullable
include_analyticsboolean nullable
include_only_uploadableboolean nullable
include'tables' | 'schemas' nullable

include must be either empty, 'tables', or 'schemas'

include_stubsboolean nullable
router_database_idinteger nullable

value must be an integer greater than zero.

can-queryboolean nullable
exclude_uneditable_detailsboolean nullable
include_editable_data_modelboolean nullable

Response

Successful response

Changes

    • warning

      deleted the query request parameter can-write-metadata

    • info

      added the new optional query request parameter include_stubs

    • info

      the query request parameter exclude_uneditable_details became optional

    • info

      the query request parameter include_analytics became optional

    • info

      the query request parameter include_editable_data_model became optional

    • info

      the query request parameter include_only_uploadable became optional

    • info

      the query request parameter saved became optional

    • breaking

      api path removed without deprecation

    • info

      endpoint added