# IRPCDocClassGroupsAdmin.AddDocClassGroup

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Class groups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/AddDocClassGroup/

Badges: `Administration API / specialized` `admin` `session`

Creates a class group.

- **Service:** [Class groups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/index.md) `MFiles.IRPCDocClassGroupsAdmin`
- **gRPC method:** `/MFiles.IRPCDocClassGroupsAdmin/AddDocClassGroup`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-doc-class-group`
- **Request:** [`AddDocClassGroupRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/AddDocClassGroup/index.md#request)
- **Response:** [`AddDocClassGroupResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCDocClassGroupsAdmin/AddDocClassGroup/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires `change_metadata_structure` and `license_allows_modifications`.
- Only document classes can be grouped: `object_type` must be 0 (Document), otherwise the call
  fails with an invalid-argument error.
- Increments the metadata structure version.

<a id="request"></a>

## Request: AddDocClassGroupRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `class_group` | [`ClassGroup`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ClassGroup/index.md) | The new [ClassGroup](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ClassGroup/index.md) with its name and member classes. `id` is ignored and assigned by the server. |
| `class_group.id` | `int32` | The ID of the class group (an item ID in value list 2, Class groups). |
| `class_group.name` | `string` | The name of the group. |
| `class_group.member_classes[]` | repeated `int32` | The IDs of the classes in the group. |
| `class_group.object_type` | `int32` | The object type with which this class group is used. |

<a id="response"></a>

## Response: AddDocClassGroupResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `id` | `int32` | The ID of the new class group. |
