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

# List task files

> List every file attached to a task.

Returns the task's files, split the way the task splits them:

* `input_files` are files people or integrations attached, including attachments that arrived by email or chat with the request.
* `output_files` are files the task produced, such as an agent's drafts.

Files added to a comment or a [thread](https://wordsmithai.mintlify.site/api-reference/tasks/list-thread.md) message are copied onto the task. The ids in their `file_ids` normally appear here too.

To read a file, pass its `id` to [Get task file text](https://wordsmithai.mintlify.site/api-reference/tasks/get-file-text.md) or [Get task file download](https://wordsmithai.mintlify.site/api-reference/tasks/get-file-download.md).

## Authentication

Send an API key, or an OAuth access token with the `tasks:read` scope, as a bearer token in the `Authorization` header.

## Path parameters

**task\_id** `string` *required*

The task to read. Accepts a display id like `#12` or the task's UUID.

## Response

**task\_id** `string (uuid)`

The task's id.

**input\_files** `object[]`

Files attached to the task. Each has `id`, `file_name`, `content_type`, `content_length` and `sensitivity_label`.

**output\_files** `object[]`

Files the task produced, in the same shape as `input_files`.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/files" \
  -H "Authorization: Bearer sk-ws-api1-your_api_key_here"
```

```json Response theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "task_id": "9f8e7d6c-5b4a-3210-9876-543210fedcba",
  "input_files": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "file_name": "Supplier NDA.docx",
      "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "content_length": 48213,
      "sensitivity_label": null
    }
  ],
  "output_files": [
    {
      "id": "3f2a1b0c-9d8e-4f7a-8b6c-5d4e3f2a1b0c",
      "file_name": "Supplier NDA - redline.docx",
      "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "content_length": 51877,
      "sensitivity_label": null
    }
  ]
}
```

## Errors

See [Errors](https://wordsmithai.mintlify.site/errors.md) for the error format.

| HTTP Status | Error Code | When |
| - | - | - |
| 401 | `unauthorized` | The API key is missing or invalid. |
| 404 | `resource_not_found` | The task does not exist or you cannot read it. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.