---
title: "Search for snippet IDs by task"
method: POST
path: "/snippets/search/ids"
tags: ["snippet"]
---

# Search for snippet IDs by task

`POST /snippets/search/ids`

Used to query snippets by task using snippet search references for most recent version

## Query parameters

- `workspace_id` string, required

## Request body

- QueryEntityByTaskParameters — Parameters for querying entities by task description
  - `application_id` string — Restricts the query to entities of a given application ID
  - `database_connection_id` string — Restricts the query to entities with the given database connection ID (only used for Snippet queries)
  - `flow_type` 'validate_page' | 'login' | 'verify_url' | 'mablscript' | 'check_links' | 'visual_page_validation' | 'api' | 'mobile' — the type of flow
  - `limit` integer, required — The max results to return
  - `mobile_platform` 'android' | 'ios' — The mobile platform associated with this object
  - `reusable` boolean — If specified, will only return entities with the given reusable flag
  - `snippet_types` SnippetTypeEnum[] — Restricts the query to entities with the given snippet type (only used for Snippet queries)
  - `session_id` string — The id of the mabl AI session, if any
  - `task_description` string, required — The task description
  - `rerank_with_llm` boolean — When true (default), the candidate list is LLM-reranked against the task description before the top `limit` are returned. When false, the LLM rerank is skipped and the raw datastore-ordered candidates (ASC by `COSINE_DISTANCE`) are returned. Either way the response honors `limit`; the internal candidate widening multiplier varies by endpoint (endpoints that group results after the fetch keep the widened set so grouping does not underfill `limit`).

## Response `200`

Snippet IDs matching the query

- EntityIdQueryResult
  - `ids` string[], required

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
