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

# flows.tasks.new_attached_document

> Fired when attachments are added to a Chamelio Flows task through the API, the web application, or an inbound email to the task's address.

## Event

```
flows.tasks.new_attached_document
```

This event fires when attachments are added to a task - through the [Add Task Attachments](https://docs.chamelio.ai/api-reference/endpoint/tasks/attachments.md) API, from the Chamelio web application, or when a document arrives on the task by email.

## Payload Example

```json theme={null}
{
  "event": "flows.tasks.new_attached_document",
  "event_id": "3f7c1a8e-5b2d-4e9a-9c31-8a6f0d4b7e12",
  "organization_id": 42,
  "user_id": 1337,
  "payload_version": 1,
  "timestamp": "2026-09-02T14:32:00Z",
  "data": {
    "workflow_id": "wf_contract_review",
    "workflow_state_id": "ws_9f2a41c8",
    "task_id": 12345,
    "attachment_ids": [
      4471,
      4472
    ],
    "intake_channels": [
      "email"
    ]
  }
}
```

## Payload Fields

### Envelope

| Field | Type | Description |
| - | - | - |
| `event` | string | Always `flows.tasks.new_attached_document` |
| `event_id` | string | UUID for this delivery. Use it to deduplicate retries |
| `organization_id` | integer | ID of the organization the event occurred in |
| `user_id` | integer or null | ID of the user who added the attachments |
| `payload_version` | integer | Envelope schema version. Currently `1` |
| `timestamp` | string | ISO 8601 UTC timestamp of when the event was generated |
| `data` | object | Event-specific payload (see below) |

### Data Object

| Field | Type | Description |
| - | - | - |
| `workflow_id` | string | ID of the parent workflow |
| `workflow_state_id` | string | ID of this particular workflow run |
| `task_id` | integer | ID of the task the attachments were added to |
| `attachment_ids` | array of integers | IDs of the attachments added by this action |
| `intake_channels` | array of strings | Channel the task was intaken through |

> [!NOTE]
>
> This event is only emitted for workflow runs that have a task. A workflow state
> without a `task_id` produces no webhook.

> [!NOTE]
>
> `intake_channels` is derived from the run's first step when that step is an intake step, so it
> contains at most one channel. It is an empty array for workflows that do not begin with an intake
> step.

> [!NOTE]
>
> One event covers a whole add-attachments action, so `attachment_ids` can hold several IDs. A request
> that uploads three files produces one event listing three IDs, not three events.
