API reference
Knowledge base API
What an assistant answers from. Add pasted text, a single URL, a whole site or an uploaded file, watch indexing finish, and run the bot's own retrieval to see exactly what comes back for a query.
Endpoints
8 operations, each with its parameters, schemas and an example request on its own page.
- get/api/bots/{bot_id}/knowledgeList documents
- post/api/bots/{bot_id}/knowledgeCreate document — Adds pasted text, a single URL, or a whole site to the knowledge base.
- post/api/bots/{bot_id}/knowledge/searchSearch knowledge — Runs the bot's own retrieval and shows exactly what comes back.
- post/api/bots/{bot_id}/knowledge/uploadUpload document — Accepts a file upload.
- delete/api/bots/{bot_id}/knowledge/{document_id}Delete document
- get/api/bots/{bot_id}/knowledge/{document_id}/downloadDownload document — A short-lived signed link to the file the customer originally uploaded.
- post/api/bots/{bot_id}/knowledge/{document_id}/reindexReindex document
- get/api/bots/{bot_id}/knowledge/{document_id}/statusDocument status — Polled after upload until the document reaches a terminal state.
Authentication
Every call here needs Authorization: Bearer with a key from the dashboard — Authentication covers keys and scopes.
Objects returned
The models these endpoints send back, with every field. Open one to read it.
PaginatedResponse_DocumentRead_6 fields
itemsarray of DocumentReadrequired14 fields · DocumentRead
created_atstring (date-time)requiredidstringrequiredsource_typestringrequiredstatusstringrequiredtitlestringrequiredupdated_atstring (date-time)requiredchunk_countintegerDefault: 0
embedding_modelstring | nullerror_messagestring | nullmime_typestring | nullsize_bytesintegerDefault: 0
source_urlstring | nulltagsarray of anytoken_countintegerDefault: 0
pageintegerrequiredpage_sizeintegerrequiredtotalintegerrequiredhas_morebooleanDefault: false
next_cursorstring | null
DocumentRead14 fields
created_atstring (date-time)requiredidstringrequiredsource_typestringrequiredstatusstringrequiredtitlestringrequiredupdated_atstring (date-time)requiredchunk_countintegerDefault: 0
embedding_modelstring | nullerror_messagestring | nullmime_typestring | nullsize_bytesintegerDefault: 0
source_urlstring | nulltagsarray of anytoken_countintegerDefault: 0
SearchResponse3 fields
querystringrequiredresultsarray of SearchResultrequired8 fields · SearchResult
chunk_idstringrequiredcontentstringrequireddocument_idstringrequireddocument_titlestring | nullrequiredscorenumberrequireddense_rankinteger | nulllexical_rankinteger | nullrerank_scorenumber | null
took_msintegerrequired
Message2 fields
messagestringrequiredokbooleanDefault: true
DocumentDownload4 fields
expires_inintegerrequiredfilenamestringrequiredurlstringrequiredmime_typestring | null
DocumentStatusRead4 fields
chunk_countintegerrequiredidstringrequiredstatusstringrequirederror_messagestring | null
Something here wrong or missing? Tell us — the documentation and the API are maintained by the same person, so a correction is a fix rather than a ticket.