/api/search

GET /api/search

Changed on

Search for items in Metabase. For the list of supported models, check [[metabase.search.config/all-models]].

context identifies the surface issuing the search; it selects the ranking weights and filter defaults. It defaults to api, the value for programmatic callers.

Filters:

  • archived: set to true to search archived items only, default is false
  • table_db_id: search for tables, cards, and models of a certain DB
  • models: only search for items of specific models. If not provided, search for all models
  • filter_items_in_personal_collection: only search for items in personal collections
  • created_at: search for items created at a specific timestamp
  • created_by: search for items created by a specific user
  • last_edited_at: search for items last edited at a specific timestamp
  • last_edited_by: search for items last edited by a specific user
  • search_native_query: set to true to search the content of native queries
  • vector_search_strategy: for the semantic engine: hnsw (approximate index search, default), brute-force (exact filter-first search), or hnsw-iterative-relaxed / hnsw-iterative-strict (index-backed iterative scans with inline filters); ignored by other engines
  • vector_search_ef_search: override pgvector's hnsw.ef_search (1-1000) for the iterative strategies; (admin only)
  • vector_search_max_scan_tuples: override pgvector's hnsw.max_scan_tuples for the iterative strategies; (admin only)
  • vector_search_explain: set to true to record vector-scan instrumentation for this search (expensive); (admin only)
  • verified: set to true to search for verified items only (requires Content Management or Official Collections premium feature)
  • ids: search for items with those ids, works iff single value passed to models
  • display_type: search for cards/models with specific display types

Note that not all item types support all filters, and the results will include only models that support the provided filters. For example:

  • The created-by filter supports dashboards, models, actions, and cards.
  • The verified filter supports models and cards.

A search query that has both filters applied will only return models and cards.

get/api/search

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Query parameters

vector_search_ef_searchinteger nullable
qstring nullable
collectioninteger nullable

value must be an integer greater than zero.

vector_search_explainboolean nullable
created_byinteger[] nullable
include_metadataboolean nullable
idsinteger[] nullable
archivedboolean nullable
verifiedboolean nullable
last_edited_byinteger[] nullable
context'basic-actions' | 'browse' | 'command-palette' | 'data-picker' | 'dependencies' | 'document' | 'embedding-setup' | 'entity-picker' | 'library' | 'model-migration' | 'search-app' | 'search-bar' | 'type-filter' | 'api' | 'metabot'
vector_search_strategy'hnsw' | 'brute-force' | 'hnsw-iterative-relaxed' | 'hnsw-iterative-strict' nullable
model_ancestorsboolean nullable
calculate_available_modelsboolean nullable
display_typestring[] nullable
created_atstring nullable

value must be a non-blank string.

modelsstring[] nullable
last_edited_atstring nullable

value must be a non-blank string.

search_native_queryboolean nullable
table_db_idinteger nullable

value must be an integer greater than zero.

include_dashboard_questionsboolean nullable
vector_search_max_scan_tuplesinteger nullable
filter_items_in_personal_collection'all' | 'only' | 'only-mine' | 'exclude' | 'exclude-others' nullable
search_enginestring nullable

Response

Successful response

Changes

    • breaking

      the query request parameter context was restricted to a list of enum values

    • breaking

      for the query request parameter context, default value api was added

    • breaking

      query request parameter context list-of-types was narrowed by removing types null

    • warning

      deleted the query request parameter has_temporal_dim

    • warning

      deleted the query request parameter non_temporal_dim_ids

    • info

      added the new optional query request parameter vector_search_ef_search

    • info

      added the new optional query request parameter vector_search_explain

    • info

      added the new optional query request parameter vector_search_max_scan_tuples

    • info

      added the new optional query request parameter vector_search_strategy

    • info

      the query request parameter archived became optional

    • info

      the query request parameter include_dashboard_questions became optional

    • info

      the query request parameter include_metadata became optional

    • info

      the query request parameter model_ancestors became optional

    • info

      added the new enum value api to the query request parameter context

    • info

      added the new enum value basic-actions to the query request parameter context

    • info

      added the new enum value browse to the query request parameter context

    • info

      added the new enum value command-palette to the query request parameter context

    • info

      added the new enum value data-picker to the query request parameter context

    • info

      added the new enum value dependencies to the query request parameter context

    • info

      added the new enum value document to the query request parameter context

    • info

      added the new enum value embedding-setup to the query request parameter context

    • info

      added the new enum value entity-picker to the query request parameter context

    • info

      added the new enum value library to the query request parameter context

    • info

      added the new enum value metabot to the query request parameter context

    • info

      added the new enum value model-migration to the query request parameter context

    • info

      added the new enum value search-app to the query request parameter context

    • info

      added the new enum value search-bar to the query request parameter context

    • info

      added the new enum value type-filter to the query request parameter context

    • info

      for the query request parameter context, the type was generalized from no type to string

    • breaking

      api path removed without deprecation

    • info

      endpoint added