# SourceOutlook-Output

Read emails from an Outlook mailbox folder and save their file
attachments, bodies or fields into a folder — or, with
`extract=fields_table`, their fields as rows of a spreadsheet.

Must be the only source, with no processors and exactly one destination: a
`folder`, or a `file` for `fields_table` — see validate_outlook_automation.

Type: object

Fields typed as another model are documented on that model's page; fetch it before filling the field.

| Field | Type | Required | Description | Allowed values / default / constraints |
| --- | --- | --- | --- | --- |
| `type` | string | yes | Marks this source as **Outlook**: emails from a mailbox folder, saved as files into a folder destination. | const: `"outlook"` |
| `account` | [OutlookAccount](https://api.sheetgo.com/rest/reference/models/OutlookAccount.md) | no | `personal` (a personal Microsoft account) or `work` (work or school). It must be connected in Sheetgo with permission to read mail (412 `outlook_not_connected` otherwise). | default: `"personal"` |
| `mailbox` | [OutlookMailbox](https://api.sheetgo.com/rest/reference/models/OutlookMailbox.md) | no | `inbox`, `archive` or `sent_items`. | default: `"inbox"` |
| `extract` | [OutlookExtract](https://api.sheetgo.com/rest/reference/models/OutlookExtract.md) | no | `attachments` saves each email's file attachments into a folder; `body` saves each email's body as `<subject>.html`; `fields` saves that body with the message's date, from, to, cc, bcc, subject, attachment names, Message-ID and labels above it. `fields_table` writes those same fields to a SPREADSHEET instead — one row per email, with the body as plain text and as HTML, the columns chosen with `columns` — and so needs a `file` destination (gsheets, xlsx or csv) rather than a `folder`. That destination always appends: each run adds the emails that arrived since the previous one, and a large mailbox is copied over several runs. Cells are written as plain values, so a subject or body starting with `=` is never run as a formula. | default: `"attachments"` |
| `process_once` | boolean | no | Skip emails already saved by an earlier run. Always on for `fields_table`, whatever is sent: the sheet appends, so each run adds only the emails not exported yet. | default: `true` |
| `email_filter` | [EmailFilter-Output](https://api.sheetgo.com/rest/reference/models/EmailFilter-Output.md), nullable | no | Only read the emails that match these conditions. Omit to read every email (each run scans at most 1000). |  |
| `columns` | array of [EmailColumn](https://api.sheetgo.com/rest/reference/models/EmailColumn.md), nullable | no | With `extract=fields_table`, the columns the sheet gets: any of `date`, `from`, `to`, `cc`, `bcc`, `subject`, `body`, `body_html`, `attachments`, `message_id`, `labels`. `date` is always among them, sent or not: every row carries its email's date. They are written in that order, whatever order they are sent in. Omit for every column. Refused with any other extract mode. | min items: 1 |
| `name` | string, nullable | no | Label for the source. Defaults to `Outlook`. |  |

## Used by

- [GET /rest/beta/automations/](https://api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations)
- [GET /rest/beta/automations/{id}](https://api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations-id)
- [GET /rest/beta/workflows/](https://api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows)
- [GET /rest/beta/workflows/{id}](https://api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows-id)
- [PATCH /rest/beta/automations/{id}](https://api.sheetgo.com/rest/reference/automations.md#patch-rest-beta-automations-id)
- [PATCH /rest/beta/workflows/{id}](https://api.sheetgo.com/rest/reference/workflows.md#patch-rest-beta-workflows-id)
- [POST /rest/beta/automations/](https://api.sheetgo.com/rest/reference/automations.md#post-rest-beta-automations)
- [POST /rest/beta/workflows/](https://api.sheetgo.com/rest/reference/workflows.md#post-rest-beta-workflows)
- [PUT /rest/beta/automations/{id}](https://api.sheetgo.com/rest/reference/automations.md#put-rest-beta-automations-id)
- [AutomationModel](https://api.sheetgo.com/rest/reference/models/AutomationModel.md)
- [WorkflowAutomationModel](https://api.sheetgo.com/rest/reference/models/WorkflowAutomationModel.md)

---

More: start page https://api.sheetgo.com/rest/reference.md, everything in one file https://api.sheetgo.com/rest/llms-full.txt, OpenAPI https://api.sheetgo.com/rest/openapi.json.
