Upload a knowledge file
upload_knowledgeGive the identity's hosted phone agent a document to answer callers from: PDF, DOCX, plain text, Markdown, CSV or HTML, at most 20 MB. Send the file as upload_id (preferred: prepare_upload, then PUT the file from your shell so its bytes never pass through your context) or as content_base64 for a tiny file. The type is detected from the bytes; the text is extracted here and stored with the voice service. Only upload information the owner would tell any caller: a released reply cannot be retracted. Limits: 5 files and 25,000 tokens of extracted text (about 40 pages) per identity. Uploading the same document again returns the stored file with deduplicated true (nothing new is stored). warnings lists filename_type_mismatch when the file name's extension does not match the detected type (the detected type is stored). A truncated or corrupt document is refused, never stored partly. Takes effect on the next call. Returns metadata only; do not repeat the base64 back to the user. The extracted text is screened on save like the hosted prompt: high-risk content (scam, impersonation of a bank, government body or utility, collections abuse, deception) is refused hosted_content_rejected with the reason and not stored; borderline content is accepted and reviewed (screening in the result).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"identity_id": "<identity_id>"
},
"name": "upload_knowledge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | The file name with its extension (required with content_base64; used to tell Markdown, CSV and HTML from plain text). | |
| upload_id | No | A received upload from prepare_upload (purpose knowledge); its prepared filename is used unless filename is given. Use this or content_base64, not both. | |
| identity_id | Yes | Identity id from list_identities. | |
| content_base64 | No | Base64 of the document bytes, for tiny files only; prefer upload_id. |