> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verbeo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Test a search

> See the passages an assistant's search would hand over for a question, with their scores, and the ones it would leave out, with why.

Searches knowledge bases the way an assistant does during a call, and answers the five closest passages with what the search does with each: hand it over (`sent`), or leave it out and why. Use it to check that a question your callers ask finds the right passage, and to choose an assistant's `kbTopK` and `kbMinSimilarity`. It searches ready files only, and places no call.

## Body

**store\_ids** `string[]` *required*

The knowledge bases to search: 1 to 25 UUIDs, each once. An assistant's are its `kbStoreIds`.

**query** `string` *required*

The question, as a caller would ask it. 1 to 1,000 characters.

**top\_k** `number` (default: 3)

Results per search, as an assistant's `kbTopK`: a whole number from `1` to `5`.

**min\_similarity** `number` (default: 0.55)

Match strictness, as an assistant's `kbMinSimilarity`: `0.40` to `0.80` in steps of `0.05`.

## Request

```bash theme={null}
curl -X POST "https://api.verbeo.ai/v1/knowledge-base/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "store_ids": ["5df09066-0842-4c92-8ef0-6cf2ff6d7455"], "query": "Are you open on Sundays?", "top_k": 3 }'
```

## Response

`200 OK`. The passages come best first.

```json theme={null}
{
  "success": true,
  "data": {
    "query": "Are you open on Sundays?",
    "top_k": 3,
    "min_similarity": 0.55,
    "close_to_best": 0.05,
    "passages": [
      { "rank": 1, "file": "opening-hours.docx", "content": "Opening hours: 9 to 5 on weekdays. Closed on Sundays.", "score": 0.74, "verdict": "sent" },
      { "rank": 2, "file": "faq.md", "content": "Do you take walk-ins? Yes, until 4 pm.", "score": 0.58, "verdict": "far_from_best" }
    ]
  }
}
```

**passages\[].score** `number` *required*

How close the passage is to the question, from 0 to 1.

**passages\[].verdict** `string` *required*

`sent`: the search hands it over. Left out: `past_top_k` (beyond the results per search), `below_cutoff` (not above `min_similarity`) or `far_from_best` (more than `close_to_best` below the best match).

## Errors

| Code | Status | When |
| - | - | - |
| `VALIDATION_FAILED` | 422 | `store_ids` empty, repeated or over 25 (`store_ids: must name at least one knowledge base`); `query` empty or over 1,000 characters; `top_k` or `min_similarity` off its scale. |
| `NOT_FOUND` | 404 | A knowledge base that does not exist or is in another workspace. |
| `BAD_GATEWAY` | 502 | `The search could not be run just now. Try again in a moment.` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.