Skip to content
Grace Muthoni Kariuki

Dec 4, 202617 min read

If you can do it in the interface, you can script it: running questions, managing collections and users, syncing databases, and even wiring those steps into a workflow tool like Activepieces when you'd rather not write the glue yourself.

The Metabase API is the set of HTTP endpoints the Metabase application itself uses to run questions, manage collections and users, and sync databases, which you can call with an API key or session token to automate the same tasks from your own scripts.

The Metabase API is the REST interface the Metabase app itself calls, and an API key grants access, with the group permissions you assign to it limiting what it can do.

Before you build, decide who owns the key, because every call it makes carries that identity.

Metabase API access, keys and plans explained

What the Metabase API is and what it can do

It's an HTTP API that returns JSON, and it's the same set of endpoints the browser front end uses. That means you can create and update questions, dashboards and collections, run saved queries and export results, and administer users, groups and permissions.

Before you build, decide who owns the key, because every call it makes carries that identity.

The reference lives in Metabase's API documentation.

Because the endpoints aren't a separately versioned product, a call that works today can change between Metabase releases. Pin your scripts to the version you run and re-test after each upgrade.

If you'd rather call these endpoints from a visual workflow than from code, Activepieces can sit on top of the same key, and its MIT-licensed core self-hosts next to a self-hosted Metabase.

Activepieces workflow builder with HTTP request step selected and its settings panel open showing method, URL, headers, and…

Which plans include API access

You have four options to weigh: Starter, Pro and Enterprise, plus a free open source edition you host yourself. The table below lists those four against the four things you need to budget and audit: monthly price, included users, API key availability and per-call price.

Read the table as a pointer to Metabase's pricing page, checked 2026-12-04, because every cell points back to it. Confirm each cell there before you commit.

Plan Monthly price Included users API keys available Per-call price
Starter Listed on the pricing page Listed on the pricing page Confirm on the pricing page None published
Pro Listed on the pricing page Listed on the pricing page Confirm on the pricing page None published
Open source Free to self-host; you pay for your own hosting No seat count; set by your deployment Confirm in the docs for your version None published
Enterprise Listed on the pricing page Listed on the pricing page Confirm on the pricing page None published

Because no cell here carries a quoted figure, nothing in this article can go stale before you read it, but you must check the page yourself. Treat a plan as unconfirmed for API use until its listing says otherwise.

You're not billed per request: Metabase's pricing page, checked 2026-12-04, publishes no per-call price for any plan. Your effective limits come from the plan you hold, the permissions on the key, and the capacity of your own deployment.

An HTTP request step configuration in a workflow builder showing authentication headers and URL for Google Search API via…

Before any invoice changes, a heavy script on a small instance will slow your dashboards.

Everything below works on Activepieces' free plan. Start without code or a credit card.

API key creation and first request authentication

You fix the permissions on a key when you create it in Admin settings, and one request with the x-api-key header proves what that key can do. Ten minutes covers the whole walkthrough.

An Admin settings form for creating an API key: a key name field, a group dropdown and a create button, with one request…

Sign in as an administrator and open Admin settings, then Authentication, then API keys, and choose Create API key. You'll name the key and pick a group.

Think of the group as the permission boundary: the key can see and do what that group can, and nothing more. Choose the narrowest group that works, not Administrators because it's convenient.

A small group card with a short list of database checkboxes, only two ticked, and a key attached to it by a cord, next to a…

Write the owner into the key name, such as the team and the system that will use it, so someone can later tell whether it's safe to revoke. Copy the key when Metabase shows it, and confirm in the docs whether it appears again.

Store it in a secret manager, not in the script.

To see the pattern, look at a connection dialog for Drip, an email marketing service. It has a connection name, the projects it's available to, and a secret field that points to a vault path instead of holding the key as plain text.

Next, use the key from a terminal.

Step 2: Send GET /API/user/current

Call your instance with the key in the header:

curl -H "x-api-key: YOUR_KEY" https://your-metabase.example.com/api/user/current

If a JSON object comes back, authentication worked. Read the group membership in the response, because it tells you which permissions this key actually carries.

An authentication error here usually means a mistyped header name, a key copied with trailing whitespace, or a base URL that points at a proxy stripping custom headers.

To list databases and confirm permissions, make a second call:

curl -H "x-api-key: YOUR_KEY" https://your-metabase.example.com/api/database

Your key's group decides what comes back: only the databases it may see. An empty list on an instance you know has connections means the group has no data permissions, so fix the group before you write any automation.

A list that's longer than you expected means the group is too broad.

Session tokens versus API keys

When you POST /api/session with a username and password, you get a session token, and it's sent in the X-Metabase-Session header.

It acts as that person, so the script inherits their access and fails when they change their password, when someone deactivates their account, or when the token expires.

For scheduled jobs, use a key, because it belongs to a group, not a person, and doesn't depend on anyone's login. Use a session token for short, interactive tests as a specific user.

Metabase API endpoints and the OpenAPI specification

