Add a knowledge document
Add a text document to an agent’s knowledge.
The document is available from the next call. Empty text is saved without indexing. If indexing fails, the saved text remains available directly on calls.
Authorizations
An org API key: Authorization: Bearer phk_…
Headers
Optional. Must be the key's org.
Path Parameters
The agent's ID.
Body
The document text in Markdown. Empty text is allowed.
2000000The document name, 1–255 characters after trimming.
1 - 255Create a text document. Files and websites have separate routes.
"document"Response
Successful Response
Something an agent knows: a document, an uploaded file or a website page.
The agent it belongs to.
The text the agent uses, in Markdown. null when there is none, as for most uploaded files.
The knowledge source's ID.
Whether the agent uses it on calls. A source can be turned off without deleting it.
The name shown in the web app. null when it has none.
The type of this object, always knowledge_source.
"knowledge_source"document is text written in the web app, file an uploaded file, website a scraped web page. Known values: document, file, website. More can be added, so handle values you don't recognize.
The page's address, for a website. null for other types.

