Capability Sources

Prepare a resumable Google Drive upload, or a replacement of an existing file's content, for a client with local file transport

Changed on

Prepare a Google Drive resumable upload session for an explicitly requested file upload. This does not upload bytes or prove completion. Clients with file transport can PUT local bytes directly to the returned secret uploadUrl, outside model context. With fileId the upload replaces that file's content as a new Drive version; with convertTo a new Office file becomes a native Google file. Google sessions can remain valid for up to one week; they are not short-lived signed URLs. Do not automatically create another session after an uncertain result. Final PUT returns file metadata, including headRevisionId and md5Checksum for later replaces. Uses the selected connection.

post/v1/capabilities/google-workspace/drive-upload-sessions

Request

  • Base URL: https://api.openworklabs.com
  • URL: https://api.openworklabs.com/v1/capabilities/google-workspace/drive-upload-sessions
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Request body

namestring required

File basename; no file bytes or local paths. Ignored when replacing a file.

sizeinteger required

Exact file size in bytes, up to Google's 5 TiB limit.

mimeTypestring
folderIdstring
fileIdstring

Replace this existing file's content instead of creating a file. It keeps its ID, link, sharing and comments; the previous version stays in Drive's version history for 30 days.

baseRevisionstring

Required with fileId: the revision your copy was downloaded from. Refused with drive_conflict when Drive changed since; download the newer version and reapply the edits, or save a new file.

convertTo'application/vnd.google-apps.spreadsheet' | 'application/vnd.google-apps.document' | 'application/vnd.google-apps.presentation'

New files only: save the uploaded Office file as this native Google Docs, Sheets or Slides type.

Response

Secret upload session; file not yet uploaded.

oktrue required
uploadUrlstring uri required

Secret bearer upload-session URL. Never print, share, persist, or log it. Only upload the authorized file; no Google access token is needed.

method'PUT' required
sizeinteger required
chunkSize8388608 required
instructionsstring required

Changes

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added subschema #2 to the response body anyOf list for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      removed the non-success response with the status