User Profile API

The User Profile API allows you to use a PSID to retrieve profile information that can be used to personalize the experience of people interacting with your Messenger bot.



Though you may have a PSID, you may not have permission or be able to retrieve a person's profile information.

User Opt-in

The following events will authorize your Messenger bot to access profile information:

  • The person starts the conversation via a welcome screen and tapped the "Get Started" button.
  • The person starts the conversation by clicking a "Send to Messenger" button.
  • The person starts the conversation by sending a message.
  • The person starts the conversation by tapping a button.
  • Your Messenger bot uses the askPermission() function of the Messenger Extensions SDK in the webview to ask for the user_profile permission.

Notable situations where a person may start a conversation with your Messenger bot but not authorize profile permission include the following:

Profile Unavailable

Currently, the User Profile API does not support retrieving profile information for Messenger accounts that were created using a phone number instead of a Facebook account.

In this case, the API will return error code 2018218 with the message 'No profile available for this user.'

Retrieving a Person's Profile

To use the User Profile API, send a GET request with the profile fields you want for the person:

curl -X GET "<PSID>?fields=first_name,last_name,profile_pic&access_token=<PAGE_ACCESS_TOKEN>"

If you are allowed to view the person's profile, the User Profile API will return a JSON string with the requested fields from the person's profile.

  "first_name": "Peter",
  "last_name": "Chang",
  "profile_pic": "",
  "locale": "en_US",
  "timezone": -7,
  "gender": "male",
  "last_ad_referral": {
    "source": "ADS",
    "type": "OPEN_THREAD",
    "ad_id": "6045246247433"

If you are not allowed to view the person's profile, an empty object is returned.

Available Profile Fields

The following profile fields can be requested:

Field Name Description


First name


Last name


Profile picture


Locale of the user on Facebook


Timezone, number relative to GMT




Is the user eligible to receive messenger platform payment messages


Details of the last Messenger Conversation Ad user was referred from

Last Ad Referral

To make it easier for developers to identify which sent a person to their bot, the details of the last click-to-Messenger ad the person was referred by may be requested in the last_ad_referral field.

The last_ad_referral field is only available if the referrer was a click-to-Messenger ad.


  "first_name": "Peter",
  "last_name": "Chang",
  "last_ad_referral": {
    "source": "ADS",
    "type": "OPEN_THREAD",
    "ad_id": "6045246247433"

Error Codes

Code Message Reason


No profile available for this user.

If the user registered for Messenger with a phone number, no profile information is available.