Gitlab API - Group access tokens endpoint not showing all tokens

Problem to solve

The endpoint “/api/v4/groups/<group_id>/access_tokens” is returning only expired tokens when queried, and not the currently available ones. According to the documentation here, this behavior is not specified anywhere.

I created this token test to show this behavior:

Additionally, if I make this request with my personal user token, it works fine. However, when I try to use the access token of a service account to query all the group access tokens, I receive a 401. The personal access token of this service account that I am using in the request to /api/v4/groups/<group_id>/access_tokens has only the api scope.


The version of GitLab I am using is SaaS.