---
title: "List a person's referrals"
---

> 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 a person's referrals

Path: Nicer API › identity

`GET /identity/{userId}/referrals`

URL: `https://api.nicer.travel/identity/{userId}/referrals`

Lists the people someone referred to the agency the request acts for: those they invited who joined (type User) and their invitations not accepted yet (type Invite), each with its date and name. Pages with limit and nextToken. Advisors and admins read their own; an admin also those of an active member of the agency, and Nicer staff anyone's. Errors: 400 ERROR_UNAUTHORIZED for someone else's referrals the caller may not read.

## Authentication

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

## Path parameters

- `userId` (`identity.referrals.list.path.userId`; string, required)

## Query parameters

- `limit` (`identity.referrals.list.query.limit`; string, optional) — How many rows a page reads: 1000 when absent. The agency and where apply after the read, so a page can hold fewer.
- `nextToken` (`identity.referrals.list.query.nextToken`; string, optional) — Where the page starts: the nextToken of the previous page.
- `orderBy` (`identity.referrals.list.query.orderBy`; string, optional) — ASC, the default, reads the rows in ascending order; any other value in descending order.
- `where` (`identity.referrals.list.query.where`; string, optional) — Which rows to keep, on top of the agency the request acts for. A condition is field:operator:value with eq, neq, gt, gte, lt, lte, like, beginsWith, exists, inq or between (inq and between take values joined by |), several of one object joined by commas; and(…;…) and or(…;…) combine them. Example: type:eq:User.

## 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.identity.referrals.list({
  "userId": "string"
});
```

### Nicer CLI

```bash
nicer identity referrals list --user-id 'string'
```

### cURL

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

### TypeScript

```typescript
const url = 'https://api.nicer.travel/identity/<userId>/referrals';
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/identity/<userId>/referrals"

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "items": [
    {
      "createdAt": "string",
      "fullName": "string",
      "type": "Invite",
      "userId": "string"
    }
  ],
  "nextToken": "string"
}
```

- `items` (`identity.referrals.list.response.200.items`; array of object, required) — The items of this page.
  - `createdAt` (`identity.referrals.list.response.200.items.createdAt`; string, required)
  - `type` (`identity.referrals.list.response.200.items.type`; string, required)
    - one of `"Invite"`, `"User"`
  - `userId` (`identity.referrals.list.response.200.items.userId`; string, required)
  - `fullName` (`identity.referrals.list.response.200.items.fullName`; any of, optional)
    - any of the following: `string`, `null`
- `nextToken` (`identity.referrals.list.response.200.nextToken`; any of, required) — Send it back as nextToken to read the next page; null on the last page.
  - any of the following: `string`, `null`

### 400

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

#### Example

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

- `errorCode` (`identity.referrals.list.response.400.errorCode`; string, required)
- `errorMessage` (`identity.referrals.list.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`identity.referrals.list.response.401.errorCode`; string, required)
- `errorMessage` (`identity.referrals.list.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`identity.referrals.list.response.403.errorCode`; string, required)
- `errorMessage` (`identity.referrals.list.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/identity/identity.referrals.list/index.md
