Trouble with inviting a user to organization through http API


I’m trying to invite a user to my organization using the http API. I’m sending the request to
I keep getting an error “cannot invite when login is disabled”. There’s no problem doing it through the UI.
I don’t understand why I’m getting the error or how it can be fixed - I didn’t see anything about enabling / disabling login anywhere.

Still haven’t solved it