Data model for groups#

There are two main object types in the groups API data model:

  • The group objects.

  • The membership objects.

The specific fields available depends on the group type. See the group types for more details about the various groups and their available fields.

Group objects#

Group objects are returned in the following contexts:

  • Fetching the groups of the current user.

  • Fetching the groups of an organization.

  • Fetching a specific group.

In all cases, the group object has a common structure with some common fields.

Example group#

{
    "id": "fc:example:random-id",
    "type": "fc:example",
    "displayName": "Example group",
    "parent": "fc:example:parent-id",
    "membership": {
        "basic": "member"
    }
}

Group fields#

The following fields are common to all group objects:

id (required, string)

The identifier of the group. The structure of the identifier depends on the group type.

type (required, string)

The group type. This is used to distinguish between different types of groups.

displayName (required, string)

The name of the group.

parent (optional, string)

The identifier of the parent group. This is used to build a hierarchy of groups.

membership (optional, object)

The membership of the current user in the group. See the membership object for details about this structure.

Note: This field is only present when requesting groups for a specific user.

Membership objects#

The membership object describes the relationship between a user and a group. It is returned in two different contexts:

  • When fetching a group in the context of a user. In that case, the membership field is present in the group object.

  • When fetching a list of members of a group.

Example membership#

{
    "basic": "member",
    "displayName": "Student"
}

Membership fields#

The following fields are common to all membership objects:

basic (required, string)

The basic membership type. This is one of the following values:

  • member: Regular members.

  • admin: Abstract role of super members, having some kind of additional permissions. For example, the admin may invite or add other members, moderate content in a group or anything else.

  • owner: Only used for ad-hoc groups, where this is the creator of the group.

displayName (optional, string/object)

A human readable description of the membership type.

Note: This field is usually a plain string, but it can in rare cases be an object with translations. See the individual group types for details about the contents of this field.