Trillet AI logo

Upload Call Flow Knowledge File

Upload a file to storage so it can be attached to a call flow.

POSThttps://api.trillet.ai/v1/api/call-flows/knowledge-base/upload

This is the older way to give a call flow documents. For new integrations, use the Knowledge Base API and add the knowledge base's ID to the flow's settings.knowledgeBases.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

Send the file as multipart/form-data.

filefilerequired

The knowledge file to upload. One file per request. The file's content type must be one of application/pdf, text/plain, application/vnd.openxmlformats-officedocument.wordprocessingml.document (DOCX) or text/markdown. The type is checked, not the file extension, so a .md file sent as application/octet-stream is refused. The upload limit is 600,000,000 bytes.

Attaching the file to a flow

The upload only stores the file. It is not attached to any call flow, and the path does not include a flow ID. To attach it, add the returned object to the flow's settings.knowledgeBaseFiles with Update Call Flow. knowledgeBaseFiles is an array, and arrays replace the stored list, so send the files the flow already has plus the new one:

{
  "settings": {
    "knowledgeBaseFiles": [
      { "filename": "pricing.pdf", "key": "knowledge-base/c1c1c1c1c1c1c1c1c1c1c1c1/1736953200000-pricing.pdf", "url": "https://..." }
    ]
  }
}

Response Fields

200 OK with:

filenamestring

The uploaded file's name.

keystring

A file key of the form knowledge-base/<workspaceId>/<timestamp>-<filename>.

urlstring

The stored file's URL.

Errors

StatusBodyWhen
400{"message": "No file uploaded"}The request has no file
400{"message": "Invalid file type. Only PDF, TXT, DOCX, and MD files are allowed."}The file's content type is not one of the four above
500{"message": "..."}The upload failed
200 OK
{
  "filename": "pricing.pdf",
  "key": "knowledge-base/c1c1c1c1c1c1c1c1c1c1c1c1/1736953200000-pricing.pdf",
  "url": "https://example-bucket.s3.amazonaws.com/pathways/knowledge-base/c1c1c1c1c1c1c1c1c1c1c1c1/1736953200000-pricing.pdf/kb/1736953200001-pricing.pdf"
}

Last updated on