> ## Documentation Index
> Fetch the complete documentation index at: https://docs.conversales.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Text Message

> Send a text message via WhatsApp

## Authentication

**X-API-Key** `string` *required*

Your API key for authentication

## Request Body

**to** `string` *required*

Recipient phone number (without + symbol, e.g., 1234567890)

**message** `string` *required*

Text message content

**type** `string` *required*

Message Type (e.g., Text)

**replyToMessageId** `string`

WhatsApp message ID to reply to (optional)

**clientId** `string`

Your custom reference ID for tracking (optional)

## Response

**statusCode** `number`

HTTP status code (200 for success)

**message** `string`

Success or error message

**data** `object`

**properties**

**messageId** `string`

WhatsApp message ID

**status** `string`

Message status (sent, queued)

**to** `string`

Recipient phone number

**clientId** `string`

Your custom reference ID (if provided)

**timestamp** `string`

Message sent timestamp

```bash cURL theme={null}
curl -X POST "https://backend.conversales.in/api/v1/sendTextMessage" \
  -H "X-API-Key: 3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "1234567890",
    "message": "Hello! This is a test message from Conversales AI.",
    "clientId": "client_ref_12345",
    "type":"text"
  }'
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://backend.conversales.in/api/v1/sendTextMessage",
  {
    method: "POST",
    headers: {
      "X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      to: "1234567890",
      message: "Hello! This is a test message from Conversales AI.",
      clientId: "client_ref_12345",
    }),
  }
);

const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

url = "https://backend.conversales.in/api/v1/sendTextMessage"
headers = {
    "X-API-Key": "3kJ9mP2nQ8rT5vW7xY1zA4bC6dE8fG0hI",
    "Content-Type": "application/json"
}
payload = {
    "to": "1234567890",
    "message": "Hello! This is a test message from Conversales AI.",
    "clientId": "client_ref_12345"
}

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

```json Success Response theme={null}
{
  "statusCode": 200,
  "message": "Text message sent successfully",
  "data": {
    "messageId": "wamid.HBgNMTIzNDU2Nzg5MA==",
    "status": "sent",
    "recipient": "1234567890"
  }
}
```

```json Error - Unauthorized theme={null}
{
  "statusCode": 401,
  "message": "Invalid or missing API key",
  "data": null
}
```

```json Error - Invalid Phone Number theme={null}
{
  "statusCode": 400,
  "message": "Invalid recipient phone number",
  "data": null
}
```

> [!TIP]
>
> Use the `clientId` parameter to track messages in your own system. This ID
> will be returned in webhooks and status updates.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.