Everything an AI agent can do with the Metabase API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints35
API versionv0.62
Last updated23 June 2026
Orientation

How the Metabase API works.

The Metabase API is how an app or AI agent works with a Metabase instance: running a saved question, running an ad-hoc query against a connected database, building dashboards and collections, and managing users and permissions groups. Access is granted through an API key, which is assigned to one permissions group and carries exactly that group's permissions, so the key reaches only what its group can see. Metabase does not version its API, and it pushes nothing to apps, so an agent polls or queries rather than waiting for events.

35Endpoints
9Capability groups
19Read
16Write
6Permissions
Authentication
Metabase authenticates programmatic calls with an API key sent in the X-API-Key header, the recommended method, or with a session token in the X-Metabase-Session header obtained by posting credentials to /api/session. A session token expires after inactivity, while an API key does not, which is why keys suit long-running automation. The first-party MCP server authenticates separately, through an embedded OAuth flow.
Permissions
The Metabase API has no per-endpoint scopes. Instead an API key is assigned to one permissions group when it is created, and the key has exactly that group's permissions: which collections it can read or write, which databases it can query, and whether it has admin rights. To change what a key can do, change its group. A leaked key reaches only what its group reaches, so a narrowly scoped group is the unit of least privilege.
Versioning
Metabase does not version its API. There is one API tied to the running Metabase release, and endpoints can be renamed or removed between releases, so code written against it may need updates on upgrade. Notable changes are tracked in the API changelog rather than by a version header. The freshness label here, v0.62, names the Metabase release these facts were verified against.
Data model
The API is resource-oriented JSON served under /api on the Metabase instance's own host. A saved question is a card; cards live in collections alongside dashboards; a card or an ad-hoc dataset query runs against a connected database. Permissions groups govern access, and users belong to those groups. Running a card or a dataset query reaches live data, so a read in the API can return whatever the connected database holds.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Metabase determines what it can reach. There is a route for making calls with an API key, a route that exchanges a username and password for a temporary session token, and a hosted server that exposes Metabase tools to agents, and each is governed by the permissions group behind the credential.

Ways to connect

REST API

The REST API answers under /api on the Metabase instance's own host, takes and returns JSON, and is unversioned: it is tied to the Metabase release that is running and can change between releases. A call authenticates with an API key in the X-API-Key header, or with a session token in the X-Metabase-Session header.

Best forConnecting an app or AI agent to Metabase.
Governed byThe permissions group the API key or session belongs to.
Docs ↗

MCP server (Model Context Protocol)

Metabase ships a first-party MCP server, GA in Metabase 0.62, at /api/metabase-mcp using Streamable HTTP transport. It runs an embedded OAuth 2.0 server, so an MCP client connects through a Metabase consent screen and receives an access token scoped to that person's Metabase permissions. Tools include search, read_resource, construct_query, query, execute_query, visualize_query, create_question, update_question, create_dashboard, and create_collection. An admin turns it on at Admin, AI, MCP.

Best forConnecting an AI agent to Metabase through MCP.
Governed byThe OAuth grant and the connecting person's permissions.
Docs ↗
Authentication

API key

An API key is sent in the X-API-Key header and is the recommended way to authenticate programmatic calls. A key is assigned to one permissions group when it is created, and it has exactly that group's permissions, so a key is the unit of least-privilege access. Metabase shows the key only once, and a deleted key cannot be recovered.

TokenAPI key in the X-API-Key header
Best forServer-side and agent calls with group-scoped access.
Docs ↗

Session token

A session token is obtained by posting a username and password to /api/session, then sent in the X-Metabase-Session header. The token carries the signed-in user's permissions and expires after a period of inactivity, so it must be refreshed. It suits short interactive use more than long-running automation.

TokenSession token in the X-Metabase-Session header
Best forShort-lived or interactive sessions.
Docs ↗

MCP OAuth

The first-party MCP server runs an embedded OAuth 2.0 server. An MCP client is sent through a Metabase consent screen and receives an access token scoped to the connecting person's Metabase permissions, so the agent reaches only what that person can see.

TokenOAuth access token scoped to a person's permissions
Best forConnecting AI clients like Claude, Cursor, or VS Code.
Docs ↗
Capability map