Once a session token has told Metabase who you are, the OpenAPI specification tells you what that user can call, and the operation counts show where most of the surface sits.

Finding the Metabase OpenAPI spec for your version

According to the skmtc.dev listing, the database family has 28 operations, so most metadata and sync automation sits there. Dashboard has 24, which covers building and editing dashboards from code.

Metabase API operations by endpoint family

Card and collection have 18 each, so saved questions and the folders that hold them are about equally scriptable.

Your version may differ, since these counts come from one published spec.

Check the version under Help > About Metabase, then read the API reference in the Metabase docs for that version before you script anything.

To run a saved question and get its rows back as JSON, call POST /api/card/:id/query. The :id is the number in the question's URL.

The calling user needs read access to the card's collection and data permissions on the underlying database. Decide who owns that account first, because every run will carry its permissions.

Metabase API query and export row limits compared

Set side by side, the three ways of getting rows show that permissions are similar while limits and formats aren't.

Endpoint Permissions needed Row limit Output formats
POST /api/card/:id/query Collection read on the card, plus data access 2,000 unaggregated; 10,000 aggregated JSON
POST /api/dataset Query permission on the database (native queries need native permission) 2,000 unaggregated; 10,000 aggregated JSON
Card and dataset export endpoints Same as the query being exported About 1 million CSV, JSON, XLSX

If a dashboard feed silently stops at 2,000 rows, you have a truncated report. Pulling a full table through the query endpoints is the wrong tool, and the export endpoints are the ones to use.

A long table of data rows on a dashboard feed, cut off by a horizontal line partway down, with more rows continuing faintly…

Confirm each limit against the docs for your version, since deployments can differ.

Build on the endpoints in the spec. The app also calls routes that aren't documented, and those can change between releases without notice. If you depend on one, pin your Metabase version and rerun your calls after every upgrade.

Once POST /api/card/:id/query returns the rows you expect, Activepieces can run that same call on a schedule and post the rows to Slack. That adds convenience, not API capability, so the row caps above still apply.

Describe the job in its built-in chat and it publishes a live flow in your account, the same kind of flow a builder would assemble by hand, running under the platform's RBAC with a run trace for every execution.

MoneyGram, Moneypenny, Alan and FundingSocieties run Activepieces in production.

Easier to see it running than to read about it: set it up free, no card.

Metabase API rate limits and quotas by plan

You won't find a per-plan request quota, because Metabase publishes none for its API. The limits you'll actually hit are row caps, query timeouts and the capacity of whatever deployment you call.

Published Metabase API rate limits by plan

As of 2026-12-04, Metabase publishes no calls-per-minute or monthly figure for Starter, Pro, Enterprise or self-hosted. Don't size a job around a number you have heard secondhand.

Ask who owns the connection. The account or API key you authenticate with carries that user's permissions, so a job can also fail because that user can't see a collection, not because a quota ran out.

Metabase API row caps and query timeouts

Read the table for what each plan publishes. The only figures I could source are the row caps, and they don't vary by plan in anything I found. Read "not published" as "confirm with Metabase before you depend on it."

Plan Request quota Row caps Timeout Session life
Starter Not published 2,000 / 10,000 / 1,048,575 Not published 14 days default
Pro Not published 2,000 / 10,000 / 1,048,575 Not published 14 days default
Enterprise Not published 2,000 / 10,000 / 1,048,575 Not published 14 days default
Self-hosted Not published 2,000 / 10,000 / 1,048,575 Not published 14 days default

Verify them against your version, because the caps come from a Metabase Discourse thread, a community forum rather than the reference docs. Unaggregated results stop at 2,000 rows, so a raw-table query through the API returns a truncated set unless you aggregate or export.

At 10,000 rows, aggregated results stop, which is enough for a summary but not for a full ledger. File exports reach 1,048,575 rows, which matches the spreadsheet row limit, so large pulls should use an export rather than a standard query result.

How many rows Metabase hands back, by output type

Because Metabase publishes no timeout, treat a slow query as a failure you must handle. Retry logic and a narrower date filter are safer than assuming the call will wait.

Self-hosted versus Cloud capacity

On Cloud, Metabase operates the infrastructure and publishes no capacity figure per plan. On self-hosted, capacity is yours: your server size, your reverse proxy's timeout and your database's connection limits set the practical ceiling.

That makes you the owner of the failure as well as the fix.

After two weeks, a script holding a session token will begin returning authentication errors unless it logs in again, because sessions last 14 days by default. These are the figures worth recording in your own runbook, with the date you checked them.

Common Metabase API errors and fixes

When a Metabase API call fails, it is almost always one of six things: a rejected key, a missing permission, a stale ID, a malformed query, a server that gave up, or a result cut short.

Each has a different owner, and the table marks which causes Metabase documents and which are inferences from behavior.

Each row gives a status, its likely cause, the fix, and whether the cause is documented. Read the last column first when you triage.

You can cite a documented cause to the person who owns the connection, while an inferred one is a hypothesis to test against your own deployment before you change anything.

