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

# 下载文档

> 下载项目文档的二进制内容

```
GET /openapi/memorylake/api/v1/projects/{id}/documents/{documentId}/download
```

下载项目文档的二进制内容。响应为 `303` 重定向到存储下载 URL，或流式二进制内容。

<Note>
  **所需权限（全部需要）：**

  * [`project:doc_read`](/zh/features/team-collaboration/permission-reference#读取单个文档) · `instance`
  * [`drive:item_read`](/zh/features/team-collaboration/permission-reference#读取文件) · `service`

  服务器会将文档解析为其底层的文件库文件并转发到云盘下载处理程序 —— 每次调用都会检查这两个权限。
</Note>

### 路径参数

<ParamField path="id" type="string" required>
  项目 ID
</ParamField>

<ParamField path="documentId" type="string" required>
  项目文档 ID
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -L -X GET 'https://app.memorylake.ai/openapi/memorylake/api/v1/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/documents/doc-1234567890abcdef/download' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -o downloaded_file.pdf
  ```
</RequestExample>

### 响应

返回 `303` 重定向到存储下载 URL，或 `200` 流式二进制内容（`application/octet-stream`）。

<ResponseExample>
  ```
  HTTP/1.1 303 See Other
  Location: https://storage.example.com/download/document.pdf?signature=...
  ```
</ResponseExample>
