---
title: "更新音乐路径与扫描排除配置"
method: PUT
path: "/settings/music-path"
tags: ["扫描管理"]
---

# 更新音乐路径与扫描排除配置

`PUT /settings/music-path`

写入 music_path 配置并触发 Scanner 重建 + 清理排除目录中的歌曲（与 admin /configs PUT 的副作用一致）。

## Request body

- HandlersMusicPathSetting
  - `auto_create_exclude_dirs` string[]
  - `exclude_dirs` string[]
  - `exclude_paths` string[]
  - `path` string

## Response `200`

OK

- HandlersMusicPathSetting
  - `auto_create_exclude_dirs` string[]
  - `exclude_dirs` string[]
  - `exclude_paths` string[]
  - `path` string

## Other responses

- `400` — 请求格式错误
- `500` — 保存配置失败

---

[API](https://skmtc.net/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.net/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/songloft-org/songloft-api/versions/77467de6ed1b/schema)
