Using API to limit trust_levels?

AI-generated summary

The discussion centers around the possibility of limiting trust levels in Discourse using the API. satonotdead initiated the topic, referencing a previous discussion about limiting trust levels on groups and acknowledging that it’s not possible out-of-the-box. They inquired whether API calls could be used to lock or unlock trust levels based on conditions like badge acquisition. Kayaart confirmed that this is a viable workaround, explaining that while direct limitation via badges or automation isn’s possible, the API allows for changes to trust levels triggered by a script and a condition. satonotdead expressed intent to share their experiments and welcome any related contributions. Kayaart expressed appreciation for the welcoming community.

Continuing the discussion from How to limit trust level on group?:

I wonder if any experienced user/dev can give me some light here? I want to limit trust_levels usint badges and/or automation and I see it’s not possible out of the box.

Trying to get this done I found that API calls can lock or unlock the trust_level on users, so it could work?

Any advice or suggestion would be greatly appreciated.

Yes, you got it right: you can’t directly limit the trust level through badges or automation, but you can through the API. If you create a condition (for example, getting a badge), you can call the API with a script to change the trust_level and fix it. It’s not out of the box, but it works

Thanks, I’ll share my experiments. Feel free to share any insight/reading/idea/prototype as well.

It’s good to see you here, welcome to the forum.

Thank you, I’ve been on many forums and I can say that the people here are very nice.Thank you for your content