> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Add attachment

> Add one small file to an Outlook draft.

`addAttachment` attaches a file directly to an unsent Outlook draft.

```ts automations/add-outlook-attachment.automation.ts theme={null}
import { automation } from "automate.ax"
import { addAttachment, draftEmail } from "automate.ax/outlook"

export default automation("Attach Outlook report", () => {
  const draft = draftEmail({
    to: "reader@example.com",
    subject: "Report",
    body: "Attached.",
  })
  addAttachment({
    messageId: draft.messageId,
    file: new File(["report"], "report.txt", { type: "text/plain" }),
  })
})
```

`messageId` and `file: File` are required. Optional `inline` defaults to false;
`contentId` identifies an inline file referenced by HTML. Optional `account`
selects the binding.

The file must be no larger than 3,000,000 bytes. Larger Outlook attachments
require an upload-session flow that this action does not expose. Returns the
created normalized attachment, including its new `attachmentId` and decoded
file data when Graph echoes it.
