/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/attachments/{position}AuthStream a single attachment by its position. Gated by `mail.message.body.read`: an attachment is message content, and /:mid already names it without handing over the bytes.
Path parameters
workspace_id*string · uuidId of the workspace.
id*string · uuidId of the mailboxe.
mid*string · uuidId of the message in the mailbox.
position*numberPosition of the attachment in the message, starting at 0.
Response · 200
Binary attachment stream. `Content-Type` reflects the stored attachment media type; `Content-Disposition: attachment`.
Example
Request
GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/mailboxes/{id}/messages/{mid}/attachments/{position}
Authorization: Bearer YOUR_TOKENimport { Mail } from "@productcraft/mail";
// Reads PRODUCTCRAFT_API_KEY from the environment
const mail = new Mail();
const response = await mail.mailboxes.messages.attachments.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "0");
const text = await response.text();mail.mailboxes.messages.attachments.retrieve(mailboxId, messageId, position, options?): Response