Retrieve invited groups for a project via API

There is an API which returns all the members of a project:
GET /projects/:id/members/all
Group and project members API | GitLab

However it returns users, it does not return groups invited to a project. And I cannot find any other API which would expose this information.

I’m I missing something or it’s not possible to get the invited groups?

OK, looks like the following API returns the invited groups:
GET /projects/:id/groups?with_shared=true