Skip to main content
A group is a named set of users in one organization. Attach a group to a team, and every user in the group becomes a member of that team. Use a group when the same people need access to several teams, so you add them once instead of to each team’s roster. For how teams, members, and roles fit together, see Teams and members.

How groups work

  • A group belongs to one organization, and holds users who are members of that organization.
  • A group’s name is unique within its organization, ignoring capitals. Creating or renaming a group to a name that is already taken returns 409 with code group_name_taken.
  • A group grants nothing on its own. Access comes from attaching it to a team.
  • A group can be attached to any number of teams in its organization, and a team can have any number of groups.

What attaching a group to a team does

When you attach a group to a team, the group’s users become members of that team. They can:
  • use API keys bound to the team,
  • select the team in the console,
  • reach everything shared with the team, such as files, vector stores, and conversations.
They join as plain members. A group never makes anyone a team admin. The team’s member list shows its direct members only; the groups attached to it are listed separately. Access through a group follows the group. Remove a user from the group, or detach the group from the team, and the user loses the access it gave them, unless they are also a direct member of the team or in another group attached to it. Adding or removing access through a group takes effect within two minutes. Removing a user from the organization also removes them from all of its groups. Deleting a group detaches it from every team; the teams’ direct members are unaffected.

What groups do not do

  • No roles. A group has no role, and neither does its attachment to a team. Its users are plain members of every team it is attached to.
  • No organization-level roles. A group does not change anyone’s organization role. Roles are set per person, as described in Teams and members.
  • Users only. A group holds people, not service accounts. Adding a service account returns 400 with code group_user_not_human. Add a service account to a team directly instead.
  • Not filled from directory sync. You manage a group’s users yourself. Directory sync does not add users to groups or remove them.

Groups and directory sync

An organization owner or admin can add a user whose account is managed by directory sync to a group. That user then gets every team the group is attached to, even though the directory does not control that access. This is allowed on purpose: the directory manages team rosters, not group rosters. A team managed by directory sync does not accept new group attachments. Attaching a group to it returns 403 with code SCIM_MANAGED_TEAM. A group that was already attached to the team stays attached, and you can still detach it.

Before you start

  • Role. Organization owners and admins create, rename, and delete groups, change a group’s users, and attach groups to teams. Any member of the organization can list groups and read them.
  • API key. Use a key that belongs to a person, not a service account: service account keys cannot call the group endpoints. To change groups, the key must belong to an owner or admin. To read them, any member’s key works.
  • Scopes. Reading groups and their users needs read:groups. Changing them needs write:groups. Attaching and detaching a group changes a team, so it uses the team scopes, read:teams and write:teams.
A key created before groups were available does not hold read:groups or write:groups, even an organization owner’s key with every scope. It gets 403 from the group endpoints. A key cannot grant itself a scope it does not hold, so sign in to the console and add the scopes to the key under Access → API Keys, or create a new key that includes them.
The examples below use these placeholders:

Create a group

Send a name of 1 to 120 characters. The response returns the group with its id.
Response

Add a user to the group

The user must already be a member of your organization. A user who is not a member returns 404. Adding a user who is already in the group changes nothing and returns 200 with the existing membership.
To take a user out of the group, send DELETE to /orgs/<org-id>/groups/<group-id>/users/<user-id>. Within two minutes they lose the teams the group gave them, except a team they also reach as a direct member or through another group.

Attach the group to a team

Attaching needs write:teams, not write:groups. Attaching a group that is already attached changes nothing and returns 200 with the existing attachment.
The group’s users can use the team within two minutes. To see which teams a group is attached to, read the group: GET /orgs/<org-id>/groups/<group-id> returns them in teams. To list the groups attached to a team, send GET to /orgs/<org-id>/teams/<team-id>/groups. To detach a group, send DELETE to /orgs/<org-id>/teams/<team-id>/groups/<group-id>; the group and its users are unchanged.

Manage groups in the console

Managing groups in the console is coming soon.

See also