Upload a file to the knowledge base
POST
/assistants /{id} /knowledge /uploadsA PDF or an image. Returns the document and a link to upload the file to.
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 characterscontent_typeenum (5 values)requiredFormat of the file. A .txt or .md file is a text document: send its text to
POST /instead.assistants/ {id}/ knowledge Possible values
"application/pdf""image/jpeg""image/png""image/webp""image/heic"size_bytesintegerrequiredExact size of the file: the upload link only accepts it.
> 0
Response
200documentobjectupload_urlstringSigned link to PUT the file to, valid 5 minutes.
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.