---
title: "Update a trip itinerary"
---

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

# Update a trip itinerary

Path: Nicer API › Trip itinerary

`PUT /trip-itinerary/{tripItineraryId}`

URL: `https://api.nicer.travel/trip-itinerary/{tripItineraryId}`

Changes the itinerary's status, mode, trip cost, notes or attachments, and re-synchronizes the trip's start and end dates with the segments. A field left out keeps its stored value; in AUTO mode the trip cost is always the sum of the segments. Requires an advisor.

## Authentication

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

## Path parameters

- `tripItineraryId` (`tripItinerary.update.path.tripItineraryId`; string, required)

## Request body

_Required._

- `itinerary` (`tripItinerary.update.itinerary`; object, optional)
  - `attachments` (`tripItinerary.update.itinerary.attachments`; any of, optional)
    - any of the following:
      - `array<unknown>`
        - `key` (`tripItinerary.update.itinerary.attachments.1.key`; string, optional)
        - `name` (`tripItinerary.update.itinerary.attachments.1.name`; string, optional)
        - `source` (`tripItinerary.update.itinerary.attachments.1.source`; any of, optional)
          - any of the following: `string`, `string`
        - `url` (`tripItinerary.update.itinerary.attachments.1.url`; string, optional)
      - `null`
  - `notes` (`tripItinerary.update.itinerary.notes`; array of object, optional)
    - `id` (`tripItinerary.update.itinerary.notes.id`; string, required)
    - `note` (`tripItinerary.update.itinerary.notes.note`; string, required)
    - `title` (`tripItinerary.update.itinerary.notes.title`; string, required)
- `mode` (`tripItinerary.update.mode`; string, optional) — AUTO sums the segments into the trip cost; CUSTOM keeps tripCost as set. Omit to keep the current mode.
  - one of `"AUTO"`, `"CUSTOM"`
- `status` (`tripItinerary.update.status`; string, optional)
  - one of `"PROPOSAL"`, `"IN_PROGRESS"`, `"TRAVELING"`
- `tripCost` (`tripItinerary.update.tripCost`; number, optional) — The trip cost in USD, kept while the mode is CUSTOM. Omit to keep the current cost; in AUTO the cost is always the sum of the segments.

## Example request

```json
{
  "itinerary": {
    "attachments": [
      {
        "key": "string",
        "name": "string",
        "source": "string",
        "url": "string"
      }
    ],
    "notes": [
      {
        "id": "string",
        "note": "string",
        "title": "string"
      }
    ]
  },
  "mode": "AUTO",
  "status": "PROPOSAL",
  "tripCost": 0
}
```

## 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.tripItinerary.update({
  "tripItineraryId": "string"
});
```

### Nicer CLI

```bash
nicer trip-itinerary update --trip-itinerary-id 'string' --input - <<'JSON'
{}
JSON
```

### cURL

```bash
curl --request PUT \
  --url 'https://api.nicer.travel/trip-itinerary/<tripItineraryId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "itinerary": {
    "attachments": [
      {
        "key": "string",
        "name": "string",
        "source": "string",
        "url": "string"
      }
    ],
    "notes": [
      {
        "id": "string",
        "note": "string",
        "title": "string"
      }
    ]
  },
  "mode": "AUTO",
  "status": "PROPOSAL",
  "tripCost": 0
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/trip-itinerary/<tripItineraryId>';
const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    itinerary: {
      attachments: [{key: 'string', name: 'string', source: 'string', url: 'string'}],
      notes: [{id: 'string', note: 'string', title: 'string'}]
    },
    mode: 'AUTO',
    status: 'PROPOSAL',
    tripCost: 0
  })
};

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/trip-itinerary/<tripItineraryId>"

payload = {
    "itinerary": {
        "attachments": [
            {
                "key": "string",
                "name": "string",
                "source": "string",
                "url": "string"
            }
        ],
        "notes": [
            {
                "id": "string",
                "note": "string",
                "title": "string"
            }
        ]
    },
    "mode": "AUTO",
    "status": "PROPOSAL",
    "tripCost": 0
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "itinerary": {
    "attachments": [
      {
        "key": "string",
        "name": "string",
        "source": "string",
        "url": "string"
      }
    ],
    "notes": [
      {
        "id": "string",
        "note": "string",
        "title": "string"
      }
    ]
  },
  "mode": "AUTO",
  "status": "PROPOSAL",
  "tripCost": 0
}
```

- `itinerary` (`tripItinerary.update.response.200.itinerary`; object, optional)
  - `attachments` (`tripItinerary.update.response.200.itinerary.attachments`; any of, optional)
    - any of the following:
      - `array<unknown>`
        - `key` (`tripItinerary.update.response.200.itinerary.attachments.1.key`; string, optional)
        - `name` (`tripItinerary.update.response.200.itinerary.attachments.1.name`; string, optional)
        - `source` (`tripItinerary.update.response.200.itinerary.attachments.1.source`; any of, optional)
          - any of the following: `string`, `string`
        - `url` (`tripItinerary.update.response.200.itinerary.attachments.1.url`; string, optional)
      - `null`
  - `notes` (`tripItinerary.update.response.200.itinerary.notes`; array of object, optional)
    - `id` (`tripItinerary.update.response.200.itinerary.notes.id`; string, required)
    - `note` (`tripItinerary.update.response.200.itinerary.notes.note`; string, required)
    - `title` (`tripItinerary.update.response.200.itinerary.notes.title`; string, required)
- `mode` (`tripItinerary.update.response.200.mode`; string, optional) — AUTO sums the segments into the trip cost; CUSTOM keeps tripCost as set. Omit to keep the current mode.
  - one of `"AUTO"`, `"CUSTOM"`
- `status` (`tripItinerary.update.response.200.status`; string, optional)
  - one of `"PROPOSAL"`, `"IN_PROGRESS"`, `"TRAVELING"`
- `tripCost` (`tripItinerary.update.response.200.tripCost`; number, optional) — The trip cost in USD, kept while the mode is CUSTOM. Omit to keep the current cost; in AUTO the cost is always the sum of the segments.

### 400

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

#### Example

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

- `errorCode` (`tripItinerary.update.response.400.errorCode`; string, required)
- `errorMessage` (`tripItinerary.update.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`tripItinerary.update.response.401.errorCode`; string, required)
- `errorMessage` (`tripItinerary.update.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`tripItinerary.update.response.403.errorCode`; string, required)
- `errorMessage` (`tripItinerary.update.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Trip-itinerary/tripItinerary.update/index.md
