Mangogo 营业厅Mangogo 营业厅
首页API 参考Skills插件

3.9 更新用户设置

POST/manager-api/user/setting

3.9 更新用户设置

更新用户设置

接口地址: PUT /manager-api/user/setting

权限要求: 🔐 需要登录(User权限)

描述: 管理端前缀下的用户设置更新接口,与 PUT /api/user/setting 共用同一处理逻辑,用于更新当前登录用户的通知、额度预警、语言和主题等个性化设置。

请求头:

token: {access_token}Content-Type: application/json

请求示例:

curl -X PUT "https://your-domain.com/manager-api/user/setting" \  -H "token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \  -H "Content-Type: application/json" \  -d '{    "notify_type": "email",    "quota_warning_threshold": 100000,    "notification_email": "user@example.com",    "upstream_model_update_notify_enabled": true,    "accept_unset_model_ratio_model": false,    "record_ip_log": true,    "language": "zh",    "theme_mode": "system"  }'

请求参数:

参数类型必填说明
notify_typestring是配额预警通知方式,可选值:email、webhook、bark、gotify
quota_warning_thresholdnumber是配额预警阈值,必须大于 0
webhook_urlstring否notify_type=webhook 时必填,Webhook 地址
webhook_secretstring否Webhook 密钥
notification_emailstring否notify_type=email 时使用的通知邮箱
bark_urlstring否notify_type=bark 时必填,Bark 推送地址
gotify_urlstring否notify_type=gotify 时必填,Gotify 服务地址
gotify_tokenstring否notify_type=gotify 时必填,Gotify Token
gotify_priorityint否Gotify 优先级,范围 0-10,超出范围默认使用 5
upstream_model_update_notify_enabledbool否上游模型更新通知开关,仅管理员用户可更新
accept_unset_model_ratio_modelbool否是否接受未配置模型倍率的模型
record_ip_logbool否是否记录 IP 日志
languagestring否用户界面语言
theme_modestring否主题模式

返回数据:

{  "success": true,  "message": "设置已保存",  "data": null}

说明:

  • /manager-api/user/setting 由管理端路由注册,实际方法为 PUT。
  • 认证方式兼容 POST /api/user/add_invitation_num,请求头只传 token: {access_token} 即可,不需要额外传 New-Api-User。
  • 该接口更新的是当前登录用户设置,请求体不需要传 user_id。
  • notify_type 为 webhook、bark 或 gotify 时,对应 URL 必须是合法的 http:// 或 https:// 地址。

image.png

image.png

image.png

image.png