---
title: "List community direct messages"
---

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

# List community direct messages

Path: Nicer API › Community

`GET /community/dm`

URL: `https://api.nicer.travel/community/dm`

Lists the direct-message conversations the caller is in at the agency the request acts for, 30 a page unless limit says otherwise (100 at most); send the answer's nextCursor back as cursor for the next page, until it is absent. A conversation with fewer than two people is left out. Any member of the agency may call it. Errors: 400 ERROR_COMPANY_REQUIRED for a request that names no agency; 403 ERROR_DO_NOT_HAVE_PERMISSION for an agency the caller does not belong to.

## Authentication

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

## Query parameters

- `cursor` (`community.dm.list.query.cursor`; string, optional)
- `limit` (`community.dm.list.query.limit`; string, optional)

## 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.dm.list();
```

### Nicer CLI

```bash
nicer community dm list
```

### cURL

```bash
curl --request GET \
  --url https://api.nicer.travel/community/dm \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/community/dm';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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/dm"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "dms": [
    {
      "dmId": "string",
      "companyName": "string",
      "participants": [
        "string"
      ],
      "createdAt": "string"
    }
  ],
  "nextCursor": "string"
}
```

- `dms` (`community.dm.list.response.200.dms`; array of object, required)
  - `dmId` (`community.dm.list.response.200.dms.dmId`; string, required) — The conversation's id, the same whenever the same people talk.
  - `companyName` (`community.dm.list.response.200.dms.companyName`; string, required) — The agency the conversation belongs to.
  - `participants` (`community.dm.list.response.200.dms.participants`; array of string, required) — The userIds of everyone in the conversation, the caller among them.
  - `createdAt` (`community.dm.list.response.200.dms.createdAt`; string, required) — When the conversation was created, as ISO 8601 text.
- `nextCursor` (`community.dm.list.response.200.nextCursor`; string, optional) — Send it back as cursor for the next page; absent on the last page.

### 400

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

#### Example

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

- `errorCode` (`community.dm.list.response.400.errorCode`; string, required)
- `errorMessage` (`community.dm.list.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`community.dm.list.response.401.errorCode`; string, required)
- `errorMessage` (`community.dm.list.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`community.dm.list.response.403.errorCode`; string, required)
- `errorMessage` (`community.dm.list.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Community/community.dm.list/index.md
