canonical: https://jentic.com/apis/metabase.com/metabase

# Metabase API

The Metabase API exposes the full surface of a Metabase business intelligence instance, covering cards (saved questions), dashboards, collections, databases, queries, alerts, pulses, permissions, users, and more. With over 600 endpoints, it lets agents drive analytics workflows programmatically - from running a saved question to wiring up a new database connection or scheduling a dashboard subscription. Authentication uses a session token issued from the `/api/session` endpoint, sent in the `X-Metabase-Session` header on subsequent calls. The base URL points at your self-hosted or cloud Metabase instance, so substitute it before issuing requests.

## For AI agents

Drive a Metabase BI instance - run saved questions, manage dashboards, query databases, and configure alerts via 600+ endpoints.

## Scope

Does not handle data warehousing, ETL pipelines, or row-level data ingestion - use for driving an existing Metabase BI instance only.

## Capabilities

- Run a saved Metabase question and retrieve its result rows for a downstream report
- Create and update dashboards programmatically with curated cards and filters
- Register a new data source by adding a database connection to the Metabase instance
- Schedule a Metabase alert that fires when a metric crosses a threshold
- Manage collections and permission groups to control who can see which dashboards
- Trigger an ad-hoc native or structured query against a connected database from agent code

## Use cases

### Embedded Reporting in Internal Tools

Agents drive a Metabase instance to run saved questions and return result rows into an internal portal or Slack bot, without users needing direct Metabase access. The action endpoints let the agent submit parameters at run time so the same question serves multiple teams. This lets organisations centralise BI logic in Metabase while exposing it through familiar tooling.

Example prompt: POST `/api/action/{id}/execute` with parameter values to run a saved Metabase action, then return the result rows to the requesting agent

### Dashboard Provisioning

When onboarding a new team or customer, an agent creates collections, copies template dashboards into them, and applies the right permission groups via the API. This replaces a manual click-through process and makes it possible to provision dozens of analytics workspaces from a single workflow. The dashboard and collection endpoints support read, create, and update so the whole flow lives in code.

Example prompt: Create a new collection, clone the template dashboard into it, and assign the customer's permission group via the collection and permission endpoints

### Metric Alerting

Use the alert endpoints to schedule a check on a saved question and dispatch a notification when the result crosses a threshold or returns rows. This adds a lightweight monitoring layer on top of any Metabase question without standing up a separate alerting stack. Pair it with Pulses for scheduled summary deliveries.

Example prompt: GET `/api/alert` to list existing alerts and confirm the threshold rule for the daily revenue card is active before the morning report is generated

### AI Agent Integration via Jentic

An AI agent uses Jentic to discover Metabase by intent search ('run a Metabase question'). Jentic returns the relevant action or dataset operations with their input schemas, so the agent can fetch metric data without hand-rolling auth or pagination. The Metabase session token lives in your Jentic One instance and is injected into the `X-Metabase-Session` header at call time.

Example prompt: Use Jentic to search 'run a Metabase saved question', load the action execute schema, and execute it to pull the latest weekly revenue figure

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/action/{id}/execute` | Execute a saved Metabase action with parameters |
| GET | `/api/action` | List actions |
| GET | `/api/alert` | List configured alerts |
| GET | `/api/activity/recents` | List recent activity for the current user |
| POST | `/api/agent/v1/search` | Run an agent-style search across Metabase content |
| GET | `/api/activity/most_recently_viewed_dashboard` | Get the most recently viewed dashboard for the current user |

## Key resources

- **Cards** — Saved questions - create, list, run, and manage Metabase questions
- **Dashboards** — Curated dashboards composed of cards with filters and parameters
- **Collections** — Folder structure that organises cards and dashboards with permissions
- **Databases** — Configured database connections backing Metabase questions
- **Actions** — Executable model actions that wrap parameterised SQL or HTTP calls
- **Alerts** — Notifications that fire when a question result meets a condition
- **Permissions** — Groups, memberships, and policies controlling access to Metabase content

## Why Jentic

- **Setup:** Wiring Metabase by hand means obtaining a session token from `/api/session`, pointing at your own Metabase instance host, and sending it in the X-Metabase-Session header on every call. Through Jentic you install once, import Metabase from the API Directory, store the session token once, and your agent calls it.
- **Permission scoping:** Metabase exposes resources such as saved actions by id in the URL path (`/api/action/{id}/execute`), so a rule can pin your agent to specific resources. You choose the operations it may call, so archiving a dashboard or deleting a card is not included unless you add it.
- **Credential handling:** Your Metabase session token is stored once, encrypted, by your own Jentic One instance and injected into the X-Metabase-Session header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a Metabase question' or 'list recent activity', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Tableau** — Enterprise BI platform with extensive visualisation tooling and a server REST API
- **Domo** — Cloud BI platform with dataset, page, and stream APIs
- **Redash** — Open-source query and dashboard tool with a REST API similar in spirit to Metabase
- **Cube** — Headless BI semantic layer that can sit between databases and Metabase dashboards

## FAQ

### What authentication does the Metabase API use?

The API expects a session token in the `X-Metabase-Session` header. Obtain the token by POSTing credentials to `/api/session`, then send it on every subsequent request. Through Jentic the token is held in your Jentic One instance and injected into the header at call time.

### Can I run a saved question through the API?

Yes. Use the action execution endpoints - for example POST `/api/action/{id}/execute` - to run a saved action with parameter values and capture the response. The same surface exposes the cards and dataset endpoints for direct query execution.

### How do I configure a new database connection?

Use the database management endpoints under `/api/database` to add a connection with engine, host, credentials, and feature flags. Once registered, cards and dashboards can target the new database immediately.

### How do I schedule a metric alert?

Manage alerts via `/api/alert` - list, retrieve, create, or update alert definitions tied to a saved question. Each alert specifies the question, schedule, and the recipients to notify when the condition matches.

### How do I run a Metabase question through Jentic?

Search Jentic for `run a Metabase saved question`, load the action execute operation schema, and execute it with the action ID and parameter values. Jentic returns the structured response from Metabase.

### Are there published rate limits?

The OpenAPI spec does not declare quantitative rate limits. Self-hosted Metabase instances are bounded by the underlying server resources, so design retry-with-backoff and avoid running heavy queries from agent loops without throttling.

### Can I limit what my agent is allowed to do with the Metabase API?

Yes. Because you run Jentic One yourself, your own rules decide which Metabase operations and credentials the agent may use. Metabase addresses resources by id in the path, such as POST `/api/action/{id}/execute`, so you can pin the agent to specific actions and choose exactly which operations it may call. That means running a saved action or listing alerts can be allowed while archiving a dashboard or deleting a card stays off unless you add it.
