---
title: "The rep's reason for leaving a visit before the minimum"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Conversations

`POST /api/field-sales/appointments/{id}/leave-reason`

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `id` (`post/api/field-sales/appointments/id/leave-reason.path.id`; string, required)
  - format `uuid`

## Request body

_Required._

- `reason` (`post/api/field-sales/appointments/id/leave-reason.reason`; string, required)
  - one of `"no_one_home"`, `"customer_cancelled"`, `"one_legger"`, `"rescheduled"`, `"other"`
- `note` (`post/api/field-sales/appointments/id/leave-reason.note`; string, optional)
  - maxLength 500

## Example request

```json
{
  "reason": "no_one_home",
  "note": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/field-sales/appointments/<id>/leave-reason' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "no_one_home",
  "note": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/field-sales/appointments/<id>/leave-reason';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({reason: 'no_one_home', note: '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.channelautomation.com/api/field-sales/appointments/<id>/leave-reason"

payload = {
    "reason": "no_one_home",
    "note": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

{ success, presence }

### 409

The visit has not ended


Source: https://developer.channelautomations.com/api/post-api-field-sales-appointments-id-leave-reason/index.md
