Version v0.50 of Metabase is no longer supported. Check out the docs for the current stable version, Metabase v0.63.
Card
/api/card endpoints.
DELETE /api/card/:card-id/public_link
Delete the publicly-accessible link to this Card.
PARAMS:
card-idvalue must be an integer greater than zero.
DELETE /api/card/:id
Hard delete a Card. To soft delete, use PUT /api/card/:id.
PARAMS:
idvalue must be an integer greater than zero.
GET /api/card/
Get all the Cards. Option filter param f can be used to change the set of Cards that are returned; default is
all, but other options include mine, bookmarked, database, table, using_model, using_metric,
using_segment, and archived. See corresponding implementation functions above for the specific behavior
of each filter option. :card_index.
PARAMS:
-
fnullable enum of archived, table, using_model, bookmarked, using_segment, all, mine, using_metric, database. -
model_idnullable value must be an integer greater than zero.
GET /api/card/:card-id/params/:param-key/search/:query
Fetch possible values of the parameter whose ID is :param-key that contain :query.
;; fetch values for Card 1 parameter 'abc' that contain 'Orange';
GET /api/card/1/params/abc/search/Orange
Currently limited to first 1000 results.
PARAMS:
-
card-idvalue must be an integer greater than zero. -
param-keyvalue must be a non-blank string. -
queryvalue must be a non-blank string.
GET /api/card/:card-id/params/:param-key/values
Fetch possible values of the parameter whose ID is :param-key.
;; fetch values for Card 1 parameter 'abc' that are possible
GET /api/card/1/params/abc/values.
PARAMS:
-
card-idvalue must be an integer greater than zero. -
param-keyvalue must be a non-blank string.
GET /api/card/:id
Get Card with ID.
PARAMS:
-
idvalue must be an integer greater than zero. -
ignore_viewnullable boolean.
GET /api/card/:id/query_metadata
Get all of the required query metadata for a card.
PARAMS:
idvalue must be an integer greater than zero.
GET /api/card/:id/related
Return related entities.
PARAMS:
idvalue must be an integer greater than zero.
GET /api/card/:id/series
Fetches a list of comptatible series with the card with id card_id.
last_cursorwith value is the id of the last card from the previous page to fetch the next page.queryto search card by name.exclude_idsto filter out a list of card ids.
PARAMS:
-
idinteger. -
last_cursornullable value must be an integer greater than zero. -
querynullable value must be a non-blank string. -
exclude_idsnullable function.
GET /api/card/:id/timelines
Get the timelines for card with ID. Looks up the collection the card is in and uses that.
PARAMS:
-
idvalue must be an integer greater than zero. -
includenullable must equal events. -
startnullable value must be a valid date string. -
endnullable value must be a valid date string.
GET /api/card/embeddable
Fetch a list of Cards where enable_embedding is true. The cards can be embedded using the embedding endpoints
and a signed JWT.
GET /api/card/public
Fetch a list of Cards with public UUIDs. These cards are publicly-accessible if public sharing is enabled.
POST /api/card/
Create a new Card. A card can be of type question, model, or metric.
PARAMS:
-
visualization_settingsValue must be a map. -
parametersnullable sequence of parameter must be a map with :id and :type keys. -
descriptionnullable value must be a non-blank string. -
collection_positionnullable value must be an integer greater than zero. -
result_metadatanullable :metabase.analyze.query-results/ResultsMetadata. -
collection_idnullable value must be an integer greater than zero. -
namevalue must be a non-blank string. -
typenullable :metabase.api.card/card-type. -
cache_ttlnullable value must be an integer greater than zero. -
dataset_queryValue must be a map. -
parameter_mappingsnullable sequence of parameter_mapping must be a map with :parameter_id and :target keys. -
displayvalue must be a non-blank string.
POST /api/card/:card-id/persist
Mark the model (card) as persisted. Runs the query and saves it to the database backing the card and hot swaps this query in place of the model’s query.
PARAMS:
card-idvalue must be an integer greater than zero.
POST /api/card/:card-id/public_link
Generate publicly-accessible links for this Card. Returns UUID to be used in public links. (If this Card has already been shared, it will return the existing public link rather than creating a new one.) Public sharing must be enabled.
PARAMS:
card-idvalue must be an integer greater than zero.
POST /api/card/:card-id/query
Run the query associated with a Card.
PARAMS:
-
card-idvalue must be an integer greater than zero. -
parameters -
ignore_cachenullable boolean. -
dashboard_idnullable value must be an integer greater than zero. -
collection_previewnullable boolean.
POST /api/card/:card-id/query/:export-format
Run the query associated with a Card, and return its results as a file in the specified format.
parameters should be passed as query parameter encoded as a serialized JSON string (this is because this endpoint
is normally used to power ‘Download Results’ buttons that use HTML form actions).
PARAMS:
-
card-idvalue must be an integer greater than zero. -
export-formatenum of csv, api, xlsx, json. -
parametersnullable value must be a valid JSON string. -
format_rowsnullable boolean.
POST /api/card/:card-id/refresh
Refresh the persisted model caching card-id.
PARAMS:
card-idvalue must be an integer greater than zero.
POST /api/card/:card-id/unpersist
Unpersist this model. Deletes the persisted table backing the model and all queries after this will use the card’s query rather than the saved version of the query.
PARAMS:
card-idvalue must be an integer greater than zero.
POST /api/card/:id/copy
Copy a Card, with the new name ‘Copy of name’.
PARAMS:
idnullable value must be an integer greater than zero.
POST /api/card/collections
Bulk update endpoint for Card Collections. Move a set of Cards with card_ids into a Collection with
collection_id, or remove them from any Collections by passing a null collection_id.
PARAMS:
-
card_idssequence of value must be an integer greater than zero. -
collection_idnullable value must be an integer greater than zero.
POST /api/card/from-csv
Create a table and model populated with the values from the attached CSV. Returns the model ID if successful.
PARAMS:
raw-params
POST /api/card/pivot/:card-id/query
Run the query associated with a Card.
PARAMS:
-
card-idvalue must be an integer greater than zero. -
parameters -
ignore_cachenullable boolean.
POST /api/card/related
Return related entities for an ad-hoc query.
PARAMS:
query
PUT /api/card/:id
Update a Card.
PARAMS:
-
collection_previewnullable boolean. -
visualization_settingsnullable Value must be a map. -
parametersnullable sequence of parameter must be a map with :id and :type keys. -
descriptionnullable string. -
archivednullable boolean. -
collection_positionnullable value must be an integer greater than zero. -
result_metadatanullable :metabase.analyze.query-results/ResultsMetadata. -
enable_embeddingnullable boolean. -
collection_idnullable value must be an integer greater than zero. -
card-updates -
namenullable value must be a non-blank string. -
typenullable :metabase.api.card/card-type. -
embedding_paramsnullable value must be a valid embedding params map. -
cache_ttlnullable value must be an integer greater than zero. -
dataset_querynullable Value must be a map. -
idvalue must be an integer greater than zero. -
displaynullable value must be a non-blank string.
Read docs for other versions of Metabase.