Using Jenkins gitlab token to make an API call
Try something similar to the following:

environment {
  GITLAB_API_TOKEN = credentials('gitlab_api_token').   
}


or

withCredentials([[
  $class: 'com.dabsquared.gitlabjenkins.connection.GitLabApiTokenImpl',
  credentialsId: 'gitlab_api_token',
  variable: 'GITLAB_API_TOKEN'
]])


See https://jenkins.io/doc/pipeline/steps/credentials-binding/
and  https://github.com/jenkinsci/gitlab-plugin/issues/536 for more information.