I am trying to find a way to get the information about the salesforce enterprise user from his auth_token. I want to find the username, email address and role(admin/user) from the auth-token.

Something on the lines of

curl -XGET 'https://na1.salesforce.com/Userinfo' -H "Authorization: Bearter token"

which would give me the required information

I have been looking at the REST API and MetaData API but did not find anything. Preferably I would want this information from a REST API and not some programmatic API. Any help?

  • Can anyone shoot me a example of how to build this GET request and pass that Identity Id into it? Thanks!
    – Christian
    Jan 5, 2016 at 19:54

4 Answers 4


Assuming you've done OAuth, the OAuth response includes an id field with an Identity Service URL - e.g.:


GET this URL, passing the access token, and you'll receive the user info. Note the use of -L to follow redirects:

$ curl -L -H 'X-PrettyPrint: 1' -H 'Authorization: Bearer 00D...' https://login.salesforce.com/id/00D50000000IZ3ZEAW/00550000001fg5OAAQ
    "display_name":"Sample User",
        "body":"Working on OAuth 2.0 article"

More info on the Identity Service.

  • is there now a way to to fetch this identity information for all the users of the enterprise using the admin's auth token? This is required since I do not know the ids of all users to fetch their information. Is there a way to do it via some call that gives the info of all enterprise users?
    – auny
    May 16, 2013 at 9:38
  • 2
    SELECT Id, Name, Email FROM Users will work, but you'll probably want to filter by profile ID or some other criteria. You can then build the ID URL yourself - it is https://login.salesforce.com/id/[ORG ID]/[USER ID]
    – metadaddy
    May 16, 2013 at 17:10

There is an actual endpoint for this now as well: https://login.salesforce.com/services/oauth2/userinfo

See here for the help document


For Rest API (Force.com-JavaScript-REST-Toolkit), we have created one more API to get current authenticate user information. You can find more details at link

Please let me know in case of any other information required.

  • 1
    The code comment above the userInfo method really helped in understanding what was supposed to be passed as an argument. Thank You. Jul 16, 2014 at 13:09
  • Most welcome contactmatt !!!! Jul 16, 2014 at 14:33

If you already have your OAuth token and are familiar with the REST API. The endpoint to hit is:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.