We have a GitLab integration which depends on Group Webhooks, a Premium feature. When installed on a GitLab free plan, the Group Webhooks endpoints behave as expected but events are not being sent, which creates a lot of confusion for our users.
Is there a way with the API to determine whether a GitLab instance is on the Premium plan? This would allow us to fail early rather than give an illusion of success.
Well the only thing I managed to find while looking at the Gitlab API docs is this: License | GitLab unfortunately you cannot use that on Gitlab.com but only on self-hosted installations. I guess better than nothing.
There is also this: Namespaces API | GitLab which hints at showing the Gitlab plan for example:
as you can see plan shows default, so you might want to run that on a few namespaces and compare the results to see if it changes and shows pro/ultimate or whatever.
Your only issue then if that does solve it, is you may need to use the license one for self-hosted, and namespace for Gitlab.com. Eg: if host == gitlab.com use namespace API endpoint, else use license one.