---
title: "Travelers and the CRM"
description: "Who a traveler is, how one enters an agency, who sees them, and how to follow every change."
---

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

# Travelers and the CRM

The CRM is the one place a person lives in Nicer. A **traveler** is someone an
agency serves: they belong to that agency, have an id of their own
(`travelerId`), and exist whether or not they have a Nicer account. A child, a
client who never signs in and a client with the app are all travelers. A person
who travels with two agencies is two travelers, one in each, and neither agency
sees the other's.

| Part | What it holds | Read it with |
| --- | --- | --- |
| The traveler | Legal name as printed on their travel document, preferred name, contact, address, birth date, nationality, frequent flyer numbers, tags, custom fields, the advisors who serve them, and a stage: `LEAD` until their first confirmed booking, then `CLIENT` | `GET /crm/travelers/{travelerId}` |
| Travel profile | How they fly and stay, dietary and accessibility needs, loyalty programs, emergency contacts, interests and pets | the same route |
| Dates, relationships, trips | Anniversaries, the travelers they are related to, the trips they are on | the same route |
| Documents | Passports, visas, national IDs, Known Traveler and redress numbers, with their full numbers | `GET /crm/travelers/{travelerId}/documents` |
| Notes and tasks | What the agency knows about them and has to do for them | `GET /crm/notes`, `GET /crm/tasks` |
| Timeline | Everything that happened to them, newest first | `GET /crm/travelers/{travelerId}/activity` |

