---
title: groups-v2 command group
description: Learn how to use the Databricks CLI groups-v2 commands
canonical_url: https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands
---

# `groups-v2` command group

> [!NOTE]
>
> Databricks CLI use is subject to the [Databricks License](https://github.com/databricks/cli?tab=License-1-ov-file#readme) and [Databricks Privacy Notice](https://www.databricks.com/legal/privacynotice), including any Usage Data provisions.

The `groups-v2` command group within the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/index.md) allows you to manage groups in the Databricks workspace. Groups simplify identity management, making it easier to assign access to Databricks workspace, data, and other securable objects. It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, instead of to users individually.

## databricks groups-v2 create

Create a new group in the Databricks workspace with a unique name.

```
databricks groups-v2 create [flags]
```

#### Arguments

None

#### Options

**`--display-name string`**

    String that represents a human-readable group name.

**`--external-id string`**

    External ID for the group.

**`--id string`**

    Databricks group ID.

**`--json JSON`**

    The inline JSON string or the @path to the JSON file with the request body.

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example creates a new group:

```bash
databricks groups-v2 create --display-name "Data Engineers"
```

## databricks groups-v2 delete

Delete a group from the Databricks workspace.

```
databricks groups-v2 delete ID [flags]
```

#### Arguments

**`ID`**

    Unique ID for a group in the Databricks workspace.

#### Options

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example deletes a group:

```bash
databricks groups-v2 delete 12345678
```

## databricks groups-v2 get

Get information for a specific group in the Databricks workspace.

```
databricks groups-v2 get ID [flags]
```

#### Arguments

**`ID`**

    Unique ID for a group in the Databricks workspace.

#### Options

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example gets group details:

```bash
databricks groups-v2 get 12345678
```

## databricks groups-v2 list

Get all details of the groups associated with the Databricks workspace.

```
databricks groups-v2 list [flags]
```

#### Arguments

None

#### Options

**`--attributes string`**

    Comma-separated list of attributes to return in response.

**`--count int`**

    Desired number of results per page.

**`--excluded-attributes string`**

    Comma-separated list of attributes to exclude in response.

**`--filter string`**

    Query by which the results have to be filtered.

**`--sort-by string`**

    Attribute to sort the results.

**`--sort-order ListSortOrder`**

    The order to sort the results. Supported values: `ascending`, `descending`

**`--start-index int`**

    Specifies the index of the first result.

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example lists all groups:

```bash
databricks groups-v2 list
```

The following example lists groups matching a filter:

```bash
databricks groups-v2 list --filter "displayName sw \"Data\""
```

## databricks groups-v2 patch

Partially update the details of a group.

```
databricks groups-v2 patch ID [flags]
```

#### Arguments

**`ID`**

    Unique ID in the Databricks workspace.

#### Options

**`--json JSON`**

    The inline JSON string or the @path to the JSON file with the request body.

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example patches a group using a JSON file:

```bash
databricks groups-v2 patch 12345678 --json @patch.json
```

## databricks groups-v2 update

Update the details of a group by replacing the entire group entity.

```
databricks groups-v2 update ID [flags]
```

#### Arguments

**`ID`**

    Databricks group ID.

#### Options

**`--display-name string`**

    String that represents a human-readable group name.

**`--external-id string`**

    External ID for the group.

**`--json JSON`**

    The inline JSON string or the @path to the JSON file with the request body.

[Global flags](https://docs.databricks.com/aws/en/dev-tools/cli/reference/groups-v2-commands.md#global-flags)

#### Examples

The following example updates a group's display name:

```bash
databricks groups-v2 update 12345678 --display-name "Data Engineers Team"
```

## <a id="global-flags" />Global flags

**`--debug`**

  Whether to enable debug logging.

**`-h` or `--help`**

    Display help for the Databricks CLI or the related command group or the related command.

**`--log-file` string**

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

**`--log-format` format**

    The log format type, `text` or `json`. The default value is `text`.

**`--log-level` string**

    A string representing the log format level. If not specified then the log format level is disabled.

**`-o, --output` type**

    The command output type, `text` or `json`. The default value is `text`.

**`-p, --profile` string**

    The name of the profile in the `~/.databrickscfg` file to use to run the command. If this flag is not specified then if it exists, the profile named `DEFAULT` is used.

**`--progress-format` format**

    The format to display progress logs: `default`, `append`, `inplace`, or `json`

**`-t, --target` string**

    If applicable, the bundle target to use
