The Database API allows you to manage database connections, browse schemas and tables, and access metadata. This API includes 25 endpoints for comprehensive database management.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metabase/metabase/llms.txt
Use this file to discover all available pages before exploring further.
List databases
Get a list of all databases the current user has access to.Response
Returns an array of database objects with connection details and metadata.Get database
Get details about a specific database.Parameters
Database ID
Response
Database ID
Database name
Database engine (postgres, mysql, h2, etc.)
Connection details (host, port, dbname, etc.)
Supported database features
Create database
Add a new database connection.Request body
Display name for the database
Database engine type (postgres, mysql, h2, mongo, etc.)
Connection details specific to the database engineCommon fields:
host- Database hostport- Database portdbname- Database nameuser- Usernamepassword- Password
Whether to perform a full sync (default: true)
Sync and cache field values schedules
Update database
Update an existing database connection.Parameters
Database ID
Request body
All fields are optional. Only include fields you want to update.Database display name
Connection details to update
Enable or disable full sync
Delete database
Permanently delete a database connection.List schemas
Get all schemas for a database.Response
Returns an array of schema names.List tables
Get all tables in a database or schema.Response
Array of table objects with fields and metadata
Array of field objects across all tables
Get table metadata
Get detailed metadata for a specific table including fields, field types, and relationships.Sync database schema
Trigger a manual sync of the database schema.Schema syncs run automatically on a schedule, but you can trigger a manual sync to immediately pick up schema changes.
Rescan field values
Rescan and cache field values for a database.Discard cached field values
Clear cached field values for a database.Validate database connection
Test database connection details before saving.Request body
Database engine type
Connection details to validate
Response
Whether the connection is valid
Error message if connection failed
Get autocomplete suggestions
Get SQL autocomplete suggestions for native queries.Parameters
Database ID
Partial SQL query to get suggestions for
Response
Returns an array of autocomplete suggestions including table names, column names, and SQL keywords.Sample database
Create or restore the sample database.The sample database is useful for testing and demonstrations. It contains sample data across multiple tables.
Database healthcheck
Check the health and connectivity of a database.Response
Health status: “ok” or “error”
Error message if health check failed
Error codes
Common error codes for database endpoints:Invalid database configuration or connection details
Insufficient permissions to manage databases (requires admin)
Database not found
Database connection or sync error