Call to GraphQL API returns API not accessible for user

GraphQL error

I am using GraphQL API with an OAuth token (with api scope), and I am executing a query to fetch logged in user’s username, id and such.

currentUser {
  id
  name
  username
}

This works fine for me and for most of my user’s (and also all the people in the QA department). But some users report errors and in the logs I’ve found this response:

status 403 body: {"errors":[{"message":"API not accessible for user"}]}"

I haven’t been able to replicate this error myself and it seems that the code works for at least 95% of the people. Is there some setting these people have that prevents access to the API?