MailMasker API
Claude Code
Drive

Send a piece of a big upload

PATCH/api/v1/drive/uploads/:id

Who can use this: Any signed-in accountAs Markdown

The body is the raw bytes of the piece, not JSON, and an Upload-Offset header says where in the file the piece starts, which must be exactly how much Drive already has. The answer's offset is where the next piece starts. When the last byte lands, done is true and file_id is the new file.

Parameters

NameWhereWhat it is
id required path The upload_id from Start a big upload.e.g. 0b6f3c1e-8d2a-4f7b-9e5c-3a1d2b4c6e8f
chunk required body The next piece of the file, as the whole raw request body (send it as application/octet-stream), with an Upload-Offset header giving the byte it starts at.

Good to know

  • A missing or malformed Upload-Offset header answers 400.
  • A piece that doesn't start where Drive's copy ends answers 409 with the true offset, so carry on from there. That is how a resend after a dropped connection sorts itself out.
  • A piece that would run past the size you declared answers 409 too, and so does one sent to a finished upload, whose answer includes its file_id.