Skip to content

Upload File

Request

Upload a source file for knowledge processing. The API returns a fileId and fileUrl that can be referenced by a knowledge-processing task.

Supported file types:

  • PDF: application/pdf
  • Word: application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • Excel: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel
  • TXT: text/plain
  • Markdown: text/markdown, text/mdx
  • HTML: text/html
  • CSV: text/csv

Limits:

  • Maximum file size: 15 MB
  • Maximum file-name length: 256 characters
Security
bearerAuth
Bodymultipart/form-datarequired
filestring, (binary)required

File to upload (binary stream).

purposestring

File purpose

Default:"knowledge"
Value:"knowledge"
fileNamestring, <= 256 characters

Custom file name. If omitted, the original file name is used.

curl -i -X POST \
  https://threechatai.redocly.app/_mock/apis/3chat-api/api/open/v4/butler/files \
  -H 'Authorization: Bearer <YOUR_Access Token_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F file=string \
  -F purpose=knowledge \
  -F fileName=string

Responses

Upload successful

Headers
any
Bodyapplication/json
codeinteger

Status code

Example:200
messagestring

Status message

Example:"success"
dataobject
Response
{ "code": 200, "message": "success", "data": { "fileId": "0d4e6d3c-4687-4cd8-95b7-2006565c66c2", "fileName": "test-file.md", "mimeType": "text/markdown", "sizeBytes": 2344, "purpose": "knowledge", "fileUrl": "https://files.example.com/knowledge/example.md", "sha256": "a5450fbff557fef5dc28266e28268823a75a47b228707e5b1a77039ab2a24f5e", "createdAt": 1778208611781 } }