# 是否有用于设置用户的主要组的API

**URL:** https://meta.discourse.org/t/is-there-an-api-to-set-the-primary-group-for-a-user/309611
**Category:** Development
**Tags:** rest-api
**Created:** [2024年五月28日 00:29 UTC](https://meta.discourse.org/t/is-there-an-api-to-set-the-primary-group-for-a-user/309611 "2024-05-28T00:29:24Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2024年五月28日 02:12 UTC](https://meta.discourse.org/t/is-there-an-api-to-set-the-primary-group-for-a-user/309611/2 "2024-05-28T02:12:34Z")

</div>

我认为您可以通过 updateUser 操作来更新用户设置：

> **[Discourse API Docs](https://docs.discourse.org/#tag/Users/operation/updateUser)**

> [@Discourse REST API Documentation](https://meta.discourse.org/t/discourse-rest-api-documentation/22706/1):
>
> Discourse API Please view the Discourse API Documentation site for detailed info: [https://docs.discourse.org](https://docs.discourse.org)warning Deprecation Warning! On April 6th, 2020 we dropped support for all non-HTTP header based authentication (excluding some rss, mail-receiver, and ics routes). This means that API requests that have an api\_key and api\_username in the query params or in the HTTP body of the request will soon stop working. Please see the example cURL request below for how to update your API requ…

---

_[View the full topic](https://meta.discourse.org/t/is-there-an-api-to-set-the-primary-group-for-a-user/309611)._
