Upload Call Flow Knowledge File
Upload a file to storage so it can be attached to a call flow.
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-idstringrequiredWorkspace identifier for the API.
Request Body
Send the file as multipart/form-data.
filefilerequiredThe 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:
filenamestringThe uploaded file's name.
keystringA file key of the form knowledge-base/<workspaceId>/<timestamp>-<filename>.
urlstringThe stored file's URL.
Errors
| Status | Body | When |
|---|---|---|
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 |
{
"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