> ## 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.

# Get task file download

> Get a short-lived link that downloads one of a task's files.

Returns a signed link to the original bytes of a file on the task. It works like [Get file download](https://wordsmithai.mintlify.site/api-reference/files/get-file-download.md), but needs only the `tasks:read` scope, and only for files the task lists.

Download the file with a plain `GET` to `url` and **no** `Authorization` header. The URL is already signed, and the storage host refuses a request that carries your API key. The link lasts at most 5 minutes, until `expires_at`, so fetch it straight away. Call this endpoint again for a fresh link.

To give a person a link, use `web_url` instead. It opens in a browser, asks for Wordsmith sign-in, and does not expire.

A file is served only once its malware scan is clean. While the scan is still running, the response is `409 scan_in_progress`; retry shortly. A file the scan flagged returns `404`.

## 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 the file is on. Accepts a display id like `#12` or the task's UUID.

**file\_id** `string (uuid)` *required*

An `id` from the task's `input_files` or `output_files`, or from a comment's or thread message's `file_ids`. Attaching stores a copy with a new id, so the id you attached is not on the task.

## Response

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

The file's id.

**url** `string`

The signed download link. Fetch it without an `Authorization` header.

**web\_url** `string`

A link for people. It downloads the file in a browser after Wordsmith sign-in, does not expire, and checks the signed-in user's access on every click.

**file\_name** `string | null`

The file's name.

**content\_type** `string | null`

The file's MIME type.

**expires\_at** `string`

When `url` stops working. ISO 8601 UTC, at most 5 minutes after the request.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Get the link
curl "https://api.wordsmith.ai/api/v1/tasks/9f8e7d6c-5b4a-3210-9876-543210fedcba/files/7c9e6679-7425-40de-944b-e07fc1f90ae7/download" \
  -H "Authorization: Bearer sk-ws-api1-your_api_key_here"

# Download the file, with no Authorization header
curl -o nda.docx "URL_FROM_THE_RESPONSE"
```

```json Response theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "file_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "url": "https://wordsmith-files.s3.eu-west-1.amazonaws.com/a83f5c27-1e94-4b6d-8c02-d7e19b4f6a35?X-Amz-Signature=...",
  "web_url": "https://app.wordsmith.ai/files/7c9e6679-7425-40de-944b-e07fc1f90ae7/download",
  "file_name": "Supplier NDA.docx",
  "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "expires_at": "2026-11-09T11:05:41.318204Z"
}
```

## 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, the task does not list the file, or the file's malware scan flagged it. |
| 409 | `scan_in_progress` | The file's malware scan has not finished. Retry shortly. |


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