Begin attachment upload
begin_attachment_uploadStarts staging an attachment upload by validating filename, MIME type, size, and SHA-256 checksum; returns upload parameters and expires if abandoned, so no bytes reach a draft until later steps.
Instructions
Start staging one outgoing attachment. This is step 1 of 3: begin_attachment_upload, then upload_attachment_chunk for every chunk in order, then finish_attachment_upload, which returns the token create_confirmed_draft accepts. Call it only for a file the user asked to attach, with bytes the client already holds: it takes a filename, never a local path, and never reads the filesystem. It returns upload_id, the max_chunk_bytes to size chunks by, and expires_at; nothing reaches a draft until the step 3 token is used, and an abandoned upload expires on its own. Allowed types are PDF, DOCX, XLSX, PPTX, TXT, CSV, PNG, and JPEG: any other extension, a content_type that contradicts it, or an oversized declaration is refused here, before a single byte is sent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Base name the recipient will see, such as report.pdf, never a path: a value containing a directory separator is refused. Its extension selects the allowed type and must agree with content_type. | |
| sha256_hex | Yes | SHA-256 of the complete decoded file as 64 hexadecimal characters, in either case. It is re-computed at step 3 and again when the draft is created, so staged bytes that changed in between are refused instead of being attached. | |
| size_bytes | Yes | Exact total byte length of the decoded file, declared up front so the staged size is verified at step 3. A chunk that would exceed it is refused, and a final total that differs fails the upload. | |
| content_type | Yes | MIME type of the bytes, which must be the canonical type for the filename extension, or application/octet-stream to let the extension decide. A type that contradicts the extension is refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||