> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/001_user/007_groups/006__create_group.md).

# Create Group

GraphQL endpoint: `/user`

Creates a new group. The user creating the group automatically becomes an admin member. Groups can have different visibility settings to control who can see and join them.

## Query

```graphql
mutation (
  $name: String!
  $metadata: JSON
  $visibility: [GroupVisibilityType!]
) {
  createGroup (
    name: $name
    metadata: $metadata
    visibility: $visibility
  ) {
    id
    }
  }

```

## Variables

```json
{
  "metadata": {
    "test": "value"
  },
  "name": "test group",
  "visibility": [
    "PRIVATE"
  ]
}
```

## Response

```json
{
  "data": {
    "createGroup": {
      "id": "00000000-0000-4000-8000-000000000001"
    }
  }
}
```
