---
title: "Text the rep at this visit from the workspace number"
description: "Owners, admins and managers. Sends one SMS to the phone on the rep's profile, honouring the rep's STOP. The text is GSM-7 guarded and at most 320 characters. Recorded in field_sales_coaching_messages (30-day purge)."
---

> 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/visits/{appointmentId}/message`

Owners, admins and managers. Sends one SMS to the phone on the rep's profile, honouring the rep's STOP. The text is GSM-7 guarded and at most 320 characters. Recorded in field_sales_coaching_messages (30-day purge).

## Authentication

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

## Path parameters

- `appointmentId` (`post/api/field-sales/visits/appointmentId/message.path.appointmentId`; string, required)
  - format `uuid`

## Request body

_Required._

- `body` (`post/api/field-sales/visits/appointmentId/message.body`; string, required)
  - maxLength 320
- `rep_user_id` (`post/api/field-sales/visits/appointmentId/message.rep_user_id`; string, optional) — The rep on the row the manager clicked; 409 if the visit is now assigned to someone else
  - format `uuid`

## Example request

```json
{
  "body": "string",
  "rep_user_id": "7925edf3-849b-4257-b255-473c2089c16d"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/field-sales/visits/<appointmentId>/message' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "body": "string",
  "rep_user_id": "7925edf3-849b-4257-b255-473c2089c16d"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/field-sales/visits/<appointmentId>/message';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({body: 'string', rep_user_id: '7925edf3-849b-4257-b255-473c2089c16d'})
};

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/visits/<appointmentId>/message"

payload = {
    "body": "string",
    "rep_user_id": "7925edf3-849b-4257-b255-473c2089c16d"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

{ success, message: { id, status: sent|failed, reason, sent_at, body, to_masked } }

### 400

Empty

### 404

The visit has no assigned rep

### 409

The rep has no phone

### 429

Too many texts in a minute


Source: https://developer.channelautomations.com/api/post-api-field-sales-visits-appointment-id-message/index.md
