---
title: "Send an agent text to a contact from the Call Center profile"
description: "Sends one SMS to a workspace contact from the Calling / standalone Call Center\nprofile drawer. Denials run in a fixed order BEFORE the carrier is reached:\nauthentication, workspace membership and contact visibility,\ncontact tenancy, Sandbox Mode whitelist, DNC / SMS\nopt-out. The message then gets merge-field rendering and the GSM-7 body guard,\nis sent from the same number LiveChat would use (contact board number, registered\nshort code, or the workspace default) and is saved to the LiveChat thread.\n"
---

> 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 › Messages

`POST /api/call-center/contacts/{contactId}/text`

Sends one SMS to a workspace contact from the Calling / standalone Call Center
profile drawer. Denials run in a fixed order BEFORE the carrier is reached:
authentication, workspace membership and contact visibility,
contact tenancy, Sandbox Mode whitelist, DNC / SMS
opt-out. The message then gets merge-field rendering and the GSM-7 body guard,
is sent from the same number LiveChat would use (contact board number, registered
short code, or the workspace default) and is saved to the LiveChat thread.

## Authentication

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

## Path parameters

- `contactId` (`post/api/call-center/contacts/contactId/text.path.contactId`; string, required) — Contact to text; must belong to the authenticated workspace.
  - format `uuid`

## Header parameters

- `X-Workspace-Id` (`post/api/call-center/contacts/contactId/text.header.X-Workspace-Id`; string, optional) — Workspace to act in. Membership is verified; defaults to the token's workspace.

## Request body

_Required._

- `message` (`post/api/call-center/contacts/contactId/text.message`; string, required) — Message body. Merge fields such as {{contact.firstname}} are rendered.
  - maxLength 1600
- `userName` (`post/api/call-center/contacts/contactId/text.userName`; string, optional) — Display name saved on the message for the inbox (max 120 chars).

## Example request

```json
{
  "message": "string",
  "userName": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/call-center/contacts/<contactId>/text' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "string",
  "userName": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/call-center/contacts/<contactId>/text';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({message: 'string', userName: '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/call-center/contacts/<contactId>/text"

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

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

print(response.text)
```

## Responses

### 200

Message accepted by the carrier and saved to the LiveChat thread.

#### Example

```json
{
  "success": true,
  "messageSid": "string",
  "from": "string",
  "senderSource": "contact_board_number",
  "persisted": true,
  "message": {}
}
```

- `success` (`post/api/call-center/contacts/contactId/text.response.200.success`; boolean, optional)
  - example `true`
- `messageSid` (`post/api/call-center/contacts/contactId/text.response.200.messageSid`; string, optional)
- `from` (`post/api/call-center/contacts/contactId/text.response.200.from`; string, optional) — Sending phone number actually used.
- `senderSource` (`post/api/call-center/contacts/contactId/text.response.200.senderSource`; string, optional)
  - one of `"contact_board_number"`, `"contact_board_short_code"`, `"workspace_default"`
- `persisted` (`post/api/call-center/contacts/contactId/text.response.200.persisted`; boolean, optional) — False only when the carrier accepted the message but the thread insert failed.
- `message` (`post/api/call-center/contacts/contactId/text.response.200.message`; object, optional, nullable)

### 400

Missing or over-length message text.

### 401

Missing or invalid bearer token.

### 403

Blocked by Sandbox Mode, DNC, or SMS opt-out (body carries blocked=true and reason), or no workspace access.

### 404

Contact not in this workspace.

### 409

Contact has no phone number.

### 500

Texting is not configured for the workspace.

### 502

Provider error. sendOutcome is rejected for an explicit provider 4xx (except timeout); unknown means acceptance could not be confirmed. Never automatically retry an unknown outcome.

### 503

Session or contact access could not be verified; no send attempted.


Source: https://developer.channelautomations.com/api/post-api-call-center-contacts-contact-id-text/index.md
