---
title: "Invite a traveler"
---

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

# Invite a traveler

Path: Nicer API › Notes and tasks

`POST /crm/travelers/{travelerId}/invitation`

URL: `https://api.nicer.travel/crm/travelers/{travelerId}/invitation`

Invites the traveler by email or SMS: to create a Nicer account (ACCOUNT), or to fill their own profile from a link that works for 14 days without an account (PROFILE_FORM). When they sign up, their account is linked to this traveler. Requires an Idempotency-Key header: a retry with the same key answers the first invitation, without its profileFormToken, which Nicer keeps only as a hash. Errors: 400 CRM_INVITATION_NO_CHANNEL when the traveler has no email or phone for the channel, 404 ERROR_ITEM_NOT_FOUND, 409 CRM_IDEMPOTENCY_CONFLICT.

## Authentication

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

## Path parameters

- `travelerId` (`crm.travelers.invitation.path.travelerId`; string, required)

## Header parameters

- `Idempotency-Key` (`crm.travelers.invitation.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.
- `x-nicer-company` (`crm.travelers.invitation.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.
- `X-Nicer-CRM-Contract` (`crm.travelers.invitation.header.X-Nicer-CRM-Contract`; string, required)
  - one of `"resource"` · example: `"resource"`

## Request body

_Required._

- `channel` (`crm.travelers.invitation.channel`; string, required)
  - one of `"EMAIL"`, `"SMS"`
- `kind` (`crm.travelers.invitation.kind`; string, required)
  - one of `"ACCOUNT"`, `"PROFILE_FORM"`

## Example request

```json
{
  "channel": "EMAIL",
  "kind": "PROFILE_FORM"
}
```

## Code samples

### JavaScript SDK

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

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

await nicer.crm.travelers.invitation({
  "travelerId": "string",
  "channel": "EMAIL",
  "kind": "PROFILE_FORM"
});
```

### Nicer CLI

```bash
nicer crm travelers invitation --traveler-id 'string' --company "$NICER_COMPANY" --input - <<'JSON'
{
  "channel": "EMAIL",
  "kind": "PROFILE_FORM"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/crm/travelers/<travelerId>/invitation' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --header 'X-Nicer-CRM-Contract: resource' \
  --header 'x-nicer-company: string' \
  --data '
{
  "channel": "EMAIL",
  "kind": "PROFILE_FORM"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/crm/travelers/<travelerId>/invitation';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    'x-nicer-company': 'string',
    'X-Nicer-CRM-Contract': 'resource',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({channel: 'EMAIL', kind: 'PROFILE_FORM'})
};

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/travelers/<travelerId>/invitation"

payload = {
    "channel": "EMAIL",
    "kind": "PROFILE_FORM"
}
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "x-nicer-company": "string",
    "X-Nicer-CRM-Contract": "resource",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "channel": "EMAIL",
  "expiresAt": "2019-08-24T14:15:22Z",
  "kind": "ACCOUNT",
  "profileFormToken": "string",
  "travelerId": "string"
}
```

- `channel` (`crm.travelers.invitation.response.200.channel`; string, required)
  - one of `"EMAIL"`, `"SMS"`
- `expiresAt` (`crm.travelers.invitation.response.200.expiresAt`; any of, required)
  - any of the following: `string`, `null`
- `kind` (`crm.travelers.invitation.response.200.kind`; string, required)
  - one of `"ACCOUNT"`, `"PROFILE_FORM"`
- `profileFormToken` (`crm.travelers.invitation.response.200.profileFormToken`; any of, required)
  - any of the following: `string`, `null`
- `travelerId` (`crm.travelers.invitation.response.200.travelerId`; string, required) — The traveler's id in the CRM, e.g. TRV01JD4Q9W0Y5X3M2K8B7N6P4R1T.
  - maxLength: `64` · minLength: `1`

### 400

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

#### Example

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

- `errorCode` (`crm.travelers.invitation.response.400.errorCode`; string, required)
- `errorMessage` (`crm.travelers.invitation.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`crm.travelers.invitation.response.401.errorCode`; string, required)
- `errorMessage` (`crm.travelers.invitation.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`crm.travelers.invitation.response.403.errorCode`; string, required)
- `errorMessage` (`crm.travelers.invitation.response.403.errorMessage`; string, required)


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