API Functionality for invites

I have deployed a discourse installation which is invite only and I am looking for a way to trigger invitations from another website. However, I don’t want to invite users to a specific topic, but to the forum in general. The ideal solution for this is to have invites generated from the user profile page functionality.

Is there a way to generate invites from the API that will not tie the invite to a specific topic? Bonus points if it is possible to add the user to specific groups.
FYI, I’m going to implement this in python so I’m not looking for a solution via the ruby reference api implementation (And I checked that it doesn’t support it), however in the routes.txt file I can see some invitation specific endpoints. Do these work? If yes, how can I call them?