---
title: "Invite a traveler to a trip"
---

> 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 to a trip

Path: Nicer API › Trips

`POST /travelers-trip/{travelersTripId}/invite`

URL: `https://api.nicer.travel/travelers-trip/{travelersTripId}/invite`

Invites a travel companion to a trip. A phone number, an email address or a name is enough. A person with a Nicer account joins the trip at once; a person without one becomes a traveler of the agency on the trip in the CRM, and joins the trip when they sign up, so a group can be assembled before everyone has an account. Returns the trip. Anyone who can see the trip may call it: the people on it, its advisor of record, the admins of the agency that owns it and Nicer staff.

## Authentication

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

## Path parameters

- `travelersTripId` (`travelersTrip.invite.path.travelersTripId`; string, required)

## Request body

_Required._

- `email` (`travelersTrip.invite.email`; string, optional)
  - format: `email` · pattern: `^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`
- `familyName` (`travelersTrip.invite.familyName`; string, optional)
- `givenName` (`travelersTrip.invite.givenName`; string, optional)
- `phoneNumber` (`travelersTrip.invite.phoneNumber`; string, optional)
  - minLength: `1`

## Example request

```json
{
  "email": "user@example.com",
  "familyName": "string",
  "givenName": "string",
  "phoneNumber": "string"
}
```

## 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.travelersTrip.invite({
  "travelersTripId": "string"
});
```

### Nicer CLI

```bash
nicer travelers-trip invite --travelers-trip-id 'string' --input - <<'JSON'
{}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/travelers-trip/<travelersTripId>/invite' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "user@example.com",
  "familyName": "string",
  "givenName": "string",
  "phoneNumber": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/travelers-trip/<travelersTripId>/invite';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    familyName: 'string',
    givenName: 'string',
    phoneNumber: 'string'
  })
};

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/travelers-trip/<travelersTripId>/invite"

