Skip to content
Assistants

Upload a file to the knowledge base

POST/assistants/{id}/knowledge/uploads

A PDF or an image. Returns the document and a link to upload the file to.

Path parameters

Request body

  • titlestringrequired

    Name of the document, unique per assistant. Shown to the agent with each passage it finds.

    Example "Biens en vente"1 to 200 characters

  • content_typeenum (5 values)required

    Format of the file. A .txt or .md file is a text document: send its text to POST /assistants/{id}/knowledge instead.

    Possible values"application/pdf""image/jpeg""image/png""image/webp""image/heic"

  • size_bytesintegerrequired

    Exact size of the file: the upload link only accepts it.

    > 0

Response

200
  • documentobject
  • upload_urlstring

    Signed 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.