Every route lives under `/crm` and needs a [company user](https://docs.nicer.travel/developers/authentication),
except the self-service and profile form routes described below.

## Finding or adding a traveler

A person enters an agency's CRM through one door. Whatever brings them in — a
sign-up, a referral link, a checkout, a trip's list of travelers or an import —
Nicer looks for the agency's traveler with the same account first, then the same
email, then the same phone, and adds a new one only when nothing matches, so a
person who arrives twice is still one traveler.

| Route | What it does |
| --- | --- |
| `GET /crm/travelers?q=ana` | Searches by name, email or phone; `q` matches the start of any word |
| `POST /crm/travelers` | Adds one traveler; only the legal name is required |
| `POST /crm/travelers/import` | Adds up to 200 at once; a row whose email or phone the agency already has comes back `MATCHED` |
| `POST /crm/travelers/{travelerId}/merge` | Folds a duplicate into the traveler you keep |

```http
POST /crm/travelers HTTP/1.1
Host: api.nicer.travel
Authorization: Bearer <access-token>
Idempotency-Key: 0b9f6a52-7d1e-4c3a-9e2b-5f8d4c1a7e60
Content-Type: application/json

{
  "name": { "givenName": "Ana", "middleName": null, "familyName": "Pérez" },
  "contact": { "email": "ana@example.com", "phone": "+525512345678" }
}
```

A legal name has both parts. When Nicer adds a traveler nobody named in full,
such as a person invited to a trip as "David", or by a phone alone, it writes
`-` for the family name and `Traveler` for the given name
(`UNKNOWN_FAMILY_NAME` and `UNKNOWN_GIVEN_NAME` in
`@nicer/catalog/shared/person`). Show them, but never copy them as the person's
own name.

Adding someone by hand with `POST /crm/travelers` always adds them, and answers
the travelers who may be the same person in `possibleDuplicates`: `HIGH` for the same email, `MEDIUM` for
the same phone or the same name and birth date. A merge keeps the surviving
traveler's values, fills its empty fields from the duplicate and takes over its
documents, notes, tasks, relationships, trips and account; the duplicate's id
keeps answering as the survivor.

To hide a traveler without losing anything, set `isArchived` with
`PUT /crm/travelers/{travelerId}`. An admin can erase
one for good with `DELETE /crm/travelers/{travelerId}`: their profile,
documents, dates, relationships, notes, tasks, trips and timeline are gone, while
bookings already made keep their own copy of their travelers.

## Advisors and who sees a traveler

`assignedAdvisorUserId` is the advisor responsible for the traveler, and
`contributingAdvisorIds` lists every advisor who serves them, the assigned one
included. A traveler an advisor adds is theirs. Only admins assign or change
advisors; an advisor who tries gets 403 `ERROR_UNAUTHORIZED`. The CRM is the only
record of who serves whom: the rest of Nicer, such as the direct chat and the
advisor on the traveler's trips, follows it through
`crm.traveler-advisors-changed.v1`. When an advisor stops working for the
agency (their account is deleted, or an admin turns their portal off), they
stop serving their travelers, and the ones assigned to them wait unassigned
for an admin to assign them again.

`visibility` decides who else sees the traveler:

| Value | Who sees the traveler |
| --- | --- |
| `ADVISORS` | The advisors who serve them, and the agency's admins |
| `COMPANY` | Every advisor of the agency |

A new traveler takes the agency's `defaultVisibility` from `GET /crm/settings`
unless the request names one. `GET /crm/travelers` lists the travelers the
calling advisor serves, and `scope=COMPANY` adds the ones shared with every
advisor; admins see them all, or one advisor's with `assignedAdvisorUserId`.
`userId` answers the traveler linked to that Nicer account, if the agency has
one the caller may see. A traveler the caller may not see answers 404
`ERROR_ITEM_NOT_FOUND`, exactly like one that does not exist.

Every page of `GET /crm/travelers` carries `total`, how many travelers the
whole list holds with its filters (`stage`, `tag`, `isArchived`, the
advisor's), the same on every page. It is `null` when the list cannot be
counted without reading every traveler: a search with `q`, or a segment that
filters by document expiry or by the next trip.

## Documents

Documents have routes of their own:

- `GET /crm/travelers/{travelerId}/documents` answers each document with its full
  number, kind, issuing country and dates, in the shape a reservation takes.
- `PUT /crm/travelers/{travelerId}/documents` keeps exactly the documents in the
  body: a stored document left out is removed, one sent with its `documentId` is
  replaced, and one sent without is added.

The kinds are `PASSPORT`, `VISA`, `NATIONAL_ID`, `RESIDENCE_PERMIT`,
`DRIVER_LICENSE`, `KNOWN_TRAVELER_NUMBER` and `REDRESS_NUMBER`. Full numbers are
answered only where someone needs them: these routes, a trip's travelers (a
checkout needs them whole) and the traveler's own self-service. They never
appear in the traveler or the list of travelers, the timeline, an event or a
webhook — `crm.traveler-documents-changed.v1` names only the kinds that changed —
and Nicer's assistant cannot read documents at all.

> **Read a number only to use it**
>
> Fetch documents when you are about to fill a booking, not to keep a copy, and
> never log a response from these routes.

## Trips and checkout

A trip's travelers are people of the agency, with or without an account.
Membership of the trip in `travelers-trip` says who may open its itinerary; the
CRM says who travels. A person invited to a trip without an account
(`POST /travelers-trip/{travelersTripId}/invite` with an email, a phone or just
a name) becomes the agency's traveler on the trip. They join the trip itself,
and see its itinerary, when they sign up with that email or phone, at any
agency: the CRM links their account and `crm.traveler-linked.v1` names the
trips to join in `travelersTripIds`.

- `GET /crm/trips/{travelersTripId}` answers the trip's `salesStage`, its
  `primaryTravelerId`, its `associatedTripItineraryId` and each traveler as a
  `participant`: legal name, birth date, sex, nationality, contact, address,
  documents and frequent flyer memberships, in exactly the shape a checkout's
  order participant takes, so a checkout copies it without mapping a field.
- `PUT /crm/trips/{travelersTripId}` keeps exactly the travelers in the body,
  with the trip's `revision` as you read it. Send a known traveler by
  `travelerId`, or a person as a `participant` the way a checkout collects
  them: Nicer finds them by email or phone, or adds them to the agency. The
  trip's members may change its travelers; only staff move its `salesStage`.

A trip's `revision` goes up with every change, whoever makes it: a booking that
moves it to `BOOKED`, travelers leaving it, or a person's `PUT`. A `PUT` with an
older revision answers 409 `CRM_REVISION_CONFLICT`; read the trip again and
send your list on top of what it has now. A trip the CRM keeps nothing of yet
has revision `0`.

`GET /crm/trips` is the agency's sales pipeline: trips by stage, soonest first,
each with its primary traveler's id and name (`primaryTravelerName`, as the
agency knows them) and its itinerary. The stages are `INQUIRY`, `PLANNING`,
`PROPOSAL`, `BOOKED`, `TRAVELING`, `COMPLETED` and `LOST`;
`salesStage=NONE` lists the trips that have none yet.

