Knowledge
Get a knowledge base
const url = 'https://app.whatsetter.com/api/v1/knowledge-bases/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.whatsetter.com/api/v1/knowledge-bases/example \ --header 'Authorization: Bearer <token>'One base with its sources, one entry per website and per file, and one
entry for all its answers. status tells whether the agent can use a
source: ready, reading (being read), failed (could not be read)
or empty (nothing readable in it). answers_limit, files_limit
and the two can_add_… flags say what the workspace’s plan allows.
A file’s id reads its whole text (GET …/files/{fileId}); editable
tells whether that text can be rewritten through the API (a .txt or
.md file). Websites, PDF and Word files are added from the dashboard.
Requires scope knowledge:read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A base id from GET /knowledge-bases, or a campaign’s knowledge_base_id
Responses
Section titled “Responses”The knowledge base
object
object
The agents that answer from this base (the id of GET /campaigns).
object
object
null for the answers, which have their own endpoint.
Websites only.
Websites only.
Websites only.
Websites only.
Files only.
Files only.
Files only. true for a text file (.txt, .md): PATCH …/files/{fileId} rewrites it.
Answers only.
How many answers the plan lets this base hold.
false on a plan that reads its knowledge but adds none.
How many files the plan lets this base hold.
false on a plan that reads its knowledge but adds none.
Example
{ "data": { "id": "68c1f1c4001a09be5d10", "name": "Salle Horizon", "campaign_ids": [ "68c1f0a2003b6f1d2e77" ], "created_at": "2026-09-02T09:19:48.000+00:00", "sources": [ { "id": "68c1f1d80033a1b07c55", "kind": "website", "name": "salle-horizon.fr", "status": "ready", "created_at": "2026-09-02T09:20:08.000+00:00", "url": "https://salle-horizon.fr", "pages_read": 12, "pages_found": 13, "last_read_at": "2026-10-05T03:17:02.000+00:00" }, { "id": "68d40b7e000f1c2d3a66", "kind": "file", "name": "tarifs-2026.pdf", "status": "ready", "created_at": "2026-09-24T15:02:54.000+00:00", "pages": 3, "size_bytes": 184220, "editable": false }, { "id": "68e61c2a0019f0a4d3b1", "kind": "file", "name": "opening-hours.txt", "status": "ready", "created_at": "2026-10-09T08:40:10.000+00:00", "pages": null, "size_bytes": 2310, "editable": true }, { "id": null, "kind": "answers", "name": null, "status": "ready", "created_at": "2026-09-03T08:11:40.000+00:00", "answers": 14 } ], "answers_limit": 200, "can_add_answers": true, "files_limit": 5, "can_add_files": true }}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The key lacks the required scope (insufficient_scope), the plan does not have this part of the API (not_in_plan), or Instagram is not enabled on the workspace (instagram_not_enabled, Instagram routes)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Resource not found in this workspace
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}