---
title: "保存 GitHub 发现 Token"
method: PUT
path: "/settings/github-discovery-token"
tags: ["JS插件管理"]
---

# 保存 GitHub 发现 Token

`PUT /settings/github-discovery-token`

## Request

- Base URL: `https://localhost:58091/api/v1`
- URL: `https://localhost:58091/api/v1/settings/github-discovery-token`
- Auth: API key in header `Authorization`

将 GitHub Token 保存到服务器配置，供各客户端共用。token 必填，空字符串表示清除；去掉首尾空白，内部只接受 ASCII 字母、数字和下划线，最长 512 字节。立即生效，无需预先创建配置；响应禁止缓存。

## Request body

- HandlersGithubDiscoveryTokenSetting
  - `token` string

## Response `200`

保存后的 Token

- HandlersGithubDiscoveryTokenSetting
  - `token` string

## Other responses

- `400`: 请求格式或 Token 格式错误
- `401`: 未登录
- `500`: 保存配置失败

## Changes

- **2026-10-12** `b58a51e3d8f3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/songloft-org/apis/songloft-api/changes/settings/github-discovery-token/put.md)

---

[API](https://skmtc.dev/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.dev/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc.dev/songloft-org/apis/songloft-api/revisions/29bc122e3e1e?raw)
