Add a text to the knowledge base
POST
/assistants /{id} /knowledgeA text written or pasted, or the content of a .txt or .md file.
Path parameters
idstringrequiredID of the assistant, as returned by
GET /assistants.
Request body
application/jsontitlestringrequiredName of the document, unique per assistant. Shown to the agent with each passage it finds.
Example
"Biens en vente"1 to 200 characterscontentstringrequiredThe text, plain or markdown. Headings and list items are kept together when it is split for search: one listing per list item finds best.
Example
"## Toulon\n\n- Appartement · 65 m² · 289 000 € (réf. 1234)\n - Le Mourillon, 3 pièces avec terrasse"1 to 500000 characters
Response
200documentobject
Errors
- 400Invalid request: a field or parameter failed validation
{ "message"?: string, "error"?: string, "bodyErrors"?: {…} } - 404Not found in your organization
{ "message"?: string, "error"?: string, "bodyErrors"?: {…} }
Error bodies carry an error (or message) string; a 400 adds bodyErrors.issues. See Errors.