SMS Message
SMS messages are sent via the Jatis channel. DEP provides two sending endpoints: a per-sender endpoint (recommended) and a legacy endpoint. The platform supports three SMS categories: Marketing, Alert, and OTP.
Endpoint (per-sender)
Section titled “Endpoint (per-sender)”POST https://messaging.cpaas.id/v1/senders/{sms_sender_id}/messagesThis is the recommended endpoint. Replace {sms_sender_id} with your SMS sender ID UUID (obtained from the cpaas.id page Channels).
The supplier (Jatis, IOH, 1E) and channel category are determined by the sender ID registration — so the request body only contains the destination and message content, without any sms_channel.
Request Body
Section titled “Request Body”{ "to": "6281234567890", "text": "Kode OTP Anda: 123456. Berlaku 5 menit."}Request Field
Section titled “Request Field”| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number in E.164 format (without +) or local format (will be normalized) |
text | string | Yes | SMS message content. Must be GSM-7 compatible, max 580 septets |
uploadby | string | No | Operator PIC / attribution. Default: "mahadata" |
Complete Example
Section titled “Complete Example”curl -X POST https://messaging.cpaas.id/v1/senders/YOUR_SMS_SENDER_ID/messages \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "to": "6281234567890", "text": "Kode OTP Anda: 123456. Berlaku 5 menit." }'import requests
url = "https://messaging.cpaas.id/v1/senders/YOUR_SMS_SENDER_ID/messages"headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}payload = { "to": "6281234567890", "text": "Kode OTP Anda: 123456. Berlaku 5 menit."}
response = requests.post(url, json=payload, headers=headers)print(response.json())const response = await fetch( 'https://messaging.cpaas.id/v1/senders/YOUR_SMS_SENDER_ID/messages', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ to: '6281234567890', text: 'Kode OTP Anda: 123456. Berlaku 5 menit.', }), });const data = await response.json();console.log(data);Legacy Endpoint
Section titled “Legacy Endpoint”POST https://messaging.cpaas.id/v1/sms/messagesThe legacy endpoint (deprecated, retained for compatibility) does not use a sender ID in the path. Instead, the channel category and logical sender are sent in the body. For new integrations, use the per-sender endpoint above.
Request Body (legacy)
Section titled “Request Body (legacy)”{ "to": "6281234567890", "text": "Kode OTP Anda: 123456. Berlaku 5 menit.", "sms_channel": 2}Request Fields (legacy)
Section titled “Request Fields (legacy)”| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number in E.164 format (without +) or local format (will be normalized) |
text | string | Yes | SMS message content. Must be GSM-7 compatible, max 580 septets |
sms_channel | number | No | Channel category: 0 = Marketing (default), 1 = Alert, 2 = OTP |
sms_sender | string | No | Override the logical sender name. If not filled, uses the tenant default |
uploadby | string | No | Operator PIC / attribution. Default: "mahadata" |
SMS category (sms_channel)
Section titled “SMS category (sms_channel)”| Value | Category | Description |
|---|---|---|
0 | Marketing / Normal | Promotional and marketing SMS (default) |
1 | Alert | Notifications and alerts |
2 | OTP | One-Time Password and verification |
Example: Marketing SMS with Custom Sender (legacy)
Section titled “Example: Marketing SMS with Custom Sender (legacy)”{ "to": "6281234567890", "text": "Promo spesial! Diskon 50% untuk semua produk. Berlaku hingga 30 Juni 2026. Info: example.com", "sms_channel": 0, "sms_sender": "BRAND-NAME", "uploadby": "marketing-team"}Response
Section titled “Response”{ "messaging_product": "sms", "messages": [ { "id": "msg_f7a816e2-8397-11f0-8e34-010203040506" } ]}Webhook Statuses You Will Receive
Section titled “Webhook Statuses You Will Receive”message.status.sent— SMS successfully sent to the operator (telco submit)message.status.delivered— SMS reached the recipient’s device (handset delivery)
If it fails at either the telco submit or handset delivery stage, you receive message.status.failed.
See the page Webhook for details on the payload format of each event.