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
409with codegroup_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.
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
400with codegroup_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 returns403 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 needswrite:groups. Attaching and detaching a group changes a team, so it uses the team scopes,read:teamsandwrite:teams.
Create a group
Send a name of 1 to 120 characters. The response returns the group with itsid.
Response
Add a user to the group
The user must already be a member of your organization. A user who is not a member returns404. Adding a user who is already in the group changes nothing and returns 200 with the existing membership.
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 needswrite:teams, not write:groups. Attaching a group that is already attached changes nothing and returns 200 with the existing attachment.
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
- Teams and members - organizations, teams, roles, and invitations.
- Service accounts - non-human callers, which join teams directly.
- Authentication - API keys and scopes.
- API reference - request and response schemas for the MKA1 API.