Group

Path /{group-id}

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

Multi-company groups

There are specific considerations which should be taken into account when accessing multi-company groups:

  • Group content can be read by any app of integration installed in a company that is part of a multi-company group
  • Multi-company groups are listed in communities or groups alongside regular groups
    • The purpose field can be used to identify multi-company groups. This value be set to WORK_MULTI_COMPANY
  • Group members can also be queried, but only id, name and picture will be visible if an app is from a different company to the user
  • Integrations with the Manage group permission can add and remove multi-company group members
    • Integrations can only add and remove users who are members of the community which the integration is installed on
    • Integrations can only add and remove users when one of the group admins is a member of the community which the integration is installed on
  • An integration with the Manage group content permission can delete content contained within a multi-company group if either:
    • The content belongs to a member of the app community or
    • A member of the app community is a group admin
  • Publishing to multi-company groups is currently not available
  • Multi-company groups can be selected in the group scoping setting for integrations
  • Bots cannot be mentioned in multi-company groups

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).

boolean

is_community

Indicates whether the group is also a community and can contain other groups (read only).

boolean

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_setting

Indicates how new members can join the group.

enum {NONE, ANYONE, ADMIN_ONLY, ADMIN_ONLY_ADD, ADMIN_EXTERNAL_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.

/groups

List any child groups (only applicable to groups which are also communities)

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

Identify whether a group is also a community

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