Metabase

App · 9 actions

Run Metabase questions and SQL and use the rows in a workflow: send a report, copy results to a sheet, find questions and dashboards. Start a workflow when a question has a new row.

Actions

ActionWhat it does
Create question from SQLSave SQL as a question in Metabase, shown as a table.
Delete questionMove a saved question to Metabase's trash, where it can be restored.
Get dashboardGet a dashboard's details and the questions on it, to run each of them.
Get questionGet a saved question's details: its SQL, its filters and the columns it returns.
List databasesList the databases connected to Metabase that the API key can use.
Run questionRun a saved question and get its rows, to send as a report or copy to a sheet.
Run SQL queryRun SQL on a database connected to Metabase and get the rows.
Search dashboardsFind dashboards by words in their names, or in one collection.
Search questionsFind saved questions, models and metrics by words in their names, or in one collection.

Create question from SQL

Save SQL as a question in Metabase, shown as a table. Each {{name}} in the SQL becomes a filter.

Inputs

NamenametextRequired
What to call the question, such as Orders this week.
DatabasedatabasetextRequired
The database. Pick one, or type its name.
SQLsqltextRequired
The SQL to run, written for that database, such as SELECT * FROM orders.
Collectioncollectiontext
Where to save it. Leave blank for Our analytics.
Descriptiondescriptiontext
What the question shows, for the people who find it.

Outputs

collectiontext
The collection it's saved in
collection_idtext
That collection's number; blank for Our analytics
columnslist
The columns it returns, from its last run
created_attext
When it was made (ISO 8601)
created_bytext
Who made it
database_idnumber
The number of the database it reads
descriptiontext
Its description
displaytext
How Metabase shows it, such as table, bar or line
filterslist
Its filters
idnumber
The question's number
linktext
A link to it in Metabase
nametext
Its name
query_typetext
sql, or query builder
sqltext
Its SQL, for a SQL question
typetext
question, model or metric
updated_attext
When it last changed (ISO 8601)
Example output
{
  "collection": "Sales",
  "collection_id": "3",
  "columns": [
    {
      "display_name": "ID",
      "name": "ID"
    },
    {
      "display_name": "Total",
      "name": "TOTAL"
    }
  ],
  "created_at": "2026-10-20T09:00:00Z",
  "created_by": "Ada Lovelace",
  "database_id": 2,
  "description": "Every order placed since Monday",
  "display": "table",
  "filters": [
    {
      "name": "State",
      "slug": "state",
      "type": "category"
    }
  ],
  "id": 12,
  "link": "https://metabase.example.com/question/12",
  "name": "Orders this week",
  "query_type": "sql",
  "sql": "SELECT id, total, created_at FROM orders WHERE state = {{state}}",
  "type": "question",
  "updated_at": "2026-10-28T09:00:00Z"
}

Delete question

Move a saved question to Metabase's trash, where it can be restored.

Inputs

QuestionquestiontextRequired
The saved question. Pick one, or give its number or link.

Outputs

deletedtrue/false
True once it's in the trash
idnumber
The question's number
nametext
Its name
Example output
{
  "deleted": true,
  "id": 12,
  "name": "Orders this week"
}

Get dashboard

Get a dashboard's details and the questions on it, to run each of them.

Inputs

DashboarddashboardtextRequired
The dashboard. Pick one, or give its number or link.

Outputs

collectiontext
The collection it's saved in
collection_idtext
That collection's number; blank for Our analytics
created_attext
When it was made (ISO 8601)
descriptiontext
Its description
filterslist
Its filters
idnumber
The dashboard's number
linktext
A link to the dashboard in Metabase
nametext
Its name
question_countnumber
How many questions are on it
questionslist
The questions on it
tabslist
Its tabs, by name
updated_attext
When it last changed (ISO 8601)
Example output
{
  "collection": "Sales",
  "collection_id": "3",
  "created_at": "2026-10-20T09:00:00Z",
  "description": "Orders, revenue and refunds by week",
  "filters": [
    {
      "name": "Date",
      "slug": "date",
      "type": "date/all-options"
    }
  ],
  "id": 4,
  "link": "https://metabase.example.com/dashboard/4",
  "name": "Weekly sales",
  "question_count": 1,
  "questions": [
    {
      "display": "table",
      "link": "https://metabase.example.com/question/12",
      "name": "Orders this week",
      "question_id": 12,
      "tab": ""
    }
  ],
  "tabs": [],
  "updated_at": "2026-10-28T09:00:00Z"
}

Get question

Get a saved question's details: its SQL, its filters and the columns it returns.

Inputs

QuestionquestiontextRequired
The saved question. Pick one, or give its number or link.

Outputs

collectiontext
The collection it's saved in
collection_idtext
That collection's number; blank for Our analytics
columnslist
The columns it returns, from its last run
created_attext
When it was made (ISO 8601)
created_bytext
Who made it
database_idnumber
The number of the database it reads
descriptiontext
Its description
displaytext
How Metabase shows it, such as table, bar or line
filterslist
Its filters
idnumber
The question's number
linktext
A link to it in Metabase
nametext
Its name
query_typetext
sql, or query builder
sqltext
Its SQL, for a SQL question
typetext
question, model or metric
updated_attext
When it last changed (ISO 8601)
Example output
{
  "collection": "Sales",
  "collection_id": "3",
  "columns": [
    {
      "display_name": "ID",
      "name": "ID"
    },
    {
      "display_name": "Total",
      "name": "TOTAL"
    }
  ],
  "created_at": "2026-10-20T09:00:00Z",
  "created_by": "Ada Lovelace",
  "database_id": 2,
  "description": "Every order placed since Monday",
  "display": "table",
  "filters": [
    {
      "name": "State",
      "slug": "state",
      "type": "category"
    }
  ],
  "id": 12,
  "link": "https://metabase.example.com/question/12",
  "name": "Orders this week",
  "query_type": "sql",
  "sql": "SELECT id, total, created_at FROM orders WHERE state = {{state}}",
  "type": "question",
  "updated_at": "2026-10-28T09:00:00Z"
}

