Knowledge
List collections
Newest first. Collections read by the internal assistant are not listed.
Required scope: knowledge:read.
query Parameters
limitcursorThe nextCursor of the previous page, with the same filters.
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
List collections › Responses
objecthasMorenextCursorCreate a collection
A collection groups documents. An agent searches only the collections you give it.
Required scope: knowledge:write.
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Idempotency-KeyMakes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.
Create a collection › Request Body
name\S · requireddescriptionCreate a collection › Responses
objectidnamedescriptiondocumentCountDocuments in any status.
createdAtupdatedAtSearch the knowledge
Finds the passages of your documents that answer a question, by meaning and by exact words, the same way an agent searches. Send collectionIds to search only some collections; leave it out to search all of them. Each passage says which collection and document it comes from. Read only and safe to repeat: it changes nothing. An empty data list means nothing answers it. 404 not_found when a collection does not exist or belongs to another organization; 503 service_unavailable when the search cannot run right now.
Required scope: knowledge:read.
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Idempotency-KeyMakes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.
Search the knowledge › Request Body
queryWhat you are looking for, in your own words. It searches by meaning and by exact words (a product code, a name).
collectionIdsSearch only these collections. Leave it out to search all of them.
limitHow many passages to return, best first.
Search the knowledge › Responses
objectBest first. An empty list means nothing in the knowledge answers it.
Retrieve a collection
Returns one knowledge collection by id. Use it to refresh a single record you already know; to find records, use the list route. Its documents are listed on their own route. Read only. 404 not_found when the id does not exist or belongs to another organization. You can repeat it safely: it has no side effects.
Required scope: knowledge:read.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Retrieve a collection › Responses
objectidnamedescriptiondocumentCountDocuments in any status.
createdAtupdatedAtDelete a collection
Deletes its documents and removes the collection from every agent that had it. Answers 409 resource_in_use while a connected source feeds it.
Required scope: knowledge:write.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Delete a collection › Responses
Deleted.
Update a collection
Changes only what you send.
Required scope: knowledge:write.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Update a collection › Request Body optional
name\Sdescriptionnull clears it.
Update a collection › Responses
objectidnamedescriptiondocumentCountDocuments in any status.
createdAtupdatedAtList documents
Newest first, without the content.
Required scope: knowledge:read.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
query Parameters
limitcursorThe nextCursor of the previous page, with the same filters.
statusHeaders
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
List documents › Responses
objecthasMorenextCursorAdd a document
Send text as JSON or a file as multipart. It starts as processing; listen for knowledge_document.ready and knowledge_document.failed. Sending the same name again replaces the document and processes it again.
Required scope: knowledge:write.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Idempotency-KeyMakes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.
Add a document › Request Body optional
name\SRequired with text. With a file it defaults to the file name. The same name in a collection replaces the document.
text\SThe content as text. Send either text or a file, not both.
fileMultipart only. PDF, DOCX, TXT or MD, up to 15 MB. Send either a file or text.
Add a document › Responses
objectidcollectionIdnamemimeTypesizeBytesstatuschunkCountSearchable passages.
Set when status is failed.
createdAtupdatedAtRetrieve a document
Includes the content the agent searches once the status is ready. A failed document carries error.code.
Required scope: knowledge:read.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
docId^kbd_[0-9A-Za-z]{22}… · requiredThe id of the knowledge document (kbd_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Retrieve a document › Responses
objectidcollectionIdnamemimeTypesizeBytesstatuschunkCountSearchable passages.
Set when status is failed.
createdAtupdatedAtcontentThe text the agent searches. null until status is ready.
Delete a document
The agent stops finding it right away. Documents kept by a connected source answer 409 resource_in_use.
Required scope: knowledge:write.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
docId^kbd_[0-9A-Za-z]{22}… · requiredThe id of the knowledge document (kbd_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Delete a document › Responses
Deleted.
Update a document
Rename it or replace its text. New text processes the document again. Documents kept by a connected source answer 409 resource_in_use.
Required scope: knowledge:write.
path Parameters
id^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
docId^kbd_[0-9A-Za-z]{22}… · requiredThe id of the knowledge document (kbd_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Update a document › Request Body optional
name\Stext\SReplaces the content and processes the document again: status goes back to processing.
Update a document › Responses
objectidcollectionIdnamemimeTypesizeBytesstatuschunkCountSearchable passages.
Set when status is failed.
createdAtupdatedAtLet an agent search a collection
Safe to repeat. The agent uses the collection from its next answer.
Required scope: knowledge:write.
path Parameters
id^agt_[0-9A-Za-z]{22}… · requiredThe id of the agent (agt_…).
collectionId^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Let an agent search a collection › Responses
objectagentIdcollectionIdgrantedStop an agent from searching a collection
Safe to repeat: answers 204 even if the agent did not have it.
Required scope: knowledge:write.
path Parameters
id^agt_[0-9A-Za-z]{22}… · requiredThe id of the agent (agt_…).
collectionId^kbc_[0-9A-Za-z]{22}… · requiredThe id of the knowledge collection (kbc_…).
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Stop an agent from searching a collection › Responses
Removed.