Graph API Version

User Groups

Groups on a User

As of April 4, 2018, this edge returns empty data sets for GET operations unless the calling app has gone through App Review. This applies to GET operations using /me/groups as well. Please see the Groups API section of the Breaking Changes changelog for more information.

Reading

Returns a list of Groups where the User is a member and the User has granted the app any Group-level permissions for that Group. The GET operation might request additional Group fields that can only be revealed when the requesting app has been granted certain permissions. If the app does not have the required permissions, those Groups will not be included in the returned list of Groups.

Example

Graph API Explorer
GET /v4.0/{user-id}/groups 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}/groups',
    '{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}/groups",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}/groups",
    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}/groups"
                                      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

ParameterDescription
admin_only
boolean
Default value: false

Filter to get only groups admined by this viewer

parent
numeric string or integer

Filter to see all children groups of a particular community group, by setting to the community group's ID

Fields

Reading from this edge will return a JSON formatted result:

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

data

A list of Group nodes.

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

FieldDescription
administrator
bool

Shown if this person is an admin of the group.

bookmark_order
unsigned int32

This group's place in the list of bookmarks on this person's Facebook homepage.

unread
unsigned int32

A count of the number of unread posts in that group.

paging

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

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

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.