Upload attachment chunk
upload_attachment_chunkSend the next base64 chunk for a staged attachment upload, strictly in index order, to continue building the file before finishing. Returns received bytes and the next chunk index to send.
Instructions
Append the next base64 chunk to an attachment upload, strictly in index order. This is step 2 of 3, repeated until every byte declared to begin_attachment_upload has been sent, then closed with finish_attachment_upload. A chunk that is empty, not valid base64, larger than the max_chunk_bytes begin_attachment_upload reported, out of order, or past the declared total size is refused without being stored; the upload stays open at its current position, so retry that same index rather than restarting. It returns received_bytes, expected_bytes, and the next_chunk index to send.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload_id | Yes | The upload_id begin_attachment_upload returned for this file. It identifies the staged upload only and is not the attachment token a draft accepts. | |
| chunk_index | Yes | Zero-based position of this chunk: 0 for the first, then the next_chunk value the previous call returned. Gaps and replays are refused, so the staged bytes can only be the declared file, in order. | |
| data_base64 | Yes | This chunk's bytes, base64-encoded. The decoded length must not exceed the max_chunk_bytes begin_attachment_upload reported, 384 KiB by default. Send encoded bytes only: this is never a path and never a data URL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||