> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Group

> Groups organize users and service accounts for access control. Supports direct membership assignment and dynamic query-based membership rules.

## Overview

A group is a membership collection that can contain [users](https://docs.controlplane.com/reference/user.md) and [service accounts](https://docs.controlplane.com/reference/serviceaccount.md). It is one of the [principal types](https://docs.controlplane.com/concepts/access-control.md) of an [org](https://docs.controlplane.com/reference/org.md).

Membership in a group for a user account can be assigned directly or dynamically using a query based on a [tag](https://docs.controlplane.com/core/misc.md#tags) (key/value pair) that has been labeled on a user.

Membership in a group for a [service account](https://docs.controlplane.com/reference/serviceaccount.md) can only be assigned directly.

Groups can be used by [policies](https://docs.controlplane.com/reference/policy.md) to grant access permissions to the group members.

## Create a Group

Refer to the [Create a Group](https://docs.controlplane.com/guides/create-group.md) guide for additional details.

## Built-in Groups

Each [org](https://docs.controlplane.com/reference/org.md) has the following built-in groups:

| Group Name | Description |
| :- | :- |
| superusers | Built-in group for all administrators of the organization |
| viewers | Built-in group for read-only access |

### Synthetic Groups

Control Plane maintains two further groups itself. They carry `origin: synthetic`, hold no `memberLinks`, and cannot be created, edited, or deleted. Neither appears in `cpln group get`, but either can be read by name.

| Group Name | Represents |
| :- | :- |
| `-allmembers` | Every user, group, and service account in the org. It is added to the principal list on every authenticated request, so a binding on it reaches everyone. The [built-in policy](https://docs.controlplane.com/reference/policy.md#built-in-policies) on the `org` kind uses it to grant all members `view`. |
| `-anonymous` | Unauthenticated callers. It is added to the principal list on every request, authenticated or not, so a binding on it reaches everyone. |

## Group Notes

Groups can contain an unlimited amount of [users](https://docs.controlplane.com/reference/user.md) or [service accounts](https://docs.controlplane.com/reference/serviceaccount.md).

Group membership can be assigned directly or dynamically (using a [query](#query-rules) based on any [tags](https://docs.controlplane.com/core/misc.md#tags) that are labeled on a [user](https://docs.controlplane.com/reference/user.md)). [Service Accounts](https://docs.controlplane.com/reference/serviceaccount.md) can only be assigned directly.

For example, a [query](#query-rules) can be created to dynamically assign all the users that log in using `microsoft.com` by using the built-in tag key `firebase/sign_in_provider` Equals `microsoft.com`.

## Query Rules

To dynamically assign users to a group, a query can be defined which consists of the following:

* One or more [tags](https://docs.controlplane.com/core/misc.md#tags) (key/value pairs) using one of the operators: `Equals` / `Exists` / `Not Exists`
* One of the following query filters:
  * `All`: All [tag](https://docs.controlplane.com/core/misc.md#tags) items should match
  * `Any`: Any of the [tags](https://docs.controlplane.com/core/misc.md#tags) should match
  * `None`: None of these [tags](https://docs.controlplane.com/core/misc.md#tags) should match

## Permissions

The permissions below are used to define [policies](https://docs.controlplane.com/reference/policy.md) together with one or more of the four
[principal types](https://docs.controlplane.com/concepts/access-control.md):

| Permission | Description | Implies |
| :- | :- | :- |
| create | Create new groups | |
| delete | Delete a group | |
| edit | Modify existing groups | view |
| manage | Full access | create, delete, edit, manage, view |
| view | Read-only view | |

## Access Report

Displays the permissions granted to principals for the group. See [Access Report](https://docs.controlplane.com/concepts/access-control.md#access-report) for what each entry shows, how to open it from the Console, CLI, or API, and how groups, query targets, and implied permissions appear in it.

## Event Log

Lists the events recorded for the group. See the [Event Log reference](https://docs.controlplane.com/reference/events.md) for field details.

## CLI

To view the CLI documentation for groups, see the [Group CLI reference](https://docs.controlplane.com/cli-reference/commands/group.md).