A trip's travelers carry their documents, so the routes answer only the trip's
staff and its own travelers, signed in. A payment link or a checkout handoff
never reads them: whoever pays through a link fills in the travelers
themselves, as they always have.

## Notes, tasks and the timeline

- **Notes** are about exactly one traveler or one trip: `POST /crm/notes` with a
  `travelerId` or a `travelersTripId`. `kind` is `NOTE`, or `CALL`, `EMAIL`,
  `MEETING` or `MESSAGE` to log a conversation.
- **Tasks** have a `title`, a `tentativeDate`, an `assignedUserId` and
  `completed`. `GET /crm/tasks?assignedUserId=me` lists the caller's open tasks,
  soonest first. Each task is answered with the names of what it is about,
  `travelerName` or `tripName` with the trip's `associatedTripItineraryId`, as
  they are now, so a list of tasks needs no other read to label its rows. A
  `templateId` sent with a `travelersTripId` applies one of the agency's task
  templates, dating each task from the trip. The CRM adds tasks of its own for
  birthdays, anniversaries and documents about to expire.
- **The timeline** lists what happened to the traveler: changes in the CRM, notes
  and tasks, trips, bookings, payments, invitations and itineraries sent. Each
  entry has ids and a readable `summary`, never the values that changed.
- **The emails the agency sent them** are on the timeline too, by themselves:
  each confirmation, receipt, declined payment, held or cancelled booking, card
  or profile request, invitation, welcome and itinerary Nicer sends a traveler
  for the agency, once SES has accepted it. The entry's `summary` is
  `Email sent: <subject>`, its `type` is `notifications.traveler-email-sent.v1`
  and its `data` holds the `templateName` and SES's `messageId`, never the
  address. Every traveler of the agency with that email gets it. Sign-in codes
  and emails to advisors and staff never appear. To log an email of your own,
  write a note of `kind` `EMAIL`.

## Self-service and profile forms

Travelers can fill in their own details in two ways. Either way they see what is
theirs — identity, contact, documents and preferences — and none of the agency's
own fields: stage, tags, notes and custom fields stay with the agency.

**Signed in.** `GET /crm/me` answers the signed-in person's traveler at the
agency they act in (`x-nicer-company`), or `null` before they have one there;
the `family` they may fill in for, their children, spouse or partner; and the
advisors who serve them at every agency, each with the `advisorName` and
`advisorAvatar` of their account. `PUT /crm/me` saves their changes and their
family's, each with the `revision` it read, and creates their traveler on the
first change.

**Without an account.** An advisor sends
`POST /crm/travelers/{travelerId}/invitation` with a `channel`, `EMAIL` or `SMS`,
and a `kind`:

| `kind` | What the traveler receives |
| --- | --- |
| `PROFILE_FORM` | A link to fill in their own profile without an account, valid for 14 days |
| `ACCOUNT` | An invitation to create a Nicer account; when they sign up, the account is linked to this traveler |

An account invitation, and a trip's, holds for 90 days under the email and the
phone it went to. Whoever signs up with either, on the agency's site or
anywhere else, belongs to the agency that invited them last: their account
takes the name the agency had for them when they give none, the traveler keeps
the advisors the agency gave it, and Nicer's own default advisor never takes
them.

A profile form's answer carries its `profileFormToken` and `expiresAt`, so the
advisor can share the link themselves too. Only the first answer does: Nicer
keeps the link as a hash, so a retry with the same `Idempotency-Key` answers
`profileFormToken: null`. The form reads
`GET /crm/profile-forms/{token}`, which names the agency in
`companyDisplayName`, and saves with `PUT /crm/profile-forms/{token}` and the
`revision` it read; both are public routes. A traveler with no email or
phone for the channel answers 400 `CRM_INVITATION_NO_CHANNEL`, and an unknown or
expired link 404.

> **The token is a credential**
>
> Like an itinerary link, a profile form's token is all that stands between the
> traveler's profile and the world. Keep it out of analytics, referrers and shared
> logs.

## Events and webhooks

Every change publishes an event, from the same function that made it. Events
carry ids and the names of what changed, never the values:
`crm.traveler-updated.v1` lists `sections` such as `profile.air`, and you read
the traveler for the rest. Every event has an `eventId`, the agency's
`companyName` and `occurredAt`, and most name who acted in `actorUserId`, `null`
for Nicer itself.

