Is there a back-end API where I can manage all of the users and their permissions automatically?

For example, I have a Supabase-Stripe integration that manages user accounts at my website. Different levels of subscribers either do or do not have access to certain forum Categories.

Is there a convenient API for handling my website subscriber’s discourse accounts creation and permissions? Another solution?

Even a way to automatically send invite emails to users would help. I don’t know how to properly check if Discourse has an API for these purposes except to ask!

have you read this topic yet?

1 Like

I think you want to run the subscription plugin rake task to import those subscriptions, though I don’t think there is a way to import the users subscriptions, just the products, so new users will be automatically added to the correct groups.

You’ll need to contrive a way to import the users. If there are more than a hundred or so, an import script will be easier then the API.

2 Likes

I will take a look and see how far I can get.

To create accounts the endpoint is: url = f"{DISCOURSE_URL}/users.json" which you can generally connect and by using admin API create accounts easily.

Also this endpoint helps you with almost all the basic permissions, and for custom permissions there is no such specific endpoint but you can easily inspect and find in the networks tab and that would do the work.

1 Like

You probably want to use discourse_connect so that your website can manage Discourse logins. If it’s WordPress, then it’s easy (just use wp-discourse); if it’s something else, then you’ll want to implement discourse_connect on your site.

2 Likes