Skip to content

Search knowledge sources

Workforce module

GET/knowledge-sources/searchknowledgeSources.search

The Assistant's sources: published handbook articles, SOPs and training lessons the caller can read that match the question, ranked, with routes to cite. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requires the capability knowledge.sop.read.
  • OAuth scopes: knowledge.
  • Error statuses: 400, 401, 422, 429. Errors are RFC 9457 problem details.

Path and query parameters

knowledgeSources.search: Path and query parameters
FieldTypeRequiredDescription
qstringYesThe question.Constraints: length 1 to 500
limitintegerNoAt most this many.Constraints: range 1 to 25

Response 200: KnowledgeSourcePage

knowledgeSources.search: KnowledgeSourcePage
FieldTypeRequiredDescription
dataarray of KnowledgeSourceYesItems on this page, in the documented default order.
next_cursorstring | nullYesOpaque cursor for the next page; null on the last page.
{
  "data": [
    {
      "source_kind": "Handbook",
      "source_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
      "title": "Hearing protection",
      "version": 2,
      "excerpt": "Wear hearing protection near the stacks.",
      "route": "/northwind-live/knowledge/handbook?peek=x",
      "rank": 0.42
    }
  ],
  "next_cursor": null
}

Code samples

curl -X GET "$XOS_BASE_URL/knowledge-sources/search" \
  -H "Authorization: Bearer $XOS_API_KEY"
const { data } = await xos.knowledgeSources.search();
response = xos.knowledge_sources.search()
xos knowledge-sources search