---
title: "Add people to a community channel"
---

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

# Add people to a community channel

Path: Nicer API › Community

`POST /community/channels/{channelId}/members`

URL: `https://api.nicer.travel/community/channels/{channelId}/members`

Adds people of the agency, by userId (500 at most), to a channel of its community and answers the channel's whole member list. Anyone in the agency may add to a public channel; a private one takes one of its members or an admin. Adding someone already in it changes nothing. Errors: 400 ERROR_UNAUTHORIZED for a caller who may not add to a private channel, for a channel of another agency, or for a userId who is not an active member of the agency, and then nobody is added; 400 ERROR_COMPANY_REQUIRED and 403 ERROR_DO_NOT_HAVE_PERMISSION as on every community route.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `channelId` (`community.channels.members.create.path.channelId`; string, required)

## Request body

_Required._

- `userIds` (`community.channels.members.create.userIds`; array of string, required)
  - minLength: `1`

## Example request

```json
{
  "userIds": [
    "string"
  ]
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.community.channels.members.create({
  "channelId": "string",
  "userIds": [
    "string"
  ]
});
```

### Nicer CLI

```bash
nicer community channels members create --channel-id 'string' --input - <<'JSON'
{
  "userIds": [
    "string"
  ]
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/community/channels/<channelId>/members' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userIds": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/community/channels/<channelId>/members';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({userIds: ['string']})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/community/channels/<channelId>/members"

payload = { "userIds": ["string"] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "channelId": "string",
  "members": [
    {
      "userId": "string"
    }
  ]
}
```

- `channelId` (`community.channels.members.create.response.200.channelId`; string, required) — The channel.
- `members` (`community.channels.members.create.response.200.members`; array of object, required) — Everyone in the channel now.
  - `userId` (`community.channels.members.create.response.200.members.userId`; string, required) — The member's userId.

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`community.channels.members.create.response.400.errorCode`; string, required)
- `errorMessage` (`community.channels.members.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`community.channels.members.create.response.401.errorCode`; string, required)
- `errorMessage` (`community.channels.members.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`community.channels.members.create.response.403.errorCode`; string, required)
- `errorMessage` (`community.channels.members.create.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Community/community.channels.members.create/index.md
