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.