Upload File
upload_fileUpload a binary file (xlsx, pdf, docx, png, etc.) to Drive from base64-encoded content. Use this when you have file bytes from the conversation (e.g. an attached spreadsheet) and need to put them in the user's Drive. Set convert=true to have Drive convert Office formats to native Google formats during upload. Maximum 20MB decoded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Filename including extension (e.g. 'workout-plan.xlsx') | |
| account | No | Which connected Google account to create in, by its address, when the user has more than one — see get_status connections. Omit for the primary account. | |
| convert | No | If true and the source is convertible (.xlsx → Sheets .docx → Docs .pptx → Slides .pdf/.csv → matching native), Drive converts during upload. If false (default) the file is stored as-is. | |
| mime_type | Yes | The source file's MIME type. Examples: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' for .xlsx 'application/pdf' for .pdf 'image/png' for .png | |
| content_base64 | Yes | The file bytes encoded as base64. Maximum decoded size 20MB. | |
| parent_folder_id | No | Optional folder ID to upload into. Defaults to the user's default folder if one is set. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| url | Yes | ||
| account | No | the Google account the file was created in; present only when more than one is connected |