What an AI agent can do in Metabase.

The Metabase API is split into areas an agent can act on, like questions, dashboards, collections, databases, and the query engine that runs them. Each call runs with the permissions of the group its API key belongs to, and running a query reaches whatever data that group can see.

Questions (Cards)

6 endpoints

List, read, create, and update saved questions, and run a saved question to return its results.

Running a card returns whatever data its query can reach; a write changes the saved question.
View endpoints

Dashboards

4 endpoints

List, read, create, and update dashboards and the cards placed on them.

A write here changes a real dashboard others may rely on.
View endpoints

Collections

4 endpoints

List the collection tree, read a collection's items, and create or update collections.

A write here moves or reorganizes saved content.
View endpoints

Databases

5 endpoints

List and read connected databases, add or update a connection, and trigger a metadata sync.

A connection holds the credentials Metabase uses to reach a real data source.
View endpoints

Datasets (queries)

2 endpoints

Run an ad-hoc query against a connected database and return its results.

A query runs directly against a connected database with that database's saved credentials.
View endpoints

Users

5 endpoints

List and read users, create a user, and update, deactivate, or reactivate one.

A write here changes who can sign in to Metabase.
View endpoints

Permissions groups

5 endpoints

List, read, create, update, and delete permissions groups, and manage their membership.

A group controls what its members, and any API key in it, can reach.
View endpoints

Alerts & subscriptions

3 endpoints

List and read alerts, and remove an alert subscription.

An alert sends results out by email or to Slack on its schedule.
View endpoints

Search

1 endpoint

Search across questions, dashboards, collections, and other content.

Results are limited to what the calling group can see.
View endpoints
Endpoint reference

Every Metabase API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Questions (Cards)

List, read, create, and update saved questions, and run a saved question to return its results.6

Returns only cards in collections the calling group can view. There are no per-endpoint scopes; access comes from the group the API key belongs to.

Acts oncard
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Since Metabase 0.57 the query serializes as MBQL 5; pass ?legacy-mbql=true for the older shape.

Acts oncard
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs write access to the target collection, and create-queries on the database the card reads.

Acts oncard
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Archiving and moving a card both go through this endpoint.

Acts oncard
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Reads the card but runs its query against the connected database, so it returns live data the group can see.

Acts oncard
Permission (capability)Database: query
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Since Metabase 0.53 parameters must be sent in the request body, not as query-string parameters.

Acts oncard
Permission (capability)Database: query
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Dashboards

List, read, create, and update dashboards and the cards placed on them.4

Limited to dashboards in collections the calling group can view.

Acts ondashboard
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts ondashboard
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs write access to the collection the dashboard is created in.

Acts ondashboard
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Adding, moving, and removing dashboard cards is done through this update endpoint.

Acts ondashboard
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Collections

List the collection tree, read a collection's items, and create or update collections.4

Since Metabase 0.50 official collections are returned ahead of other items.

Acts oncollection
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Can be filtered by model type, such as card, dashboard, or collection.

Acts oncollection
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs write access to the parent collection.

Acts oncollection
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Moving a collection changes what its contents inherit for permissions.

Acts oncollection
Permission (capability)Collection: write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Databases

List and read connected databases, add or update a connection, and trigger a metadata sync.5

Returns connection metadata, not the stored credentials themselves.

Acts ondatabase
Permission (capability)Database: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts ondatabase
Permission (capability)Database: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Restricted to admins; the request carries the credentials Metabase will use to reach the data source.

Acts ondatabase
Permission (capability)Admin: settings
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; can change the connection's stored credentials.

Acts ondatabase
Permission (capability)Admin: settings
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; refreshes the tables and fields Metabase knows about, without changing data.

Acts ondatabase
Permission (capability)Admin: settings
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Datasets (queries)

Run an ad-hoc query against a connected database and return its results.2

Runs a query the caller composes, not a saved one, so it reaches any data the group's create-queries permission allows.

Acts ondataset
Permission (capability)Database: query
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

The export-format path segment selects the file type returned.

Acts ondataset
Permission (capability)Database: query
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Users

List and read users, create a user, and update, deactivate, or reactivate one.5

