Read a knowledge source's indexed text
Read one knowledge-base source back as the agent searches it: an agent source or a workspace source, whatever its kind (text, url, site, upload or a set answer, which is always one passage). Returns `source` (id, scope, kind, name, url, status, chunkCount, error, refreshError, rejectedChunkCount and rejectedReasons from the quality gate, sharedState for a workspace source, lastFetchedAt, updatedAt) and `passages`, the indexed text in order, 10 to a page, each `{ index, tokens, section, pageUrl, text }`. Page through with `page` until `hasMore` is false; `pages` is the total. The passages are what the quality gate kept, so text it dropped (see rejectedReasons) is not there, and a source still being read has none yet. Use it to check what the agent can find before you add or rewrite a source, and to copy a text source's wording into update_text_kb_source or a set answer's into update_set_answer. It reads with your own access, so a source you can't open in the agent's Knowledge base can't be read here either, and each read is recorded in the audit log.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Path Parameters
Workspace slug (GET /me lists yours).
Agent slug within the workspace.
Query Parameters
Page of passages, 10 to a page, in the order they were indexed. Pass nextPage from the last reply.
11 <= value <= 9007199254740991Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X GET "https://example.com/workspaces/string/agents/string/knowledge-base/string"{
"source": {
"id": "string",
"scope": "string",
"kind": "string",
"name": "string",
"status": "string",
"property1": null,
"property2": null
},
"page": 0,
"pages": 0,
"hasMore": true,
"property1": null,
"property2": null
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}Delete a knowledge source DELETE
Delete a knowledge-base source by id, with its indexed content. A source with scope agent comes off this agent's draft, and callers stop getting it when you publish the agent. A source with scope workspace is shared by every agent in the workspace, so removing it takes it from all of them, and needs permission to manage the workspace knowledge base: a draft one (never published) is deleted at once, and a published one is marked for removal, which every agent keeps answering from until `publish_workspace_knowledge` runs and deletes it. The reply's `removed` is `deleted` or `staged` to say which. Use when content is wrong or no longer wanted; for content that just needs re-reading, call `refresh_kb_source` instead, which keeps the source's id and sync schedule.
List knowledge sources GET
List the knowledge-base sources currently attached to this agent. Returns each source's name, kind (text/url/upload/site), status (pending/extracting/embedding/ready/failed), chunk count, and what the ingest quality gate dropped on the latest read: `rejectedChunkCount` and `rejectedReasons` ([{reason, count, sections}]). A `ready` source can still have dropped chunks; a `live price list` reason means the agent cannot quote those prices from the KB and needs a price tool. Use before `add_text_kb_source` or `add_url_kb_source` to avoid duplicating coverage.