Graph API Version

Page Roles

Roles for a Facebook Page such as admin.

A Page Access Token is required for all methods.

Reading

People who have a role on a Page

You can also append a person's user id or username to the edge in order to directly determine whether that person has a role on the page:

 GET /v2.2/{page-id}/roles/{user-id}

If that person has a role, the response will contain the User object for the person along with the normal fields returned. If they don't have a role, an empty dataset is returned.

This API will only return roles specific to a page. If a Page has a parent page (like when a page is a store location) it inherits roles from the parent. Please query the parent for any inherited roles.

Example

Graph API Explorer
GET /v2.11/{page-id}/roles HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{page-id}/roles',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/roles",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/roles",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/roles"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
  • manage_pages
  • pages_show_list
Page management Apps
  • manage_pages
  • pages_show_list
Other Apps
No data

Parameters

NameDescription
uid
int

ID of a person who has a role on the Page

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of User nodes.

The following fields will be added to each node that is returned:

FieldDescription

perms

list<enum>

Permissions granted to a person by the Page. Can be any of ADMINISTER, EDIT_PROFILE, CREATE_CONTENT, MODERATE_CONTENT, CREATE_ADS, BASIC_ADMIN, or CREATE_DRAFT_CONTENT

role

enum

Role for this person. In v2.1 and earlier this is one of MANAGER, CONTENT_CREATOR, MODERATOR, ADVERTISER, or INSIGHTS_ANALYST. In v2.2 and later, this is one of Admin, Editor, Moderator, Advertiser, or Analyst

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
210User not visible
200Permissions error
100Invalid parameter

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.