# intake.fromMail

File an attachment of an email in the workspace's mail (messageId, evidenceId, idempotencyKey) through universal intake: it becomes an uploaded file like a dropped one, ready for intake.classify and intake.process, and remembers the email it came from. Attachments of mail held for an administrator (quarantined, or holding sign-in or security details) can't be filed. The same file already added returns that upload with duplicate: true.

`POST /api/v1/accounting/intake.fromMail`

Permissions: `accounting:read`, `accounting:write`, `mail:read` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_intake_from_mail`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `messageId` | string (ID) | Yes | The ID of the related record. |
| `evidenceId` | string (ID) | Yes | The ID of the related record. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/intake.fromMail \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "messageId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "evidenceId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}'
```

Reference page: https://app.getoatmilk.com/docs/api/intake.fromMail