# Status Likely cause Fix Cause documented or inferred
1 401 API key missing, revoked, or sent in the wrong header Send the key in the x-api-key header, and reissue it if it was deleted Documented
2 403 The key's group lacks access to the collection, database or table Change the group's permissions, or use a key from a group that has them Documented
3 404 Wrong ID, deleted object, or an endpoint that differs on your Metabase version Re-list the object to get the current ID, and check the API reference for your version Partly documented; version drift is inferred
4 400 Malformed request body or invalid query Compare your body with a query the app itself sends, and correct the fields Inferred from the error text
5 5xx or timeout Slow query, overloaded server, or a proxy cutting the connection Narrow the query, check server logs, raise your proxy timeout, then retry Inferred; limits depend on your deployment
6 Truncated rows A row cap on the result you requested Filter or paginate, and check the export route's documented limits Check the docs for your version

401 and 403: key, header and group permissions

When you get a 401, Metabase didn't accept who you are; a 403 means it knows who you are and refuses the action.

Before debugging either, ask who owns the key. An API key belongs to a group, and a key created by someone who has since left may be revoked by an admin without notice.

For a 401, check the header name and that the key was copied whole.

For a 403, open the key's group and check its data and collection permissions. Don't fix a 403 by moving to an administrator's key, because that widens what the automation can touch.

Metabase API 400 and 404 errors explained

When you see a 400, look at your own request. Capture what the Metabase app sends for the same action in your browser's network tab, then match the body.

A 404 usually means the ID is gone or belongs to another instance, such as staging instead of production.

Look IDs up by name at run time, because hard-coded IDs break when content is recreated. If the ID is right, compare the endpoint against the reference for your installed version.

Metabase API timeouts, truncated rows and 5xx errors

Treat a 5xx as a symptom, not a diagnosis. The usual suspects are a heavy query, a database that's slow to answer, or a proxy in front of Metabase that closes the connection first. Those are inferred causes, so confirm them in your own logs.

The call succeeds, and that is why truncated rows are quieter. Compare the row count you received with a count query, and don't trust a total from a result that may have been capped.

Retry and backoff for Metabase API failures

Retry only 5xx responses and timeouts, never 401, 403, 400 or 404, since repeating those can't succeed and may lock a key's owner out of an audit trail with noise.

Wait longer after each failed attempt, add a random offset so parallel jobs don't retry together, and stop after a small fixed number of tries.

Record the final failure with the endpoint and status.

Treat your values as your own policy and write them in the runbook, since Metabase doesn't publish a retry schedule that I can cite.

Call the Metabase API without code in Activepieces

Without a script, a saved question can still reach Slack each morning: Activepieces can run your working Metabase request on a schedule and apply the retry values from your runbook, and flows are unlimited on every plan, including free.

A workflow builder showing a Skyvern step selected with its configuration panel open on the right, displaying API Key and…

For a one-off pull, a script is simpler.

Set up the HTTP request with your key

Before building anything, decide who owns the connection. Create the API key under a dedicated Metabase account, not your personal login. The key then carries only that account's group permissions, and the flow survives when you change roles.

Check its action list first, because the Metabase integration may cover only some endpoints.

For any endpoint that account can see, use the HTTP integration.

Set the method to POST, the URL to /api/card/:id/query on your own Metabase host (with your saved question's ID), and add a header named x-api-key holding the key. Store the key as a connection or secret field, not as pasted text in the step.

Activepieces workflow builder with the Send HTTP request step selected, showing its configuration panel with HTTP method…

Schedule it and send the rows on

Picture the flow as four parts: a Schedule trigger at 8:00 daily, the HTTP step carrying the key, a retry on that step, and a Slack message. The illustration below shows that order.

The thing to take from it is that the retry belongs on the HTTP step only, so a failed query is repeated before anything is posted.

Set the retry count and delay to the values you wrote in your runbook, since Metabase gives no schedule to copy.

Last, the Slack step formats the returned rows into one message.

Whether a daily flow fits a free plan comes down to task allowances. Make lists 1,000 to 10,000 tasks or credits a month across its free and first paid plans, which leaves room for a daily flow with several steps.

Zapier lists 100 to 750. Thirty daily runs fit. If each step counts as a task, three steps use about 90 of the lowest tier's 100, and one retry or a second flow takes you over.

Activepieces counts a run as 1 credit however many steps it has, and its free plan includes 1,000 credits a month, so thirty daily runs use 30 of them.

Next steps for using the Metabase API

Start by confirming which Metabase account owns the key, and which groups can see the saved question. Then work through these in order:

  1. Build the flow with the HTTP step, the header and your runbook's retry values.
  2. Run it once by hand.
  3. Compare the rows in Slack with the question in Metabase.

Write the key's owner, its location in Activepieces and its rotation date into the runbook, and read the run trace after the first scheduled morning, where the run should show as 1 credit.

Share

Get started

Automate this without code.

Cloud or your own servers.

Start free Talk to sales