Graph API Version

User Accounts

Accounts for a Facebook User.

Reading

Pages this User has a role on.

Permissions

A Page access token for a User with a role (other than Live Contributor) on the Page and the following permissions:

  • manage_pages or pages_show_list

Example

Graph API Explorer
GET /v2.12/{user-id}/accounts 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(
    '/{user-id}/accounts',
    '{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(
    "/{user-id}/accounts",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}/accounts",
    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:@"/{user-id}/accounts"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

NameDescription
business_id
numeric string or integer

Filter pages by a specific business id

is_business
boolean

If specified, filter pages based on whetherthey are associated with a Business manager or not

is_place
boolean

If specified,filter pages based on whetherthey are places or not.

is_promotable
boolean

If specified, filter pages based on whether they can be promoted or not

Fields

Reading from this edge will return a JSON formatted result:

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

data

A list of Page nodes.

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

FieldDescription

perms

list<enum>

The User's permissions for the Page.

paging

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

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

FieldDescription

total_count

int32

Total number of objects on this edge

Validation Rules

ErrorDescription
190Invalid OAuth 2.0 Access Token
3919There was an unexpected technical issue. Please try again.
100Invalid parameter
200Permissions error
210User not visible
278Reading advertisements requires an access token with the extended permission ads_read

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.