Requirements
Create the key in TeamAI: open the agent, go to Channels, select Website, and use Create key under Website embed keys. Each agent can have two keys. The key is publishable: it is safe in frontend code and only lets this agent request temporary upload URLs. It cannot call other workspace APIs.Upload and ask
uploadBlob() uploads the file, attaches it to the chat, and resolves with the upload record. Send a message afterwards to have the agent use it.
uploadBlob() after the agent is ready. Before that there is no iframe to perform the upload and the Promise rejects with “Chatbot iframe is not initialized”.
Blob | File
required
The file content. Set
type to the MIME type; the stored file’s extension is derived from it.Supported file types
CSV is the format the data-analysis features are built around. The upload path also accepts images and PDFs. The stored object’s extension comes from the MIME type:
Any MIME type not in the table is stored with a
.csv extension. Test non-CSV files against your agent before relying on them, since what the agent can do with an image or PDF depends on the agent’s configuration.
The upload record
Duplicate uploads are cached
The SDK hashes the blob’s content (SHA-256), size, and MIME type. If the same file was uploaded from this browser within 30 days, it re-attaches the stored file instead of uploading again and resolves with the cached record. The cache lives inlocalStorage under teamai-uploads-YOUR_ASSISTANT_ID.
chatbot.clearUploadCache()forgets every cached upload for the assistant.chatbot.clearExpiredUploads()drops entries older than 30 days. The SDK also does this on load.tai.destroyInstance()clears the cache as part of teardown.
Errors
uploadBlob() rejects with an Error whose message is one of: