No possibility to invite collaborators to repo by email, only username

In the browser UI we can invite collaborators to repositories by email.

But for the REST API this does not seem to work. Only usernames can be used there as it seems.

https://docs.github.com/en/rest/reference/repos#add-a-repository-collaborator

Is it planned to add this feature for the API?

Hello,
guess it is not to avoid spaming.

Regards

Probably. But I can also automate requests in the browser with a bit JavaScript or with Puppeteer or any other webdriver solution. So this makes not much difference if there is a UI / browser or only the terminal. At least in my opinion.

And regarding spam, there are rate limits applied for invites through the REST API =)