How to automate the process of adding users to x-ui without having to restart xray?

I have a server with x-ui installed. Adding by hand takes too long. I would like to optimize this using a telegram bot, but I don’t know how exactly to add new users without using the web panel. How can I do this?