Skip to main content

Group memberships via the API

Add users to groups and remove them with Web API v3

Written by Marie Xhauflair

A user is member of zero or more groups. Content is unlocked for users based on the groups they are member of.

Reporting rights and sub-admin permissions are also assigned on a group. See Permissions via the API.

Part of Web API v3 for user management. You need a token with the v3:groupmemberships:read or v3:groupmemberships:write scope, see Authenticating with the Web API v3.


Direct and indirect group memberships

The API only shows direct group membership.

In the TinQwise learning platform, users are considered to be indirect members of the parent groups of the groups they are in.

Taking the example structure in Groups and group types via the API, a user will be considered to be an indirect member of the "Netherlands" group when they are in the "Amsterdam" group.


Groups filled by automations

Some groups are filled by automations (smart groups): the platform adds and removes members based on rules, for example everyone in the Netherlands group with a contract start date in the last 30 days.

Leave these groups to the automation. Your integration should manage memberships of the groups that come from your HR system, such as country, location or function, and the automations then use those memberships to fill the smart groups.

A smart group belongs to its automation. If the automation is enabled, the group always matches the users who meet its conditions. Pending users are not added to a smart group until they log in.

🚧 Be careful

Do not add or remove members of a group that an automation fills. The automation can remove members it did not add itself, for example when the rule is changed, and members you remove can come back. Ask your TinQwise contact which groups on your platform are filled by automations.

Disabling the automation removes every member from the group at once, including members you added by hand. Enabling it again makes the group exactly equal to the users who meet the conditions. Check which programmes, widgets and automations use the group before you disable it, because their access follows the group within a minute.

✏️ Tip

If a user meets the conditions but is missing from the group, disable and enable the automation, which re-syncs the whole group. You can also remove the user from the condition group and add them back.


Retrieving group memberships

Use the GET /api/v3/public/group_memberships/ endpoint to retrieve a list of all group memberships.

Filter on user_uuid to get the groups of one user, or on group_uuid to get the members of one group, for example /api/v3/public/group_memberships/?user_uuid=<uuid>. The list is paginated with limit (maximum 1000) and offset.

Field

Description

group_uuid

The uuid of the group.

user_uuid

The uuid of the user.


Creating group memberships

POST a user UUID and group UUID to /api/v3/public/group_memberships/ to add a user to a group.


Deleting group memberships

Send a DELETE to /api/v3/public/group_memberships/{group_uuid}/{user_uuid}/ to remove a user from a group.

🚧 Be careful

Be careful when deleting group memberships. Some group memberships are used for internal purposes, such as programme access (Programme group group type) or to keep track of which voucher was used to create the user (voucher group type).

✏️ Tip

In general, it is a good rule of thumb to only delete memberships of groups that are also created through the API.


Modifying group memberships

Memberships can not be modified. They can only be listed, created or deleted.

Did this answer your question?