User Profile API

The User Profile API allows you to use a Page-scoped ID (PSID) to retrieve user profile information that can be used to personalize the experience of people interacting with your Messenger.



Though you may have a PSID, you may not have permission or be able to retrieve a person's profile information. For example Instant Game Pages are not allowed to use this API.

User Opt-in

The following events will authorize your Messenger bot to access a person's 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 accepting a Page's message request.
  • Your Messenger bot uses the askPermission() function of the Messenger Extensions SDK in the webview to ask for the user_profile permission.

Some entry points allow you or people to initiate a conversation without giving your bot authorization to the person's public profile. In those cases, your Messenger bot will be granted permission to access user profile after the user replied to the initial message. Notable situations where a person may initiate 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.'

Available Profile Fields

By default, your apps may retrieve the id, name, first_name, last_name, and profile_pic fields for user's that have made this information public and have opted-in to your Page.

Apps can query via the API, which fields are available for a given Page. See Feature Review API

The following profile fields can be requested:

Field Name Description Feature Access


The user's PSID

Granted by default


The user's first and last name

Granted by default


First name

Granted by default


Last name

Granted by default


URL to the Profile picture. The URL will expire.

Granted by default


Locale of the user on Facebook. For supported locale codes, see Supported Locales.

This Page level feature needs approval by Facebook


Timezone, number relative to GMT

This Page level feature needs approval by Facebook



This Page level feature needs approval by Facebook

Requesting feature access to user fields for the Page

  1. Go to Page Settings > Advanced Messaging
  2. Under 'Info About People' select the field and click the 'Request' button.

App-Level and Page-Level Permissions

The above permissions are needed at both the app-level and Page-Level to be able to retrieve the fields. App-Level review is mandatory. At Page-Level these permissions are granted by default, yet we recommend that page admins proactively do a Page-level submission explaining why they need them on that particular page.

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",

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

Last Ad Referral - DEPRECATED

This profile field has been deprecated.

The ad_id of the last ad referral will continue to be provided in the messaging_referrals webhook event when the user enters your bot via a click-to-Messenger ad.

Error Codes

Code Message Reason


No Permission For Pages Associated to the Instant Game.

Instant game Pages are not allowed to access the User Profile API.


No profile available for this user.

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


Insufficient permission to access user profile.

The app requesting the user profile has not been granted the permissions needed to access one or more of the requested fields. For more information, see Available Profile Filelds.