payload = {
    "email": "user@example.com",
    "familyName": "string",
    "givenName": "string",
    "phoneNumber": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "assignedAdvisorUserId": "string",
  "associatedChatId": "string",
  "associatedTripItineraryId": "string",
  "associatedUserIds": [
    "string"
  ],
  "availableDate": "string",
  "budgetCurrency": "string",
  "companyName": "string",
  "conciergeMessageSentAt": "string",
  "createdBy": "string",
  "createdReason": "CREATED_BY_TRAVELER",
  "deleted": true,
  "deletedAt": "string",
  "deletedBy": "string",
  "destinations": [
    {
      "address": "string",
      "amenities": [
        "string"
      ],
      "city": "string",
      "country": "string",
      "countryCode": "string",
      "description": "string",
      "distanceFromSearch": {
        "unit": "km",
        "value": 0
      },
      "features": [
        "string"
      ],
      "fullAddress": "string",
      "gate": "string",
      "iataCode": "string",
      "internovaId": "string",
      "latitude": 0,
      "longitude": 0,
      "name": "string",
      "photos": [
        {
          "key": "string",
          "name": "string",
          "url": "string"
        }
      ],
      "placeId": "string",
      "region": "string",
      "source": "string",
      "state": "string",
      "terminal": "string",
      "timeZone": "string",
      "zipCode": "string",
      "endDateTime": "string",
      "headerImageUrl": "string",
      "startDateTime": "string"
    }
  ],
  "hasActivity": true,
  "hasFlexibleDates": true,
  "isAllPricesHidden": false,
  "isItineraryVisible": true,
  "isSummaryHidden": false,
  "lastMessageTimestamp": "string",
  "lastModifiedBy": "string",
  "primaryTravelerUserId": "string",
  "specialRequests": "string",
  "suggestionsEnabled": true,
  "travelers": {
    "adults": 0,
    "children": 0
  },
  "tripEndDate": "string",
  "tripStartDate": "string",
  "tripTitle": "string",
  "amount": 0,
  "budget": "goodValue",
  "purpose": "holidays",
  "who": "solo",
  "travelersTripId": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "type": "TravelersTrip"
}
```

- `associatedUserIds` (`travelersTrip.invite.response.200.associatedUserIds`; array of string, required)
- `companyName` (`travelersTrip.invite.response.200.companyName`; string, required)
- `createdBy` (`travelersTrip.invite.response.200.createdBy`; string, required)
- `destinations` (`travelersTrip.invite.response.200.destinations`; array of object, required)
  - `endDateTime` (`travelersTrip.invite.response.200.destinations.endDateTime`; string, required)
    - pattern: `^\d{4}-\d{2}-\d{2}$`
  - `startDateTime` (`travelersTrip.invite.response.200.destinations.startDateTime`; string, required)
    - pattern: `^\d{4}-\d{2}-\d{2}$`
  - `address` (`travelersTrip.invite.response.200.destinations.address`; any of, optional)
    - any of the following: `string`, `null`
  - `amenities` (`travelersTrip.invite.response.200.destinations.amenities`; array of string, optional)
  - `city` (`travelersTrip.invite.response.200.destinations.city`; any of, optional)
    - any of the following: `string`, `null`
  - `country` (`travelersTrip.invite.response.200.destinations.country`; string, optional)
  - `countryCode` (`travelersTrip.invite.response.200.destinations.countryCode`; string, optional)
  - `description` (`travelersTrip.invite.response.200.destinations.description`; string, optional)
  - `distanceFromSearch` (`travelersTrip.invite.response.200.destinations.distanceFromSearch`; object, optional)
    - `unit` (`travelersTrip.invite.response.200.destinations.distanceFromSearch.unit`; string, required)
      - one of `"km"`, `"mi"`
    - `value` (`travelersTrip.invite.response.200.destinations.distanceFromSearch.value`; number, required)
  - `features` (`travelersTrip.invite.response.200.destinations.features`; array of string, optional)
  - `fullAddress` (`travelersTrip.invite.response.200.destinations.fullAddress`; string, optional)
  - `gate` (`travelersTrip.invite.response.200.destinations.gate`; any of, optional)
    - any of the following: `string`, `null`
  - `iataCode` (`travelersTrip.invite.response.200.destinations.iataCode`; any of, optional)
    - any of the following: `string`, `null`
  - `internovaId` (`travelersTrip.invite.response.200.destinations.internovaId`; string, optional)
  - `latitude` (`travelersTrip.invite.response.200.destinations.latitude`; number, optional)
  - `longitude` (`travelersTrip.invite.response.200.destinations.longitude`; number, optional)
  - `name` (`travelersTrip.invite.response.200.destinations.name`; string, optional)
  - `photos` (`travelersTrip.invite.response.200.destinations.photos`; array of object, optional)
    - `name` (`travelersTrip.invite.response.200.destinations.photos.name`; string, required)
    - `key` (`travelersTrip.invite.response.200.destinations.photos.key`; string, optional)
    - `url` (`travelersTrip.invite.response.200.destinations.photos.url`; string, optional)
  - `placeId` (`travelersTrip.invite.response.200.destinations.placeId`; string, optional)
  - `region` (`travelersTrip.invite.response.200.destinations.region`; string, optional)
  - `source` (`travelersTrip.invite.response.200.destinations.source`; string, optional)
  - `state` (`travelersTrip.invite.response.200.destinations.state`; any of, optional)
    - any of the following: `string`, `null`
  - `terminal` (`travelersTrip.invite.response.200.destinations.terminal`; any of, optional)
    - any of the following: `string`, `null`
  - `timeZone` (`travelersTrip.invite.response.200.destinations.timeZone`; string, optional)
  - `zipCode` (`travelersTrip.invite.response.200.destinations.zipCode`; any of, optional)
    - any of the following: `string`, `null`
  - `headerImageUrl` (`travelersTrip.invite.response.200.destinations.headerImageUrl`; string, optional)
- `hasFlexibleDates` (`travelersTrip.invite.response.200.hasFlexibleDates`; boolean, required)
- `isAllPricesHidden` (`travelersTrip.invite.response.200.isAllPricesHidden`; boolean, required)
  - default: `false`
- `isItineraryVisible` (`travelersTrip.invite.response.200.isItineraryVisible`; boolean, required)
  - default: `true`
- `isSummaryHidden` (`travelersTrip.invite.response.200.isSummaryHidden`; boolean, required)
  - default: `false`
- `lastModifiedBy` (`travelersTrip.invite.response.200.lastModifiedBy`; string, required)
- `primaryTravelerUserId` (`travelersTrip.invite.response.200.primaryTravelerUserId`; string, required)
- `tripEndDate` (`travelersTrip.invite.response.200.tripEndDate`; string, required)
- `tripStartDate` (`travelersTrip.invite.response.200.tripStartDate`; string, required)
- `tripTitle` (`travelersTrip.invite.response.200.tripTitle`; string, required)
- `travelersTripId` (`travelersTrip.invite.response.200.travelersTripId`; string, required)
- `createdAt` (`travelersTrip.invite.response.200.createdAt`; string, required)
- `updatedAt` (`travelersTrip.invite.response.200.updatedAt`; string, required)
- `type` (`travelersTrip.invite.response.200.type`; string, required)
- `assignedAdvisorUserId` (`travelersTrip.invite.response.200.assignedAdvisorUserId`; any of, optional)
  - any of the following: `string`, `null`
- `associatedChatId` (`travelersTrip.invite.response.200.associatedChatId`; any of, optional)
  - any of the following: `string`, `null`
- `associatedTripItineraryId` (`travelersTrip.invite.response.200.associatedTripItineraryId`; any of, optional)
  - any of the following: `string`, `null`
- `availableDate` (`travelersTrip.invite.response.200.availableDate`; any of, optional)
  - any of the following:
    - `string`
    - `object`
      - `from` (`travelersTrip.invite.response.200.availableDate.2.from`; string, required)
      - `to` (`travelersTrip.invite.response.200.availableDate.2.to`; string, required)
- `budgetCurrency` (`travelersTrip.invite.response.200.budgetCurrency`; any of, optional)
  - any of the following: `string`, `null`
- `conciergeMessageSentAt` (`travelersTrip.invite.response.200.conciergeMessageSentAt`; any of, optional)
  - any of the following: `string`, `null`
- `createdReason` (`travelersTrip.invite.response.200.createdReason`; string, optional)
  - one of `"CREATED_BY_TRAVELER"`, `"CREATED_BY_ADVISOR"`, `"CREATED_BY_MATCHING_ADVISOR"`, `"CREATED_BY_BOOKING"`
- `deleted` (`travelersTrip.invite.response.200.deleted`; boolean, optional)
- `deletedAt` (`travelersTrip.invite.response.200.deletedAt`; any of, optional)
  - any of the following: `string`, `null`
- `deletedBy` (`travelersTrip.invite.response.200.deletedBy`; string, optional)
- `hasActivity` (`travelersTrip.invite.response.200.hasActivity`; boolean, optional)
- `lastMessageTimestamp` (`travelersTrip.invite.response.200.lastMessageTimestamp`; any of, optional)
  - any of the following: `string`, `null`
- `specialRequests` (`travelersTrip.invite.response.200.specialRequests`; any of, optional)
  - any of the following: `string`, `null`
- `suggestionsEnabled` (`travelersTrip.invite.response.200.suggestionsEnabled`; boolean, optional)
- `travelers` (`travelersTrip.invite.response.200.travelers`; object, optional)
  - `adults` (`travelersTrip.invite.response.200.travelers.adults`; number, optional)
  - `children` (`travelersTrip.invite.response.200.travelers.children`; number, optional)
- `amount` (`travelersTrip.invite.response.200.amount`; number, optional)
- `budget` (`travelersTrip.invite.response.200.budget`; any of, optional)
  - any of the following: `string`, `string`
- `purpose` (`travelersTrip.invite.response.200.purpose`; any of, optional)
  - any of the following: `string`, `string`, `string`, `string`
- `who` (`travelersTrip.invite.response.200.who`; any of, optional)
  - any of the following: `string`, `string`, `string`, `string`

### 400

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

#### Example

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

- `errorCode` (`travelersTrip.invite.response.400.errorCode`; string, required)
- `errorMessage` (`travelersTrip.invite.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`travelersTrip.invite.response.401.errorCode`; string, required)
- `errorMessage` (`travelersTrip.invite.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`travelersTrip.invite.response.403.errorCode`; string, required)
- `errorMessage` (`travelersTrip.invite.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Trips/travelersTrip.invite/index.md