| Event | Published when |
| --- | --- |
| `crm.traveler-created.v1` | A traveler entered the agency; `origin` says how |
| `crm.traveler-updated.v1` | Sections of a traveler changed; carries the new `revision` |
| `crm.traveler-documents-changed.v1` | Documents were added, replaced or removed, named by kind |
| `crm.traveler-advisors-changed.v1` | The advisors who serve a traveler changed |
| `crm.traveler-linked.v1` | A traveler was linked to a Nicer account |
| `crm.traveler-unlinked.v1` | That link was removed because the account was deleted or merged away |
| `crm.travelers-merged.v1` | A duplicate was merged into another traveler |
| `crm.traveler-erased.v1` | A traveler was erased |
| `crm.traveler-invitation-requested.v1` | The agency invited a traveler |
| `crm.trip-updated.v1` | A trip's travelers or sales stage changed |
| `crm.note-changed.v1` | A note was created, changed or deleted |
| `crm.task-changed.v1` | A task was created, changed, completed, reopened or deleted |
| `crm.settings-updated.v1` | The agency's CRM settings changed |
| `crm.advisor-reminders-due.v1` | An advisor's day: tasks due and overdue, birthdays, anniversaries and expiring documents, as counts |

`crm.traveler-invitation-requested.v1` is the one event that names a person: it
carries the recipient's given name, email and phone, and a profile form's token.

### Webhooks

An admin registers up to ten HTTPS endpoints in `PUT /crm/settings`, each with
the events it subscribes to. The answer shows a new webhook's signing secret
once, in `webhookSecrets`; from then on the settings show only its last four
characters.

Each delivery is a `POST` of one event as JSON: `data` is the event's detail,
`id` its `eventId`.

```json
{
  "data": {
    "actorUserId": "f1c0…",
    "companyName": "your-agency",
    "eventId": "01K8B3T5W3M4Q2YQ9C7V1ZJ6HX",
    "occurredAt": "2026-10-23T10:00:00.000Z",
    "revision": 4,
    "sections": ["profile.air", "tags"],
    "travelerId": "TRV01K8B3…"
  },
  "id": "01K8B3T5W3M4Q2YQ9C7V1ZJ6HX",
  "occurredAt": "2026-10-23T10:00:00.000Z",
  "type": "crm.traveler-updated.v1"
}
```

Three headers name and sign it:

| Header | Value |
| --- | --- |
| `X-Nicer-Event` | The event's name, as in `type` |
| `X-Nicer-Delivery` | `<eventId>:<webhookId>`: this event, to this endpoint |
| `X-Nicer-Signature` | `t=<Unix seconds>,v1=<hex HMAC-SHA256>` |

`t` is when Nicer signed the delivery, and `v1` is the hex HMAC-SHA256 of
`<t>.<raw body>`, keyed with the webhook's secret. Nicer calls only `https`
endpoints on port 443 whose host name resolves to public addresses.

1. **Step 1**

   ### Verify before you parse

   Compute the HMAC over `t`, a period and the raw body exactly as received, before
   any JSON parsing changes its bytes, and compare it with `v1` in constant time.
   Reject a `t` more than a few minutes away from your clock, so a captured
   delivery cannot be replayed.
2. **Step 2**

   ### Answer fast

   Return a 2xx as soon as the event is stored, and do the work afterwards. Nicer
   retries a delivery that fails or is not answered with a 2xx, to every endpoint
   subscribed to the event: one that answered can receive it again.
3. **Step 3**

   ### Expect repeats, in any order

   Delivery is at least once, so the same event can arrive more than once:
   deduplicate on `id`, the event's `eventId`. Order is not guaranteed either:
   compare `occurredAt`, or a traveler's `revision`, with what you already have, or
   read the traveler again.

