## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://dev.writer.com/llms.txt)

Use this file to discover all available pages before exploring further.

### cURL

```
curl --location --request GET https://api.writer.com/v1/files/{file_id}/download \
 --header "Authorization: Bearer <token>"
```

### Python Example

```
import os
from writerai import Writer

client = Writer(
    # This is the default and can be omitted
    api_key=os.environ.get("WRITER_API_KEY"),
)
response = client.files.download(
    "file_id",
)
print(response)
content = response.read()
print(content)
```

### JavaScript Example

```
import Writer from 'writer-sdk';

const client = new Writer({
  apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.files.download('file_id');

console.log(response);

const content = await response.blob();
  console.log(content);
}

main();
```

### Response Example

200

```
"File contents"
```

#### Authorizations

Authorization

- **Type:** string
- **Location:** header
- **Required:** Yes
- **Details:** Bearer authentication header of the form `Bearer <token>`, where `<token>` is your [Writer API key](https://dev.writer.com/api-reference/api-keys).

#### Path Parameters

- **file_id**  
   - **Type:** string  
   - **Required:** Yes  
   - **Details:** The unique identifier of the file.

#### Response

200 - application/octet-stream

- **Description:** File download successful.
- **Details:** The response is of type `file`.
