---
title: "Archive or restore 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.

# Archive or restore a trip

Path: Nicer API › Trips

`POST /travelers-trip/{travelersTripId}/toggle-archive`

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

Archives or restores a trip for the caller only. Archiving hides the trip from their list and their inbox; everyone else on the trip keeps seeing it. Nothing is deleted. 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.toggleArchive.path.travelersTripId`; string, required)

## Request body

_Required._

- `isArchived` (`travelersTrip.toggleArchive.isArchived`; boolean, required)

## Example request

```json
{
  "isArchived": true
}
```

## 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.toggleArchive({
  "travelersTripId": "string",
  "isArchived": true
});
```

### Nicer CLI

```bash
nicer travelers-trip toggle-archive --travelers-trip-id 'string' --input - <<'JSON'
{
  "isArchived": true
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/travelers-trip/<travelersTripId>/toggle-archive' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "isArchived": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/travelers-trip/<travelersTripId>/toggle-archive';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({isArchived: true})
};

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>/toggle-archive"

payload = { "isArchived": True }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "isArchived": true
}
```

- `isArchived` (`travelersTrip.toggleArchive.response.200.isArchived`; boolean, required)

### 400

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

#### Example

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

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

### 401

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

#### Example

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

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

### 403

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

#### Example

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

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


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