List databases

List the databases connected to Metabase that the API key can use.

Inputs

None.

Outputs

countnumber
How many
databaseslist
The databases
Example output
{
  "count": 1,
  "databases": [
    {
      "engine": "postgres",
      "id": 2,
      "is_sample": false,
      "name": "Shop database"
    }
  ]
}

Run question

Run a saved question and get its rows, to send as a report or copy to a sheet.

Inputs

QuestionquestiontextRequired
The saved question. Pick one, or give its number or link.
Filtersfiltersobject
Values for the question's filters, such as a date or a state. Leave a filter blank to use its default.
Row limitlimitnumber
The most rows to return, up to 2000. Defaults to 100.From 1 to 2000.

Outputs

columnslist
The columns, in order
has_moretrue/false
True when the results had more rows than returned
linktext
A link to the question in Metabase
question_idnumber
The question's number
question_nametext
Its name
row_countnumber
How many rows are returned
rowslist
The rows, each an object keyed by column name
Example output
{
  "columns": [
    {
      "display_name": "ID",
      "name": "ID",
      "type": "BigInteger"
    },
    {
      "display_name": "Total",
      "name": "TOTAL",
      "type": "Float"
    },
    {
      "display_name": "Created At",
      "name": "CREATED_AT",
      "type": "DateTime"
    }
  ],
  "has_more": false,
  "link": "https://metabase.example.com/question/12",
  "question_id": 12,
  "question_name": "Orders this week",
  "row_count": 2,
  "rows": [
    {
      "CREATED_AT": "2026-10-28T09:14:00Z",
      "ID": 448,
      "TOTAL": 39.72
    },
    {
      "CREATED_AT": "2026-10-28T11:02:00Z",
      "ID": 449,
      "TOTAL": 117.03
    }
  ]
}

Run SQL query

Run SQL on a database connected to Metabase and get the rows. The SQL runs with Metabase's access to that database, so it can change data too.

Inputs

DatabasedatabasetextRequired
The database. Pick one, or type its name.
SQLsqltextRequired
The SQL to run, written for that database, such as SELECT * FROM orders.
Row limitlimitnumber
The most rows to return, up to 2000. Defaults to 100.From 1 to 2000.

Outputs

columnslist
The columns, in order
database_idnumber
The database's number
has_moretrue/false
True when the results had more rows than returned
row_countnumber
How many rows are returned
rowslist
The rows, each an object keyed by column name
Example output
{
  "columns": [
    {
      "display_name": "ID",
      "name": "ID",
      "type": "BigInteger"
    },
    {
      "display_name": "Total",
      "name": "TOTAL",
      "type": "Float"
    },
    {
      "display_name": "Created At",
      "name": "CREATED_AT",
      "type": "DateTime"
    }
  ],
  "database_id": 2,
  "has_more": false,
  "row_count": 2,
  "rows": [
    {
      "CREATED_AT": "2026-10-28T09:14:00Z",
      "ID": 448,
      "TOTAL": 39.72
    },
    {
      "CREATED_AT": "2026-10-28T11:02:00Z",
      "ID": 449,
      "TOTAL": 117.03
    }
  ]
}

Search dashboards

Find dashboards by words in their names, or in one collection.

Inputs

Wordsquerytext
Words in the dashboards' names or descriptions. Leave blank to list them all.
Collectioncollectiontext
Only dashboards saved straight in this collection. Leave blank to look everywhere.
How manylimitnumber
The most to list, up to 200. Defaults to 25.From 1 to 200.

Outputs

countnumber
How many are listed
dashboardslist
The dashboards found
totalnumber
How many match in all
Example output
{
  "count": 1,
  "dashboards": [
    {
      "collection": "Sales",
      "collection_id": "3",
      "description": "Orders, revenue and refunds by week",
      "id": 4,
      "link": "https://metabase.example.com/dashboard/4",
      "name": "Weekly sales",
      "updated_at": "2026-10-28T09:00:00Z"
    }
  ],
  "total": 1
}

Search questions

Find saved questions, models and metrics by words in their names, or in one collection.

Inputs

Wordsquerytext
Words in the questions' names or descriptions. Leave blank to list them all.
Collectioncollectiontext
Only questions saved straight in this collection. Leave blank to look everywhere.
How manylimitnumber
The most to list, up to 200. Defaults to 25.From 1 to 200.

Outputs

countnumber
How many are listed
questionslist
The questions found
totalnumber
How many match in all
Example output
{
  "count": 1,
  "questions": [
    {
      "collection": "Sales",
      "collection_id": "3",
      "database_id": 2,
      "description": "Every order placed since Monday",
      "display": "table",
      "id": 12,
      "link": "https://metabase.example.com/question/12",
      "name": "Orders this week",
      "type": "question",
      "updated_at": "2026-10-28T09:00:00Z"
    }
  ],
  "total": 1
}

On this page