files_upload
Upload a file to DialogBrain and get a file_id for use in messages_send.
When to use:
User wants to send a file/image to a contact
Before calling messages_send with an attachment
For a file that already exists on disk, use files_create_upload_url instead: content here travels through the conversation twice (once read, once written back), so it is only sensible up to about 50 KB. source_url is fine at any size — the fetch happens server-side.
Returns: file_id (integer) to pass to messages_send attachments parameter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Optional display title | |
| content | No | Base64-encoded file bytes. Suitable up to ~50 KB — above that the encoded bytes cost more context than the task; use files_create_upload_url for a local file, or source_url for a remote one. Either content OR source_url is required. | |
| filename | No | Filename with extension (e.g. 'photo.png') | upload |
| mime_type | No | MIME type (e.g. 'image/png', 'application/pdf') | application/octet-stream |
| source_url | No | Public URL to fetch file from. Either content OR source_url is required. | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |