Google: Upload file content and metadata Creates a file For more information, see Create and manage files (https: developers google com workspace drive api guides create-file) This method supports an * upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:* `* *` (Specify a valid MIME type, rather than the literal `* *` value The literal `* *` is only used to indicate that any valid MIME type can be uploaded For more information, see Google Workspace and Google Drive supported MIME types (https: developers google com workspace drive api guides mime-types) ) For more information on uploading files, see Upload file data (https: developers google com workspace drive api guides manage-uploads) Apps creating shortcuts with the `create` method must specify the MIME type `application vnd google-apps shortcut` Apps should specify a file extension in the `name` property when inserting files with the API For example, an operation to insert a JPEG file should specify something like `"name": "cat jpg"` in the metadata Subsequent `GET` requests include the read-only `file Extension` property populated with the extension originally specified in the `name` property When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the name In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type
Google driveFiles.driveFilesCreateUpload: arguments, response, policy and SDK examples.
← drive_files operations · Get started · OpenAPI downloads
Contract 2026-10-27 · Operation google.drive_files_createupload
Provider route: POST /upload/drive/v3/files. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/google with npm, or alter-sdk-google with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GoogleIntegration } from "@alter-ai/google";
async function execute(input: Parameters<GoogleIntegration["driveFiles"]["driveFilesCreateUpload"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GoogleIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.driveFiles.driveFilesCreateUpload(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_google import GoogleIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GoogleIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.drive_files.drive_files_create_upload(arguments) result = await call.wait() return result.body_json()Referenced models: Creates a copy of a file and applies any requested updates with patch semantics For more information, see Create and manage files (https: developers google com workspace drive api guides create-file) — request body — body, Creates a file. For more information, see [Create and manage files](https://developers.google.com/workspace/drive/api/guides/create-file). This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: `* ` (Specify a valid MIME type, rather than the literal ` ` value The literal ` *` is only used to indicate that any valid MIME type can be uploaded For more information, see Google Workspace and Google Drive supported MIME types (https: developers google com workspace drive api guides mime-types) ) For more information on uploading files, see Upload file data (https: developers google com workspace drive api guides manage-uploads) Apps creating shortcuts with the `create` method must specify the MIME type `application vnd google-apps shortcut` Apps should specify a file extension in the `name` property when inserting files with the API For example, an operation to insert a JPEG file should specify something like `“name”: “cat jpg”` in the metadata Subsequent `GET` requests include the read-only `file Extension` property populated with the extension originally specified in the `name` property When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the name In cases where the extension is missing, Drive attempts to determine the extension based on the file’s MIME type — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: google.drive_files_createupload. Catalog operation: drive.files.createUpload. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.appdata", "https://www.googleapis.com/auth/drive.file"]
Pinned query parameters: {"uploadType": "multipart"}