---
title: "List tasks"
---

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

Path: Nicer API › Notes and tasks

`GET /crm/tasks`

URL: `https://api.nicer.travel/crm/tasks`

Lists open tasks of exactly one of: the caller (assignedUserId=me), another person (their user id, for an admin), one traveler (travelerId) or one trip (travelersTripId). completed=true lists the done ones instead. 50 a page unless limit says otherwise, each page soonest first and the undated last; send the answer's nextToken back to read the next page, until it is null. Each task names what it is about: travelerName, or tripName with the trip's associatedTripItineraryId. Errors: 400 ERROR_INVALID_QUERY for none or more than one of assignedUserId, travelerId and travelersTripId, a value out of range or a nextToken of another list; 403 ERROR_UNAUTHORIZED for another person's tasks unless the caller is an admin; 404 ERROR_ITEM_NOT_FOUND for a traveler or trip the caller may not see.

## Authentication

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

## Query parameters

- `assignedUserId` (`crm.tasks.list.query.assignedUserId`; string, optional) — A person's tasks: their user id, or me for yours. Send exactly one of assignedUserId, travelerId and travelersTripId.
  - minLength: `1`
- `completed` (`crm.tasks.list.query.completed`; string, optional) — true lists the done tasks instead of the open ones; false, or left out, the open ones.
- `limit` (`crm.tasks.list.query.limit`; integer, optional) — How many tasks a page holds, 1 to 100; 50 when left out.
  - maximum: `100` · minimum: `1`
- `nextToken` (`crm.tasks.list.query.nextToken`; string, optional) — The nextToken of the page before, to read the next one; left out for the first page.
  - minLength: `1`
- `travelerId` (`crm.tasks.list.query.travelerId`; string, optional) — A traveler's tasks (TRV…). Send exactly one of assignedUserId, travelerId and travelersTripId.
  - maxLength: `64` · minLength: `1`
- `travelersTripId` (`crm.tasks.list.query.travelersTripId`; string, optional) — A trip's tasks (TT…). Send exactly one of assignedUserId, travelerId and travelersTripId.
  - minLength: `1`

## Header parameters

- `x-nicer-company` (`crm.tasks.list.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.
- `X-Nicer-CRM-Contract` (`crm.tasks.list.header.X-Nicer-CRM-Contract`; string, required)
  - one of `"resource"` · example: `"resource"`

## Code samples

### JavaScript SDK

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

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

await nicer.crm.tasks.list();
```

### Nicer CLI

```bash
nicer crm tasks list --company "$NICER_COMPANY"
```

### cURL

```bash
curl --request GET \
  --url https://api.nicer.travel/crm/tasks \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Nicer-CRM-Contract: resource' \
  --header 'x-nicer-company: string'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/crm/tasks';
const options = {
  method: 'GET',
  headers: {
    'x-nicer-company': 'string',
    'X-Nicer-CRM-Contract': 'resource',
    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/crm/tasks"

headers = {
    "x-nicer-company": "string",
    "X-Nicer-CRM-Contract": "resource",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "items": [
    {
      "assignedUserId": "string",
      "associatedTripItineraryId": "string",
      "companyName": "string",
      "completed": true,
      "completedAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z",
      "createdBy": "string",
      "lastModifiedBy": "string",
      "notes": "string",
      "origin": "ANNIVERSARY",
      "taskId": "string",
      "tentativeDate": "2019-08-24",
      "title": "string",
      "travelerId": "string",
      "travelerName": "string",
      "travelersTripId": "string",
      "tripName": "string",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "nextToken": "string"
}
```

- `items` (`crm.tasks.list.response.200.items`; array of object, required) — The items of this page.
  - `assignedUserId` (`crm.tasks.list.response.200.items.assignedUserId`; any of, required) — The advisor or admin who should do it; null when nobody is assigned.
    - any of the following: `string`, `null`
  - `associatedTripItineraryId` (`crm.tasks.list.response.200.items.associatedTripItineraryId`; any of, required) — The itinerary (TI…) of the trip the task is about, when it has one; null otherwise.
    - any of the following: `string`, `null`
  - `companyName` (`crm.tasks.list.response.200.items.companyName`; string, required) — The agency the task belongs to.
  - `completed` (`crm.tasks.list.response.200.items.completed`; boolean, required) — Whether the task is done.
  - `completedAt` (`crm.tasks.list.response.200.items.completedAt`; any of, required) — When the task was marked done; null while it is open.
    - any of the following: `string`, `null`
  - `createdAt` (`crm.tasks.list.response.200.items.createdAt`; string, required) — When the task was created.
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `createdBy` (`crm.tasks.list.response.200.items.createdBy`; string, required) — The user id of who created it, or SYSTEM for the CRM.
  - `lastModifiedBy` (`crm.tasks.list.response.200.items.lastModifiedBy`; string, required) — The user id of who changed it last, or SYSTEM for the CRM.
  - `notes` (`crm.tasks.list.response.200.items.notes`; any of, required) — More about it; null when there is none.
    - any of the following: `string`, `null`
  - `origin` (`crm.tasks.list.response.200.items.origin`; string, required) — How the task was made.
    - one of `"ANNIVERSARY"`, `"BIRTHDAY"`, `"DOCUMENT_EXPIRY"`, `"MANUAL"`, `"TEMPLATE"`
  - `taskId` (`crm.tasks.list.response.200.items.taskId`; string, required) — The task's id: what updateTask and deleteTask take.
  - `tentativeDate` (`crm.tasks.list.response.200.items.tentativeDate`; any of, required) — When it should be done, as a date; null when undated.
    - any of the following: `string`, `null`
  - `title` (`crm.tasks.list.response.200.items.title`; string, required) — What to do, in a few words.
  - `travelerId` (`crm.tasks.list.response.200.items.travelerId`; any of, required) — The traveler the task is about; null for a task about a trip. A task is about one traveler or one trip.
    - any of the following: `TravelerId`, `null`
  - `travelerName` (`crm.tasks.list.response.200.items.travelerName`; any of, required) — The traveler's name as the agency knows them, read when the task is answered; null for a task about a trip.
    - any of the following: `string`, `null`
  - `travelersTripId` (`crm.tasks.list.response.200.items.travelersTripId`; any of, required) — The trip (TT…) the task is about; null for a task about a traveler.
    - any of the following: `string`, `null`
  - `tripName` (`crm.tasks.list.response.200.items.tripName`; any of, required) — The trip's name, read when the task is answered; null for a task about a traveler or a trip without a name.
    - any of the following: `string`, `null`
  - `updatedAt` (`crm.tasks.list.response.200.items.updatedAt`; string, required) — When the task last changed.
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
- `nextToken` (`crm.tasks.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` (`crm.tasks.list.response.400.errorCode`; string, required)
- `errorMessage` (`crm.tasks.list.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`crm.tasks.list.response.401.errorCode`; string, required)
- `errorMessage` (`crm.tasks.list.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`crm.tasks.list.response.403.errorCode`; string, required)
- `errorMessage` (`crm.tasks.list.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Notes-and-tasks/crm.tasks.list/index.md
