That call will create a personal access token for your account, and to quote the documentation:
Creates a personal access token for your account. For security purposes, the token:
- Is limited to the k8s_proxy scope. This scope grants permission to perform Kubernetes API calls using the agent for Kubernetes.
You can use the API with admin credetials to create an access for a given user with the read_repository scope - note the useage of the /users/:user_id API instead of the /user API:
curl --request POST \
--header "PRIVATE-TOKEN: glpat-" \
--data "name=test-token-short-ttl" \
--data "scopes[]=read_repository" \
--data "expires_at=2025-08-06" \
--url "https://gitlab.example.ru/api/v4/users/42/personal_access_tokens"
# the user ID -------------------------------------^