# 文件夹 (/docs/api/native/media/folders)



[指南 →](/docs/cloud/services/media/quickstart)

[基础地址与鉴权](/docs/api/native/media)

## 列出文件夹 [#列出文件夹]

`GET /media/v1/libraries/{library_id}/folders`

| 参数 | 位置 | 类型 | 说明 |
| --- | --- | --- | --- |
| library_id | path | string | 库 ID |
| parent | query | string | 父文件夹路径；省略或空字符串为根。一次返回这一层的全部子文件夹，不分页；传 limit 或 cursor 返回 400 |

返回: `Folders`.

### 响应 [#响应]

#### HTTP 200 [#http-200]

Successful response.

**application/json**

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| folders | array&lt;object&gt; | All immediate child folders of parent, sorted by path. |
| folders[].name | string | Final path segment naming the child folder. |
| folders[].path | string | Full folder path relative to the library root. |
| folders[].asset_count | number | Number of assets in this folder and all descendant folders. |

```bash
curl -X GET "https://api.deepraxis.ai/media/v1/libraries/${LIBRARY_ID}/folders" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
```

HTTP 200

```json
{
  "folders": [
    {
      "name": "examples",
      "path": "examples",
      "asset_count": 1
    }
  ]
}
```

## Folders [#folders]

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| folders | object[] | 是 | 文件夹列表 |
