Group

Impersonate tokens are needed when reading information from multi-company groups. The impersonate token needs to be generated for a member of the multi-company group.

Path /{group-id}

Represents a Workplace group. The /{group-id} node returns a single group.

Reading

You can read information about a group by making a Graph API GET request to /{group-id}.

Permissions

Reading Group node requires the Read group content permission.

Fields

Field NameDescriptionData Type

id

The group ID.

string

cover

Information about the Group's cover photo.

CoverPhoto

description

A brief description of the group.

string

icon

The URL for the group's icon.

url

is_workplace_default

Indicates whether the group is a default Workplace group (read only).

url

name

The name of the group.

string

owner

The member that created this group.

User

privacy

The privacy setting of the group. Possible values:

  • CLOSED
  • OPEN
  • SECRET

string

updated_time

The last time the group was updated (this includes changes in the group's properties and changes in posts and comments if the session user can see them).

datetime

archived

Indicates whether the group was archived (read only).

boolean

post_requires_admin_approval

Indicates whether posts to the group will require admin approval.

boolean

purpose

Indicates the purpose of the group.

enum {WORK_TEAM, WORK_ANNOUNCEMENT, WORK_MULTI_COMPANY, WORK_SOCIAL}

post_permissions

Indicates if a post requires admin approval.

enum {NONE, ADMIN_ONLY}

join_settings

Indicates if new members must be approved by the admin.

enum {NONE, ADMIN_ONLY}

Publishing

You can't publish using this edge. In order to create a group, publish to the /community/groups edge.

Deleting

You can't delete a group using this node. Removing the last member of a group will delete that group automatically.

Updating

You can update a group by making a Graph API POST request to /{group-id} and passing values for the fields to be updated.

Permissions

Making updates to a group node requires the Manage groups permission.

Fields

Field NameDescriptionType

name

The name of the group being updated.

string

cover_url

A URL containing an image for the group cover photo.

string

privacy

The privacy setting of the group. Possible values:

  • CLOSED
  • OPEN
  • SECRET

string

Edges

Edge NameDescription

/admins

The admins of a Workplace group.

/albums

The photo albums in a Workplace group.

/docs

The docs in a Workplace group.

/events

The events in a Workplace group.

/feed

The posts in a Workplace group, arranged into a feed.

/files

The files shared into a Workplace group.

/member_requests

The pending membership requests for groups that have membership approvals enabled.

/members

The members of a Workplace group.

/moderators

The moderators of a Workplace group.

/pinned_posts

The post pinned to the group.

Examples

Get group id, name, and privacy:

GET graph.facebook.com
  /{group-id}?fields=id,name,privacy

Get group members with name, id, and join date:

GET graph.facebook.com
  /{group-id}/members?fields=name,id,joined

Get a group's admins and moderators in a single call:

GET graph.facebook.com
  /{group-id}?fields=admins,moderators

Get group docs:

GET graph.facebook.com
  /{group-id}/docs

Get group posts:

GET graph.facebook.com
  /{group-id}/feed

Get group posts including additional attachments like videos, images, files, or polls:

GET graph.facebook.com
  /{group-id}/feed?fields=attachments

Poll options are listed in descending order according to vote count for each option.

Get a list of group members, along with their join date:

GET graph.facebook.com
  /{group-id}/members?fields=name,joined

Add a member to a group by id:

POST graph.facebook.com
  /{group-id}/members/{member-id}

Add a member to a group by email:

POST graph.facebook.com
  /{group-id}/members?email=michael%40example.com

When including email addresses in the URL for a request, ensure that the email addresses is URL encoded. Example: michael@example.com becomes michael%40example.com.

Removing the last member from a group will schedule that group for deletion.

Remove a member from a group by id:

DELETE graph.facebook.com
  /{group-id}/members/{member-id}

Remove a member from a group by email:

DELETE graph.facebook.com
  /{group-id}/members?email=michael%40example.com

When including email addresses in the URL for a request, ensure that the email addresses is URL encoded. Example: michael@example.com becomes michael%40example.com.

Promote a member to admin of a group:

POST graph.facebook.com
  /{group-id}/admins/{user-id}

Demote an admin to member of a group:

DELETE graph.facebook.com
  /{group-id}/admins/{user-id}

Create a new Event in a group:

POST graph.facebook.com
  /{group-id}/events
  ?name=New+Event
  &start_time=2017-03-02T14:00:04+00:00
  &end_time=2017-03-02T15:00:04+00:00
  &description=Test+Description
  &location=Boardroom

Upload a new photo (via binary) to a group:

POST graph.facebook.com
  /{group-id}/photos?source={image-data}

Upload a new photo (via url) to a group:

POST graph.facebook.com
  /{group-id}/photos?url={image-data}

Create a new group doc with title and body:

POST graph.facebook.com
  /{group-id}/docs?title=title%20of%20doc&body=body%20of%20the%20doc

Update the post permissions, join settings, purpose and post approval settings

POST graph.facebook.com
  /{group-id}/?post_permissions=NONE&join_setting=ADMIN_ONLY&purpose=WORK_SOCIAL&post_requires_admin_approval=false

Get the reactions and comments to the pinned post

GET graph.facebook.com
  /{group-id}/pinned_posts?fields=reactions,comments