---
title: "Send an advisor's welcome email"
---

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

# Send an advisor's welcome email

Path: Nicer API › maintenance-tasks

`POST /maintenance-tasks/send-email`

URL: `https://api.nicer.travel/maintenance-tasks/send-email`

With type welcome-email-advisor, sends the advisor welcome email to userId, an advisor of the caller's company, once per advisor however often it is asked; the join app calls it after sign-up. The reservation-confirmation-email type is retired and always answers 410 BOOKING_EMAIL_RETIRED.

## Authentication

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

## Request body

_Required._

Every option has:

- `type` (`<option>.type`; string, required)

One of the following, each adding:

- `object` (`maintenanceTasks.sendEmail.1`)
  - `userId` (`maintenanceTasks.sendEmail.1.userId`; string, required)
- `object` (`maintenanceTasks.sendEmail.2`)
  - `bookingId` (`maintenanceTasks.sendEmail.2.bookingId`; string, required)
  - `emails` (`maintenanceTasks.sendEmail.2.emails`; array of string, required)
  - `role` (`maintenanceTasks.sendEmail.2.role`; string, optional)

## Example request

```json
{
  "type": "welcome-email-advisor",
  "userId": "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.maintenanceTasks.sendEmail({
  "type": "welcome-email-advisor",
  "userId": "string"
});
```

### Nicer CLI

```bash
nicer maintenance-tasks send-email --input - <<'JSON'
{
  "type": "welcome-email-advisor",
  "userId": "string"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/maintenance-tasks/send-email \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "welcome-email-advisor",
  "userId": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/maintenance-tasks/send-email';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({type: 'welcome-email-advisor', userId: '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/maintenance-tasks/send-email"

payload = {
    "type": "welcome-email-advisor",
    "userId": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

### 400

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

#### Example

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

- `errorCode` (`maintenanceTasks.sendEmail.response.400.errorCode`; string, required)
- `errorMessage` (`maintenanceTasks.sendEmail.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`maintenanceTasks.sendEmail.response.401.errorCode`; string, required)
- `errorMessage` (`maintenanceTasks.sendEmail.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`maintenanceTasks.sendEmail.response.403.errorCode`; string, required)
- `errorMessage` (`maintenanceTasks.sendEmail.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/maintenance-tasks/maintenanceTasks.sendEmail/index.md
