# Add group members

`POST /group.add`

## Description

Add one or more group members with specified roles.

Members can be specified by user ID or email address. Each member must be assigned a role (member or admin).

Apps may add members to a group if one of the following conditions is true:
1. It is a public group in their Roam.
2. They are a member of the group.

If attempting to add an admin, the app must be an admin of the group.

**Required scope:** `group:write`

---

**OpenAPI Spec:** [chat-v1.json](https://developer.ro.am/chat-v1.json)

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Request Body

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | string | Yes | Group ID |
| `members` | object[] | No | List of members to add with their roles |

**members** (array item):

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `userId` | string | Yes | User ID or email address |
| `role` | "member" | "admin" | Yes | Role for this member |

## Responses

### 204 - Members added successfully

### 400 - Invalid request, e.g. group does not exist or incorrect user IDs.

### 401 - Unauthorized.

### 403 - App does not have permission to add members to this group.

### 500 - An internal error occurred.

---

*Machine-readable API documentation.*
*Full documentation: https://developer.ro.am/docs/api/group-add*
