Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Bubbles102
Engaged Sweeper

I am trying to query asset data via the GraphQL API using a Personal Access Token (PAT),
but I consistently receive a "401 Unauthorized" error with the message "You must be logged in."

 

QUESTIONS:
1. Are there additional permissions or scopes that need to be enabled for PAT tokens?
2. Does our Lansweeper Cloud license include GraphQL API access?
3. Are there site-level restrictions preventing API authentication?
4. Is there a specific role or permission required beyond "API Client Admin"?
5. Do PAT tokens require a specific configuration I might be missing?

 
1 REPLY 1
EthanB
Lansweeper Employee
Lansweeper Employee

Hello,

This error message usually occurs when the headers in an API query are either missing or incorrect. For more information, please visit:

1. In your Configuration you can navigate to Account Management -> Roles & Permissions. There please ensure that the role you are using has the permission to "Allow API clients to access this site" under the Configuration section.

2. To determine this exactly we recommend contacting your Account Manager. For more information, please visit:

Some plans include only certain integrations or certain API access.

3. Please see point 1. Administrators can also revoke unwanted API client access by navigating to Configuration -> API client management. From there they can mark the box on the left of an API client and then select the X to revoke API access.

4. That should have the appropriate permissions.

5. We recommend ensuring that your PAT API client has access to the site you are trying to get information from. To do this, navigate to settings in the bottom left of your Cloud site -> Developer Tools -> API clients -> select the API client you are using. Scroll down to the Sites section to ensure that the API client has access to your desired site. Please again see below for more information:

If you have further issues, if you would like, you can feel free to contact Lansweeper Support as well. We will be more than happy to help!

Thanks!

General Discussions

Find answers to technical questions about Lansweeper.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now