# API 支持在标签设置中自动更新“允许创建标签的组”

**URL:** <https://meta.discourse.org/t/api-support-for-automatically-updating-create-tag-allowed-groups-in-tags-settings/379034>\
**Category:** Support\
**Created:** [2025年八月18日 12:07 UTC](https://meta.discourse.org/t/api-support-for-automatically-updating-create-tag-allowed-groups-in-tags-settings/379034 "2025-08-18T12:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S.AAKASH\_MUTHIAH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/s.aakash_muthiah/32/484624_2.png) [@S.AAKASH\_MUTHIAH](https://meta.discourse.org/u/S.AAKASH_MUTHIAH)\
**Post date:** [2025年八月18日 12:07 UTC](https://meta.discourse.org/t/api-support-for-automatically-updating-create-tag-allowed-groups-in-tags-settings/379034/1 "2025-08-18T12:07:04Z")

</div>

我们有一个应用程序，在我们的应用程序中创建类别时，也会在 Discourse 中创建相应的类别。除此之外，还会根据我们应用程序提供的用户列表在 Discourse 中为该类别创建一个版主组。

我需要 Discourse 中创建的组自动添加到标签设置的“ **创建标签允许的组** ”字段中。是否有 API 可以从后端自动更新“ **创建标签允许的组** ”，而无需从应用程序手动更新？每次创建类别时都应发生此过程。

因此，如果我创建 200 个类别，将创建 200 个相应的组并添加到“ **创建标签允许的组** ”字段中。

我的问题是：

- “ **创建标签允许的组** ”字段中可以添加的组的数量是否有任何限制？

- 您认为这种方法是好的做法吗？如果不是，您能否建议更好的替代方案？

![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/3/4/0/3402369922add0f273026043a9e5f88d3c7292e5.png)

---

<div class="post-metadata">

**Author:** ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)\
**Post date:** [2025年八月18日 09:53 UTC](https://meta.discourse.org/t/api-support-for-automatically-updating-create-tag-allowed-groups-in-tags-settings/379034/2 "2025-08-18T09:53:35Z")

</div>

我认为没有限制。您在这里遇到了什么具体问题吗？

---

<div class="post-metadata">

**Author:** ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)\
**Post date:** [2025年八月18日 12:19 UTC](https://meta.discourse.org/t/api-support-for-automatically-updating-create-tag-allowed-groups-in-tags-settings/379034/3 "2025-08-18T12:19:21Z")

</div>

> [@S.AAKASH\_MUTHIAH](#):
>
> “创建标签允许的组”字段中可以添加的组的数量有限制吗？

不确定，但我不认为有硬性限制。不过用户界面可能会变得相当笨拙。

> [@S.AAKASH\_MUTHIAH](#):
>
> 是否有可用的 API 可以从后端自动更新“创建标签允许的组”，而无需从应用程序端手动更新？每次创建类别时都应该发生此过程。

也许你可以看看使用自定义脚本进行自动化

> [@Create custom Automations](https://meta.discourse.org/t/create-custom-automations/275931):
>
> information_source This is a draft, and may need some extra work. Vocabulary trigger: represents the name of the trigger, eg: user\_added\_to\_group triggerable: represents the code logic associated to a trigger, eg: triggers/user\_added\_to\_group\_.rb script: represents the name of the script, eg: send\_pms scriptable: represents the code logic associated to a script, eg: scripts/send\_pms.rb Plugin API add\_automation\_scriptable(name, &block) add\_automation\_triggerable(name, &block) Scriptable AP…

如果你不需要每个版主组都成为它自己的组，你可以将用户列表添加到同一个组，然后只将该组添加到“创建标签允许的组”字段。这样不就足够了吗？

在这种情况下，你可以查看 [An 'add to group' script for the Discourse Automation](https://meta.discourse.org/t/an-add-to-group-script-for-the-discourse-automation/231216)
