# createViewGroup

Mutation

Create a user-created view group for the current workspace.

Available to agents as MCP tool `createViewGroup` — see [Write tools](/api/v2/docs/mcp/write-tools#create-view-group).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `input` | [`CreateViewGroupInput!`](/api/v2/docs/types/create-view-group-input) | Yes | — | Mutation input. |

## Returns

| Name | Type | Description |
| --- | --- | --- |
| `userErrors` | [`[UserError!]!`](/api/v2/docs/types/user-error) | List of user-facing validation errors. Empty on success. |
| `viewGroup` | [`ViewGroup`](/api/v2/docs/types/view-group) | The newly created view group. Null on validation failure. |

## Examples

### Create a view group

Create a user-created view group for organizing saved views.

```graphql
mutation CreateViewGroupDefault($input: CreateViewGroupInput!) {
  createViewGroup(input: $input) {
    viewGroup {
      id
      name
    }
    userErrors {
      field
      message
    }
  }
}
```

Variables:

```json
{
  "input": {
    "name": "Campaign Shortlists"
  }
}
```

Response — HTTP 200:

```json
{
  "data": {
    "createViewGroup": {
      "viewGroup": {
        "id": "2e231afc-0359-5154-ba16-4915a7801f73",
        "name": "Campaign Shortlists"
      },
      "userErrors": []
    }
  }
}
```
