---
title: "Import travelers"
---

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

# Import travelers

Path: Nicer API › Notes and tasks

`POST /crm/travelers/import`

URL: `https://api.nicer.travel/crm/travelers/import`

Adds up to 200 travelers in one call, for example from a spreadsheet. A row whose email or phone belongs to a traveler of the agency is MATCHED, not duplicated; each row reports its own outcome. Requires an Idempotency-Key header. Errors: 400 ERROR_BODY_VALIDATION, 409 CRM_IDEMPOTENCY_CONFLICT.

## Authentication

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

## Header parameters

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

## Request body

_Required._

- `rows` (`crm.travelers.import.rows`; array of object, required)
  - `name` (`crm.travelers.import.rows.name`; object, required) — The legal name, as printed on the travel document. The one required field.
    - `familyName` (`crm.travelers.import.rows.name.familyName`; string, required)
      - maxLength: `100` · minLength: `1`
    - `givenName` (`crm.travelers.import.rows.name.givenName`; string, required)
      - maxLength: `100` · minLength: `1`
    - `middleName` (`crm.travelers.import.rows.name.middleName`; any of, required)
      - any of the following: `string`, `null`
  - `address` (`crm.travelers.import.rows.address`; any of, optional) — The traveler's postal address; null or absent leaves none.
    - any of the following:
      - `PersonAddress`
        - `address1` (`PersonAddress.address1`; string, required)
          - maxLength: `200` · minLength: `1`
        - `city` (`PersonAddress.city`; string, required)
          - maxLength: `100` · minLength: `1`
        - `countryCode` (`PersonAddress.countryCode`; string, required)
          - pattern: `^[A-Z]{2}$`
        - `postalCode` (`PersonAddress.postalCode`; string, required)
          - maxLength: `20` · minLength: `1`
        - `stateCode` (`PersonAddress.stateCode`; string, required)
          - maxLength: `100` · minLength: `1`
      - `null`
  - `assignedAdvisorUserId` (`crm.travelers.import.rows.assignedAdvisorUserId`; string, optional) — Admins only: the user id of the advisor responsible for the traveler. An advisor's new traveler is always their own.
    - minLength: `1`
  - `birthDate` (`crm.travelers.import.rows.birthDate`; any of, optional) — Date of birth, YYYY-MM-DD.
    - any of the following: `string`, `null`
  - `contact` (`crm.travelers.import.rows.contact`; object, optional) — The traveler's email and phone, the phone in E.164.
    - `email` (`crm.travelers.import.rows.contact.email`; any of, required)
      - any of the following: `string`, `null`
    - `phone` (`crm.travelers.import.rows.contact.phone`; any of, required)
      - any of the following: `E164Phone`, `null`
  - `customFields` (`crm.travelers.import.rows.customFields`; map of CustomFieldValue, optional) — Values of the agency's own custom fields, by key; each key must be a field the agency defined.
  - `frequentFlyerPrograms` (`crm.travelers.import.rows.frequentFlyerPrograms`; array of object, optional) — Up to 8 airline loyalty memberships.
    - `airlineIataCode` (`crm.travelers.import.rows.frequentFlyerPrograms.airlineIataCode`; string, required)
      - pattern: `^[A-Z0-9]{2,3}$`
    - `memberNumber` (`crm.travelers.import.rows.frequentFlyerPrograms.memberNumber`; string, required)
      - maxLength: `100` · minLength: `1`
  - `marketingConsent` (`crm.travelers.import.rows.marketingConsent`; object, optional) — Whether the traveler agreed to marketing messages, per channel; absent means none.
    - `email` (`crm.travelers.import.rows.marketingConsent.email`; boolean, required) — Whether the traveler agreed to marketing by email.
    - `sms` (`crm.travelers.import.rows.marketingConsent.sms`; boolean, required) — Whether the traveler agreed to marketing by SMS.
    - `whatsapp` (`crm.travelers.import.rows.marketingConsent.whatsapp`; boolean, required) — Whether the traveler agreed to marketing on WhatsApp.
  - `nationalityCountryCode` (`crm.travelers.import.rows.nationalityCountryCode`; any of, optional) — Nationality, as an ISO 3166-1 alpha-2 country code.
    - any of the following: `CountryCode`, `null`
  - `preferredChannel` (`crm.travelers.import.rows.preferredChannel`; any of, optional) — How the traveler prefers to be contacted.
    - any of the following: `PreferredChannel`, `null`
  - `preferredLanguage` (`crm.travelers.import.rows.preferredLanguage`; any of, optional) — The language to write to the traveler in, e.g. es or en-US.
    - any of the following: `LanguageTag`, `null`
  - `preferredName` (`crm.travelers.import.rows.preferredName`; any of, optional) — The name the traveler goes by when it is not their given name, 1 to 100 characters.
    - any of the following: `string`, `null`
  - `referredByTravelerId` (`crm.travelers.import.rows.referredByTravelerId`; any of, optional) — The traveler of the agency who referred this one.
    - any of the following: `TravelerId`, `null`
  - `residenceCountryCode` (`crm.travelers.import.rows.residenceCountryCode`; any of, optional) — Country of residence, as an ISO 3166-1 alpha-2 country code.
    - any of the following: `CountryCode`, `null`
  - `sex` (`crm.travelers.import.rows.sex`; any of, optional) — The sex marker on the travel document.
    - any of the following: `ParticipantSex`, `null`
  - `stage` (`crm.travelers.import.rows.stage`; string, optional) — LEAD when absent, or CLIENT.
    - one of `"CLIENT"`, `"LEAD"`
  - `tags` (`crm.travelers.import.rows.tags`; array of string, optional) — Up to 20 labels, each 1 to 40 characters.
    - maxLength: `40` · minLength: `1`
  - `visibility` (`crm.travelers.import.rows.visibility`; string, optional) — Which of the agency's advisors see the traveler; the agency's default when absent.
    - one of `"ADVISORS"`, `"COMPANY"`

