> ## 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.

# Add Group Members

> Add active workspace members to a group by email, with a group role

This endpoint adds up to 250 active workspace members to a group by email. `role` is optional and defaults to `member`.

A `200` response can still leave some emails unchanged. Check `added`, `alreadyMembers`, and `notFound`.

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/{groupId}/members
```

> [!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

* Send 1 to 250 members. An empty list returns `400`.
* `role` is `member`, `editor`, or `admin`. Another value returns `400`.
* `added` and `alreadyMembers` each list members, with `id`, `email`, `name`, `role`, and `addedAt`. `alreadyMembers` is people who were already in the group. `notFound` is the list of email strings for people who are not active human members, including pending invites, inactive members, service accounts, and unknown emails.
* Someone who is already in the group keeps their role, unless they are a workspace admin and this call also adds someone else. A workspace admin is then stored as group `admin`.
* A new member who is a workspace admin is stored as group `admin`, even when you send `member` or `editor`. The returned `role` is the role that was stored.
* Invite someone first with [Invite Users](https://docs.langdock.com/en/developer/user-management-api/invite.md). Add them after they have joined.
* Email matching ignores case. If the same email appears twice, the first `role` is used.
* **SCIM managed group?** Returns `409` with `code: "GROUP_SCIM_MANAGED"` and message `This group is managed by SCIM and cannot be changed through the API.`
* **Unknown group, a deleted group, or another workspace?** Returns `404` with `code: "GROUP_NOT_FOUND"` and message `Group not found.`
* **`groupId` is not a UUID?** Returns `400`.

> [!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.