How to reset user password using RestAPI in Salesforce?

Monday, December 5, 2022

I have Salesforce admin credentials and a password reset query. I want to reset the user password using Rest API. How to reset a user password using RestAPI in the Salesforce application? What is the password reset endpoint?

User Usr1 = [Select Id from User where username=


1 Replies
Monday, December 5, 2022
re: iampankaj Monday, December 5, 2022

Users are treated as an sObject, so its the data api, so you access it at


and the password is at



To change a password using Curl Create a file with contents like these (it must be valid json), and save it somewhere.


"NewPassword" : "myNewPassword1234"


then post to the service using a curl command like (fill in yourInstance, UserId, yourOAuthToken, and yourPasswdFile):

curl https://<yourInstance><UserId>/password -H "Authorization: Bearer <yourOAuthToken>" —H "Content-Type: application/json" —d @<yourPasswdFile>.json —X POST

Theres more information and sample curl commands at


I hope you got a lot of information in this answer. but still wanted to gain more information regarding this question then check out this link salesforce administrator training. This Training is for Beginners, Intermediate, and advanced Salesforce users to enhance their knowledge and understanding of the Salesforce CRM platform.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885


  • Started: Monday, December 5, 2022
  • Last Reply: Monday, December 5, 2022
  • Replies: 1
  • Views: 202