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

# Create Group

> Create a workspace group with a unique name and an optional description

This endpoint creates a group. The new group has no members. Add them with [Add Group Members](https://docs.langdock.com/en/developer/user-management-api/add-group-members.md).

The call is authorized by the workspace API key's `USER_MANAGEMENT_API` scope. It does not run as the person who created the key, so it keeps working after that admin leaves the workspace.

## Base URL

```
https://api.langdock.com/user-management/v1/groups
```

> [!WARNING]
>
> **Dedicated deployments**
>
> Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.

## Prerequisites

* **API Key** with the `USER_MANAGEMENT_API` scope
* The API key must be created by a workspace admin

## Behavior

* `name` is required. It is trimmed and at most 100 characters. An empty name returns `400`.
* `description` is optional. Omit it and the description is empty. It is trimmed and at most 2000 characters.
* Unknown fields, including `isPublic`, return `400`. The new group is not public.
* The API key's creator is not added to the group. `memberCount` is `0` and `isScimManaged` is `false`.
* **A group already uses this name, ignoring case?** Returns `409` with `code: "GROUP_NAME_TAKEN"` and message `A group with this name already exists.`
* The product UI and SCIM can still contain groups that share a name. This check applies when you create or rename a group through this API.
* Returns `201` with `{ "group": { ... } }`. The fields match [List Groups](https://docs.langdock.com/en/developer/user-management-api/list-groups.md).

> [!NOTE]
>
> Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on [API Key Best Practices](https://docs.langdock.com/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.