Search knowledge sources
Módulo Workforce
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`.
- Requiere la capacidad knowledge.sop.read.
- Alcances de OAuth: knowledge.
- Estados de error: 400, 401, 422, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| q | string | Sí | The question.Restricciones: length 1 to 500 |
| limit | integer | No | At most this many.Restricciones: range 1 to 25 |
Respuesta 200: KnowledgeSourcePage
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| data | array of KnowledgeSource | Sí | Items on this page, in the documented default order. |
| next_cursor | string | null | Sí | Opaque 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
}Ejemplos de código
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