Sending SMS Messages
Learn how to send single and bulk SMS messages programmatically.
Send a Single SMS
Use the POST /v1/sms/send endpoint to send a single message.
const response = await fetch('https://api.wetalk.com/v1/sms/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+1234567890',
message: 'Hello from WeTalk!',
sender_id: 'WeTalk'
})
});
const data = await response.json();Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number (E.164 format) |
message | string | Yes | Message content (max 1600 chars) |
sender_id | string | No | Alphanumeric sender ID |
callback_url | string | No | URL for delivery reports |
Send Bulk SMS
Send messages to multiple recipients at once using the POST /v1/sms/bulk endpoint.
{
"messages": [
{ "to": "+1234567890", "message": "Hello John!" },
{ "to": "+0987654321", "message": "Hello Jane!" }
],
"sender_id": "WeTalk"
}Response
{
"success": true,
"message_id": "msg_abc123xyz",
"status": "queued",
"credits_used": 1,
"segments": 1
}