Listing all users is an admin action; GET /api/user/current returns the caller's own profile without admin rights.

Acts onuser
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only for other users.

Acts onuser
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; creates an account that can sign in to Metabase.

Acts onuser
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only.

Acts onuser
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; PUT /api/user/:id/reactivate restores access.

Acts onuser
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Permissions groups

List, read, create, update, and delete permissions groups, and manage their membership.5

Admin-only; a group is what an API key is assigned to, so a key gets that group's permissions.

Acts onpermissions group
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only.

Acts onpermissions group
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; a new group starts with no data access until its graph is set.

Acts onpermissions group
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; changing membership changes what the member can reach.

Acts onpermissions group
Permission (capability)Admin: people
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Admin-only; since Metabase 0.50 the model splits view-data and create-queries instead of one data permission.

Acts onpermissions graph
Permission (capability)Admin: settings
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Alerts & subscriptions

List and read alerts, and remove an alert subscription.3

Since Metabase 0.54 most alert writes moved to the notification API; this read endpoint was retained.

Acts onalert
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onalert
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes a recipient from the alert, not the alert itself.

Acts onalert
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
Search across questions, dashboards, collections, and other content.1

Results are filtered to what the calling group can see.

Acts onsearch result
Permission (capability)Collection: read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Metabase does not push events to an app. The closest equivalent is its built-in alerts and dashboard subscriptions, which Metabase sends on a schedule or when a result crosses a threshold, by email or to a Slack channel, rather than to an app endpoint.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Metabase does not enforce a request rate limit in its core API, so how fast an agent can call is bounded by the instance's own capacity. A query result returned by the API is capped at a fixed number of rows.

Request rate

Metabase does not enforce a request rate limit in its core API, so how fast an app or AI agent can call is bounded by the instance's own capacity rather than a documented quota. A self-hosted instance can be put behind a reverse proxy that adds rate limiting if needed. Because a query call runs against a connected database, the real ceiling on heavy use is that database's load, not an API counter.

Pagination

Most list endpoints, such as cards and dashboards, return the full set the caller can see in one response rather than paging. Search and some larger collections accept limit and offset parameters to page through results. There is no single account-wide cursor scheme across the API.

Request size

A query result returned through the API is capped at a fixed number of rows (2,000 in the standard JSON response, 1,048,576 in a downloaded export), with the rest truncated. Exports can be requested as csv, json, or xlsx through the query export endpoints.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400Bad RequestThe request was malformed or a required parameter was missing or invalid, such as a query the engine cannot run.Read the error message, correct the request body or parameters, and resend.
401UnauthenticatedNo valid API key or session token was provided, or the session token has expired.Send a valid X-API-Key, or re-authenticate at /api/session for a fresh session token.
403ForbiddenThe credential is valid but its permissions group lacks access to the resource or action, for example an admin-only endpoint called with a non-admin key.Assign the key to a group that has the needed permission, or use an admin key for admin endpoints.
404Not FoundThe resource does not exist, or the calling group cannot see it.Confirm the ID, and check the group can view the collection or database it belongs to.
Versioning & freshness

Version history.

Metabase does not version its API. There is one continuously evolving API tied to the version of Metabase that is running, and endpoints can change between releases, so the timeline below tracks notable changes by release.

Version history

What changed, and when

Latest versionv0.62
v0.62Current version
Metabase 62 (current verified release)

Metabase does not version its API, so this entry names the release these facts were verified against, Metabase 62, released 16 June 2026. It made the first-party MCP server generally available at /api/metabase-mcp, alongside custom visualizations, a schema viewer, and a CLI built on the API.

What changed
  • First-party MCP server GA at /api/metabase-mcp, with embedded OAuth and tools for search, query, and content creation.
  • Metabase CLI added, built on the API, for creating dashboards, transforms, and metrics from a terminal or agent.
  • Custom visualization plugin SDK and an interactive schema viewer added.
Metabase 0.61
Metabot agent supersedes describe endpoints

Removed the LLM autodescribe endpoints in favor of the Metabot agent.

What changed
  • Removed POST /api/metabot/describe/card and POST /api/metabot/describe/dashboard/:id.
