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

Creating

This API lets you create Facebook pages.

Note: When setting the locale, at least one, city_id, location, or coordinates, is required. Caveats:

  • city_id and location can not be used together
  • city_id and coordinates can be used together however the coordinates must be within the city selected
  • location and coordinates can be used together however the coordinates must be within the location selected
You can make a POST request to accounts edge from the following paths:
When posting to this edge, no Graph object will be created.

Permissions

Developers usually request these permissions for this endpoint:

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

Parameters

NameDescription
about
UTF-8 encoded string

Short description

address
UTF-8 encoded string

Address

category_enum
string

Page category (enum). See Pages Categories API docs.

category_list
list<numeric string>

List of categories

city_id
city id

City ID

coordinates
JSON-encoded coordinate list

Coordinates

cover_photo
Object

Cover photo

url
URL
Required
offset_y
integer
Default value: 50
offset_x
integer
Default value: 50
focus_y
float
focus_x
float
zoom_scale_x
float
zoom_scale_y
float
no_feed_story
boolean
Default value: false
no_notification
boolean
Default value: false
description
UTF-8 encoded string

Description

ignore_coordinate_warnings
boolean

If ignore warnings generated in coordination validation (bool)

location
Object

This defines the location for this page. This is required if location_page_id is not specified, or if the Page referenced by the location_page_id doesn't have a valid value for the field. The dictionary must include the keys either city_id or all of city, state, and country (but state is optional if the address is not in the U.S.).

city
string
state
string
country
string
name
UTF-8 encoded string

Page name

Required
phone
UTF-8 encoded string

Phone

picture
URL

Profile picture

website
URL

Website

zip
string

Zipcode

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed
152Invalid page type
190Invalid OAuth 2.0 Access Token
3950The system creation is throttled.
200Permissions error
194Missing at least one required parameter

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.