Knowledge API
An agent's knowledge is the set of sources it answers from: pasted text (prices, policies, FAQs), public web pages (one page, or a crawl of the same site) and files (PDF, Word, HTML, CSV, TXT, Markdown). A new source is read in the background, and the agent answers from it once its status is ready.
knowledge:readknowledge:write7 endpointsShow
/v1/agents/:id/knowledgeList an agent's knowledge
Lists the documents, pasted texts and web pages the agent answers from, newest first, with each one's status and size in chunks.
knowledge:readstatus: pending until the source is read, processing while it is chunked and embedded, ready when the agent answers from it, error when it could not be read (error says why). A source read again keeps answering from its previous version until the new one is ready.
Path parameters
iduuidrequiredThe agent id.
Query parameters
limitinteger · 1–100Results per page. Default: 20.
offsetinteger · at least 0Results to skip. Default: 0.
kindfile | text | urlOnly sources of this kind.
statuspending | processing | ready | errorOnly sources in this status.
Errors
400validation_errorA query parameter is invalid (details.errors lists each one).404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl "https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge?status=ready" \ -H "Authorization: Bearer $NUTALK_API_KEY"
{
"success": true,
"data": [
{
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "url",
"title": "Prices and services",
"status": "ready",
"chunk_count": 42,
"error": null,
"url": "https://clinic.example.com/prices",
"crawl": true,
"max_pages": 25,
"warnings": [],
"ingested_at": "2026-10-12T18:10:42.318Z",
"created_at": "2026-10-12T18:10:31.904211+00:00",
"updated_at": "2026-10-12T18:10:42.318+00:00"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
}/v1/agents/:id/knowledgeAdd a knowledge source
Adds a source the agent answers from: pasted text (kind: text) or a public web page (kind: url, optionally crawling the same site's linked pages) as JSON, or a file as multipart/form-data with the file in the file field (PDF, Word .docx, HTML, CSV, TXT or Markdown; the whole request at most 4 MB, larger files are added in the dashboard). The source is stored at once, then read, chunked and embedded in the background: follow its status with GET.
knowledge:writeWorkspace keys only · acts as the key's creatorFile uploads go in one request, so the request's size limit applies (about 4 MB through the API); larger documents are uploaded in the dashboard.
The change runs the dashboard's knowledge rules as the member who created the key: the key needs the scope and that member a role that edits agents (owner, admin or builder). A key whose creator has left the workspace is refused.
Path parameters
iduuidrequiredThe agent id.
Request body
kindtext | urlrequiredtext or url (a file is sent as multipart instead).
titlestring · 1–200 charactersThe source's title. Required for text; for url the site's name by default.
textstring · 1–1,000,000 characterstext only: the text the agent answers from.
urlstring · up to 2,048url only: a public http(s) address.
crawlbooleanurl only: also read the same site's linked pages. Default: false.
max_pagesinteger · 1–50url with crawl only: the most pages to read. Default: 25.
Show 2 more fields
Errors
400validation_errorThe body is not JSON, or a field is missing or invalid (details.errors lists each field).400validation_errorThe URL is not http(s) or points to a private network, or the file is missing, empty, too large or of another type (details.reason).403forbiddenThe member who created the key has a role that can't edit agents or has left the workspace.404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl -X POST https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge \
-H "Authorization: Bearer $NUTALK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "url",
"url": "https://clinic.example.com/prices",
"title": "Prices and services",
"crawl": true,
"max_pages": 25
}'pending. ingest_started is false when reading it could not be started now: it is retried within 30 minutes.{
"success": true,
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "url",
"title": "Prices and services",
"status": "pending",
"chunk_count": 0,
"error": null,
"url": "https://clinic.example.com/prices",
"crawl": true,
"max_pages": 25,
"warnings": [],
"ingested_at": null,
"created_at": "2026-10-12T18:10:31.904211+00:00",
"updated_at": "2026-10-12T18:10:31.904211+00:00",
"ingest_started": true
}
}/v1/agents/:id/knowledge/:source_idGet a knowledge source
Returns one knowledge source of the agent, with its status, its error and its warnings.
knowledge:readstatus: pending until the source is read, processing while it is chunked and embedded, ready when the agent answers from it, error when it could not be read (error says why). A source read again keeps answering from its previous version until the new one is ready.
Path parameters
iduuidrequiredThe agent id.
source_iduuidrequiredThe knowledge source id.
Errors
404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).404not_foundNo knowledge source with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b \ -H "Authorization: Bearer $NUTALK_API_KEY"
{
"success": true,
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "url",
"title": "Prices and services",
"status": "ready",
"chunk_count": 42,
"error": null,
"url": "https://clinic.example.com/prices",
"crawl": true,
"max_pages": 25,
"warnings": [],
"ingested_at": "2026-10-12T18:10:42.318Z",
"created_at": "2026-10-12T18:10:31.904211+00:00",
"updated_at": "2026-10-12T18:10:42.318+00:00"
}
}/v1/agents/:id/knowledge/:source_idRemove a knowledge source
Removes the source, its stored file or text and its chunks: the agent stops answering from it at once.
knowledge:writeWaits for approvalWorkspace keys only · acts as the key's creatorThe change runs the dashboard's knowledge rules as the member who created the key: the key needs the scope and that member a role that edits agents (owner, admin or builder). A key whose creator has left the workspace is refused.
Path parameters
iduuidrequiredThe agent id.
source_iduuidrequiredThe knowledge source id.
Unless its key was set not to wait, nothing is removed yet: the call answers 202 with data.change_request, and runs once an owner or admin approves it in Settings → API keys. Follow it with GET /v1/change-requests/:id.
Errors
403forbiddenThe member who created the key has a role that can't edit agents or has left the workspace.404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).404not_foundNo knowledge source with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl -X DELETE https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b \ -H "Authorization: Bearer $NUTALK_API_KEY"
{
"success": true,
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"deleted": true
}
}/v1/agents/:id/knowledge/:source_id/reingestRead a knowledge source again
Reads the source again in the background: a web page is fetched anew, a file or text re-read with the agent's current document search settings. The agent keeps answering from the version it has until the new one is ready.
knowledge:writeCan wait for approvalWorkspace keys only · acts as the key's creatorThe change runs the dashboard's knowledge rules as the member who created the key: the key needs the scope and that member a role that edits agents (owner, admin or builder). A key whose creator has left the workspace is refused.
Path parameters
iduuidrequiredThe agent id.
source_iduuidrequiredThe knowledge source id.
Nothing changes yet: the call answers 202 with data.change_request, and runs once an owner or admin approves it in Settings → API keys. Follow it with GET /v1/change-requests/:id.
Errors
403forbiddenThe member who created the key has a role that can't edit agents or has left the workspace.404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).404not_foundNo knowledge source with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl -X POST https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b/reingest \ -H "Authorization: Bearer $NUTALK_API_KEY"
pending{
"success": true,
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "url",
"title": "Prices and services",
"status": "pending",
"chunk_count": 42,
"error": null,
"url": "https://clinic.example.com/prices",
"crawl": true,
"max_pages": 25,
"warnings": [],
"ingested_at": "2026-10-12T18:10:42.318Z",
"created_at": "2026-10-12T18:10:31.904211+00:00",
"updated_at": "2026-10-12T18:10:42.318+00:00",
"ingest_started": true
}
}/v1/agents/:id/knowledge/:source_idEdit a text source
Gives a text source a new title, new text, or both, and reads it again: the agent keeps answering from the old text until the new one is ready. A file is replaced by adding the new one and removing the old one; a web page is read again with reingest.
knowledge:writeCan wait for approvalWorkspace keys only · acts as the key's creatorThe change runs the dashboard's knowledge rules as the member who created the key: the key needs the scope and that member a role that edits agents (owner, admin or builder). A key whose creator has left the workspace is refused.
When the key's changes wait for approval, a body over 64 KB can't be held: add the text as a new source and remove the old one instead.
Path parameters
iduuidrequiredThe agent id.
source_iduuidrequiredThe knowledge source id.
Request body
titlestring · 1–200 charactersThe new title.
textstringThe new text.
Nothing changes yet: the call answers 202 with data.change_request, and runs once an owner or admin approves it in Settings → API keys. Follow it with GET /v1/change-requests/:id.
Errors
400validation_errorThe body is not JSON, or a field is missing or invalid (details.errors lists each field).400validation_errorThe source isn't a text source (details.reason not_text_source).409conflictThe source is being read right now (details.reason still_reading): try again when its status is ready or error.429rate_limitedThe workspace started too many test runs, re-scorings or knowledge reads through the API (30 an hour, 5 a minute).403forbiddenThe member who created the key has a role that can't edit agents or has left the workspace.404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).404not_foundNo knowledge source with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl -X PATCH https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $NUTALK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Consultations cost $800 MXN and last 30 minutes."
}'pending{
"success": true,
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "text",
"title": "Prices and services",
"status": "pending",
"chunk_count": 42,
"error": null,
"url": null,
"crawl": false,
"max_pages": null,
"warnings": [],
"ingested_at": "2026-10-12T18:10:42.318Z",
"created_at": "2026-10-12T18:10:31.904211+00:00",
"updated_at": "2026-10-12T18:10:42.318+00:00"
}
}/v1/agents/:id/knowledge/searchSearch an agent's knowledge
The passages the agent's knowledge search finds for a question, with the agent's own search settings, as "Try a question" does in its Knowledge tab. It changes nothing. mode is hybrid, or keywords when the semantic search was unavailable; with no passage, reason says why (no_documents, nothing_relevant, search_failed).
knowledge:readWorkspace keys only · acts as the key's creatorRead as the member who created the key, with a role that sees the agent.
Path parameters
iduuidrequiredThe agent id.
Query parameters
questionstring · 1–500 charactersrequiredThe question, as a customer would ask it.
Errors
400validation_errorA query parameter is invalid (details.errors lists each one).429rate_limitedThe member who created the key searched too many times in a short time (the dashboard's own limit).403forbiddenThe member who created the key has a role that can't edit agents or has left the workspace.404not_foundNo agent with this id in your workspace (ids of other workspaces answer the same).Plus the errors every request can return (401, 403, 429, 500): Errors.
curl "https://www.nutalk.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/knowledge/search?question=How%20much%20is%20a%20consultation%3F" \ -H "Authorization: Bearer $NUTALK_API_KEY"
{
"success": true,
"data": {
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"question": "How much is a consultation?",
"mode": "hybrid",
"passages": [
{
"title": "Prices and services",
"section": "Consultations",
"excerpt": "A first consultation costs $800 MXN and lasts 30 minutes."
}
],
"reason": null
}
}