## Example request

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

## 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.import({
  "rows": [
    {
      "contact": {
        "email": "ana@example.com",
        "phone": "+525512345678"
      },
      "name": {
        "familyName": "Pérez",
        "givenName": "Ana",
        "middleName": null
      }
    }
  ]
});
```

### Nicer CLI

```bash
nicer crm travelers import --company "$NICER_COMPANY" --input - <<'JSON'
{
  "rows": [
    {
      "contact": {
        "email": "ana@example.com",
        "phone": "+525512345678"
      },
      "name": {
        "familyName": "Pérez",
        "givenName": "Ana",
        "middleName": null
      }
    }
  ]
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/crm/travelers/import \
  --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 '
{
  "rows": [
    {
      "contact": {
        "email": "ana@example.com",
        "phone": "+525512345678"
      },
      "name": {
        "familyName": "Pérez",
        "givenName": "Ana",
        "middleName": null
      }
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/crm/travelers/import';
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({
    rows: [
      {
        contact: {email: 'ana@example.com', phone: '+525512345678'},
        name: {familyName: 'Pérez', givenName: 'Ana', middleName: null}
      }
    ]
  })
};

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

payload = { "rows": [
        {
            "contact": {
                "email": "ana@example.com",
                "phone": "+525512345678"
            },
            "name": {
                "familyName": "Pérez",
                "givenName": "Ana",
                "middleName": None
            }
        }
    ] }
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
{
  "results": [
    {
      "errorCode": "string",
      "index": 9007199254740991,
      "outcome": "CREATED",
      "travelerId": "string"
    }
  ]
}
```

- `results` (`crm.travelers.import.response.200.results`; array of object, required)
  - `errorCode` (`crm.travelers.import.response.200.results.errorCode`; any of, required)
    - any of the following: `string`, `null`
  - `index` (`crm.travelers.import.response.200.results.index`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `outcome` (`crm.travelers.import.response.200.results.outcome`; string, required)
    - one of `"CREATED"`, `"FAILED"`, `"MATCHED"`
  - `travelerId` (`crm.travelers.import.response.200.results.travelerId`; any of, required)
    - any of the following: `TravelerId`, `null`

### 400

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

#### Example

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

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

### 401

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

#### Example

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

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

### 403

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

#### Example

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

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


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