Request reference

Fields, response and status codes of a search request.

A search request is a POST with a JSON body, both with the npm client and with fetch. The resourceGroupId is part of the URL.

POST {API_BASE_URL}/api/resource-groups/{resourceGroupId}/search

Request

FieldTypeRequiredDescription
resourceGroupIdstringYesID of the Knowledge Group to search (part of the path).
querystringYesThe text to search for.
limitnumberNoMaximum number of chunks to return, from 1 to 20. Defaults to 3.
rolestringNoOnly match resources tagged with this role, or with none, see Role Filter.
{
    "query": "What is your return policy?",
    "limit": 5,
    "role": "customer"
}

query is the only required field. Omit limit to get the default of 3 results, and omit role to search across every resource regardless of how it is tagged.

Response

200 OK with the matching chunks:

FieldTypeDescription
querystringThe query you sent, echoed back.
countnumberNumber of chunks in results.
resultsarrayThe matching chunks, sorted by score, highest first.
results[].idstringID of the chunk.
results[].resource_idstringID of the resource the chunk was cut from.
results[].contentstringThe chunk's text.
results[].added_atstringWhen the chunk was created, ISO 8601.
results[].scorenumberRelevance of this chunk to the query, see Search and ranking.
notesarrayExplanations about the search itself, see Notes below. May be empty.
{
    "query": "What is your return policy?",
    "count": 2,
    "notes": [],
    "results": [
        {
            "id": "3b7f1c9e-2d4a-4b8c-9e1f-0a2b3c4d5e6f",
            "resource_id": "f2c1a0d4-7c2e-4e1a-9a9b-3d5f6c7b8a90",
            "content": "Items can be returned within 30 days of delivery…",
            "added_at": "2026-01-14T09:32:00Z",
            "score": 0.8123
        }
    ]
}

Each entry is one chunk, not a whole resource, see Understanding chunks. A resource can appear more than once in results if several of its chunks matched.

Notes

notes explains something about the search itself, rather than about a specific chunk, see Understanding results for how to use it. Each entry has a reason code and a human readable message:

{
    "reason": "LOW_RELEVANCE",
    "message": "No relevant results. Some content matched your query, but none is relevant to the question; try a more specific query."
}
reasonMeaning
EMPTY_SCOPEThe Knowledge Group, or the role you filtered by, has no content at all.
PHRASE_NOT_FOUNDA quoted phrase in query does not appear in any resource.
NO_LEXICAL_MATCHNothing matched either technique closely enough to return.
LOW_RELEVANCESome chunks were found, but none scored high enough to be relevant.
SEMANTIC_ONLYresults are based on meaning only; nothing shared any of your query's words.
LEXICAL_ONLYresults share words with your query but may not be close in meaning.
RANKING_DEGRADEDResults could not be reranked and are less precise than usual.

notes is an array because more than one can apply at once, and it is empty when there is nothing noteworthy to report.

Status codes

StatusMeaning
200Search ran, results may still be empty if nothing matched.
400Malformed resourceGroupId or request body, e.g. missing query.
402Trial access has expired.
403No x-api-key header sent, or the key is unknown or was deleted.
404No Knowledge Group exists with that resourceGroupId.
500Search failed on the server.

Every non-200 response answers with a JSON body:

{ "message": "Resource group not found" }

On this page