```ts
import { createHmac, timingSafeEqual } from "node:crypto";

/** Whether a delivery's X-Nicer-Signature header matches its raw body. */
export const isFromNicer = (
  header: string,
  rawBody: Buffer,
  secret: string,
  toleranceSeconds = 300
): boolean => {
  const fields = new Map(
    header.split(",").map((part): [string, string] => {
      const [key = "", value = ""] = part.trim().split("=");
      return [key, value];
    })
  );
  const t = fields.get("t") ?? "";
  const age = Math.abs(Date.now() / 1000 - Number(t));
  if (!/^\d+$/u.test(t) || age > toleranceSeconds) {
    return false;
  }
  const expected = createHmac("sha256", secret)
    .update(`${t}.`)
    .update(rawBody)
    .digest();
  const received = Buffer.from(fields.get("v1") ?? "", "hex");
  return (
    received.length === expected.length && timingSafeEqual(received, expected)
  );
};
```

## Idempotency keys and revisions

**Every `POST` takes an `Idempotency-Key`.** The six `POST` routes under `/crm`
— travelers, import, invitation, merge, notes and tasks — require one, as
described in [Idempotency](https://docs.nicer.travel/developers/idempotency). A retry with the same key
and body answers the first result without doing the work again; the same key
with another body is 409 `CRM_IDEMPOTENCY_CONFLICT`.

**Every change to a traveler carries the revision you read.** A traveler's
`revision` goes up with every change. `PUT /crm/travelers/{travelerId}` takes
the `revision` you read and replaces only the sections the body names: an
omitted section is kept, `null` clears a section, and a list replaces the stored
list. A section is replaced whole, so send all of its fields.

```json
{
  "revision": 3,
  "profile": {
    "air": {
      "cabinClass": "BUSINESS",
      "seat": "AISLE",
      "mealCode": "VGML",
      "notes": null,
      "preferredAirlineCodes": ["AM"],
      "preferredAirportCodes": ["MEX"]
    }
  }
}
```

This sets the traveler's air preferences and leaves every other section as it
was. If someone changed the traveler after you read it, the answer is 409
`CRM_REVISION_CONFLICT`: read it again, apply your change to what you read, and
send it with the new revision. `PUT /crm/me`, the profile forms,
`PUT /crm/trips/{travelersTripId}` and `PUT /crm/settings` work the same way.

## When a call fails

Every failure carries the [error envelope](https://docs.nicer.travel/developers/errors): branch on
`errorCode`, never on the message. These are the codes the CRM answers, and
what to do about each.

| Status | `errorCode` | What happened | What to do |
| --- | --- | --- | --- |
| 400 | `ERROR_BODY_VALIDATION`, `ERROR_INVALID_QUERY`, `ERROR_INVALID_PARAMETER` | The body, a query parameter or a path parameter does not match the route; the message names the field | Fix the request; the API reference lists every field and its limits |
| 400 | `CRM_INVITATION_NO_CHANNEL` | The traveler has no email for `EMAIL`, or no phone for `SMS` | Add it with `PUT /crm/travelers/{travelerId}`, or invite on the other channel |
| 400 | `CRM_MERGE_SAME_TRAVELER` | `duplicateTravelerId` is the traveler in the path | Send the duplicate's id |
| 400 | `CRM_RELATED_TRAVELER_NOT_FOUND` | A relationship names a traveler the agency does not have | Find or add that traveler first, then send its `travelerId` |
| 400 | `CRM_TASK_TEMPLATE_NOT_FOUND` | `templateId` names no template in the agency's settings | Read the agency's `taskTemplates` from `GET /crm/settings` |
| 403 | `ERROR_UNAUTHORIZED` | The caller's role does not allow it: an advisor assigning advisors, erasing a traveler, changing the settings or listing another person's tasks, or a traveler calling an agency route | Ask an admin; a retry answers the same |
| 404 | `ERROR_ITEM_NOT_FOUND` | No such id at the agency the caller acts in, or one they may not see | Check the id and the caller's `x-nicer-company`; do not retry |
| 409 | `CRM_REVISION_CONFLICT` | It changed after you read it | Read it again, apply your change to what you read, and send the new `revision` |
| 409 | `CRM_IDEMPOTENCY_CONFLICT` | The `Idempotency-Key` was already used with another body | Send a new key for a new request; reuse a key only to retry the same request |

A missing or malformed `Idempotency-Key` is refused before the route runs, as
[Idempotency](https://docs.nicer.travel/developers/idempotency) describes. A 5xx is safe to retry with
backoff, and a `POST` retried with the same key does its work once.

Source: https://docs.nicer.travel/developers/crm/index.mdx
