Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryModelOptionalExpand 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
bodyobjectRequired within parentAdditional keys: not allowed
body.metadataModelRequired within parentExpand 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
body.fileobjectRequired within parentAdditional keys: not allowed
body.file.filenamestringRequired within parentMinimum length: 1
body.file.content_typestringRequired within parent
body.file.content_base64stringRequired within parentEncoding: base64

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 media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand 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) — response body

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) — response body

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.