Export a Google Workspace file
export_fileExport Google Docs, Sheets, Slides, or Drawings to PDF, DOCX, CSV, Markdown, or other formats. Provide the file ID and target MIME type; optionally save to a local path.
Instructions
Exports (converts) a Google-native file — Doc, Sheet, Slides, Drawing — to a regular format. mime_type picks the target: Docs → text/markdown, text/plain, text/html, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document (.docx), application/rtf; Sheets → text/csv (FIRST sheet only), application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (.xlsx); Slides → application/pdf, text/plain, application/vnd.openxmlformats-officedocument.presentationml.presentation (.pptx); Drawings → image/png, image/svg+xml, application/pdf. With save_path the result is written to disk; without it small textual exports (≤100 KB) come back inline as content. Export is capped at 10 MB by the API — use the file's exportLinks (get_file) for bigger documents. Binary (non-Google) files are not exportable — use download_file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | The file id — the long id from the Drive URL (drive.google.com/file/d/<fileId> or docs.google.com/.../d/<fileId>/edit) or from search_files/get_file output. Folders and shared-drive items are files too. | |
| mime_type | Yes | Target format, e.g. text/markdown, text/csv, application/pdf (see the description for what each Google type supports). | |
| overwrite | No | Replace save_path if it already exists (default false). | |
| save_path | No | Absolute local path to write the export to (required for binary or >100 KB output). |