How do I determine the scope of my personal access token using the api

I currently work for a service that integrates with self-hosted GitLab instances using a personal access token.

My service requires that the token is scoped with API access as I need to be able to write to a project. Is there a way to programmatically verify that the token a user specifies has the api scope?