How to fix 401 error when calling ServiceNow REST API?

RukhsanaN
Mega Contributor

Hi everyone,

I'm trying to call the ServiceNow REST API from an external system, but I keep receiving a 401 Unauthorized error.

Here’s what I’ve tried so far:
- Verified username and password
- Checked that the user has the “web_service_admin” role
- Tested the same credentials in Postman — still getting 401
- Ensured the instance URL is correct

Is there anything specific I need to configure under “Basic Auth” or the API user settings to resolve this issue?

Thanks in advance for your help!

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@RukhsanaN 
does your instance have SSO enabled?

did you make sure the API user has this checkbox as true

Internal Integration User - True

AnkurBawiskar_0-1761053320853.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Nikhil Bajaj9
Tera Sage
Tera Sage

Hi @RukhsanaN ,

 

Thanks for marking my reply as helpful. If i was able to answer your query, please mark my answer as Solution accepted.

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

View solution in original post

4 REPLIES 4

M Iftikhar
Tera Sage

Hi @RukhsanaN 
You can check this post, it explains the same 401 issue and how to fix it:
ServiceNow REST API throwing error (401 Unauthorized)

It should help you resolve the problem. 

If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Ankur Bawiskar
Tera Patron
Tera Patron

@RukhsanaN 
does your instance have SSO enabled?

did you make sure the API user has this checkbox as true

Internal Integration User - True

AnkurBawiskar_0-1761053320853.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Nikhil Bajaj9
Tera Sage
Tera Sage

Hi @RukhsanaN ,

 

First thing check if web service cehck box is checked in user profile. 

Second thing - User have all REST APi related roles and the table related access which you are accessing for ex:- incident_manager in case you want to access incident access.

Third User name and password should be correct in Postman or whereever you are passing in Basic auth setting.

Forth- Endpoiunt/URL of the PDI is correct.

If it is Oauth then you need to check Token as well.

NikhilBajaj9_0-1761055659390.png

NikhilBajaj9_2-1761055709944.png

Check all these points and configure accordingly, then let us know the results.

 

 

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025

Nikhil Bajaj9
Tera Sage
Tera Sage

Hi @RukhsanaN ,

 

Thanks for marking my reply as helpful. If i was able to answer your query, please mark my answer as Solution accepted.

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

ServiceNow Rising Star-2025