Metabase 0.57
Queries serialize as MBQL 5

Card queries now serialize in the newer MBQL 5 shape, with a flag to keep the old shape.

What changed
  • GET /api/card/:id returns MBQL 5; pass ?legacy-mbql=true for the previous MBQL 4 shape.
Metabase 0.54
Alerts move to the notification API

Most alert endpoints were removed in favor of a new notification API; a few read and unsubscribe endpoints were retained.

What changed
  • Most /api/alert endpoints replaced by /api/notification endpoints.
  • Retained GET /api/alert, GET /api/alert/:id, and DELETE /api/alert/:id/subscription.
Metabase 0.53
Export queries require body parameters

The card export-query endpoint stopped accepting parameters as query-string values.

What changed
  • POST /api/card/:card-id/query/:export-format now requires parameters in the form body or JSON body.
Metabase 0.50
Split data-permissions model

The single data permission was replaced by separate view-data and create-queries permissions, and collection listings reordered.

What changed
  • Data permissions split into view-data and create-queries in the permissions graph.
  • /api/collection/tree and /api/collection/:id/items return official collections first.
Metabase 0.49
API keys reach general availability

API key authentication via the X-API-Key header became the recommended way to authenticate programmatic calls, and export endpoints gained formatted-row control.

What changed
  • X-API-Key header authentication generally available, with keys assigned to a permissions group.
  • Added the format_rows query parameter to export endpoints.

Pin to a Metabase release and review the API changelog before upgrading.

Metabase API changelog ↗
Questions

Metabase API, answered.

How does an agent authenticate to the Metabase API?+
The recommended way is an API key sent in the X-API-Key header, created under Admin in the API keys settings. The alternative is a session token: post a username and password to /api/session, then send the returned token in the X-Metabase-Session header. A session token expires after a period of inactivity and must be refreshed, while an API key stays valid until it is deleted, which is why keys fit automation.
How do permissions work, since there are no per-endpoint scopes?+
An API key is assigned to exactly one permissions group when it is created, and it inherits that group's permissions, nothing more. The group decides which collections the key can read or write, which databases it can query, and whether it has admin rights. There is no scope attached to an individual endpoint, so the way to limit a key is to put it in a tightly scoped group. If a group is deleted, its keys fall back to the All Users group.
Does the Metabase API have webhooks?+
No. Metabase does not push events to an app endpoint. Its built-in alerts and dashboard subscriptions are the closest equivalent: Metabase sends a question's results on a schedule, or when a result crosses a threshold, by email or to a Slack channel. An agent that needs to react to changes polls the API or runs a query, rather than receiving a callback.
Is the Metabase API versioned?+
No. Metabase does not version its API; there is one API tied to the Metabase release that is running. Endpoints rarely change, but they can be renamed or removed between releases, so code written against the API may need updates when the instance is upgraded. The API changelog lists the notable changes per release, and the live reference for a running instance is at /api/docs.
Are there rate limits on the Metabase API?+
Metabase's core API does not enforce a documented request rate limit, so the practical ceiling is the instance's own capacity and the load a query puts on the connected database. A self-hosted instance can sit behind a reverse proxy that adds rate limiting. Query results are capped at a fixed number of rows, 2,000 in the standard JSON response, with larger sets available through the export endpoints.
Does Metabase have an official MCP server for AI agents?+
Yes. Metabase ships a first-party MCP server, generally available in Metabase 0.62, at /api/metabase-mcp using Streamable HTTP transport. It runs an embedded OAuth flow, so a client like Claude, Cursor, or VS Code connects through a Metabase consent screen and gets a token scoped to that person's permissions. Its tools cover searching content, running and visualizing queries, and creating questions, dashboards, and collections. An admin enables it under Admin, AI, MCP.
Related

More analytics API guides for agents

What is Bollard AI?

Control what every AI agent can do in Metabase.

Bollard AI sits between a team's AI agents and Metabase. Grant each agent exactly the access it needs, read or write, resource by resource, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared Metabase key.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Metabase
Analytics Agent
Run saved questions ActionOffReadFull use
Run ad-hoc queries ActionOffReadFull use
Dashboards ResourceOffReadFull use
Manage users & groups ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Metabase