Send Your First Message
Make your first API call to send an SMS, WhatsApp, or RCS message.
What you'll accomplish: Get API keys → Send a message → Track delivery
⏳ Time required: ~2 minutes
Prerequisites
Light onboarding path (email + phone verified):
- email and phone verified
- API key copied from dashboard
- Pre-built template ID copied from dashboard
Full production setup path:
- Account set up and KYC approved
- Channels configured
- Custom template created and approved
- API key copied from dashboard
How Message Sending Works
Get Your API Keys
From your Sent Dashboard, copy your API key:
Security reminder: Never commit API keys to version control. Use environment variables.
Send a Message
Choose your preferred method:
# Set your API key and template ID
export SENT_API_KEY="your_api_key_here"
export TEMPLATE_ID="your_template_id_here"
export RECIPIENT="+1234567890"
curl -X POST "https://api.sent.dm/v3/messages" \
-H "x-api-key: $SENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["'"$RECIPIENT"'"],
"template": {
"id": "'"$TEMPLATE_ID"'"
},
"channel": ["sms", "whatsapp", "rcs"]
}'import SentDm from '@sentdm/sentdm';
const client = new SentDm(); // Uses SENT_DM_API_KEY env var
const response = await client.messages.send({
to: ['+1234567890'],
template: {
id: 'your_template_id_here'
},
channel: ['sms', 'whatsapp', 'rcs']
});
console.log('Message sent:', response.data.recipients[0].message_id);from sent_dm import SentDm
client = SentDm() # Uses SENT_DM_API_KEY env var
response = client.messages.send(
to=["+1234567890"],
template={
"id": "your_template_id_here"
},
channel=["sms", "whatsapp", "rcs"]
)
print(f"Message sent: {response.data.recipients[0].message_id}")package main
import (
"context"
"fmt"
"github.com/sentdm/sent-dm-go"
"github.com/sentdm/sent-dm-go/option"
)
func main() {
client := sentdm.NewClient(
option.WithAPIKey("your_api_key_here"),
)
response, err := client.Messages.Send(context.Background(), sentdm.MessageSendParams{
To: []string{"+1234567890"},
Channel: []string{"sms", "whatsapp", "rcs"},
Template: sentdm.MessageSendParamsTemplate{
ID: sentdm.String("your_template_id_here"),
},
})
if err != nil {
panic(err)
}
fmt.Println("Message sent:", response.Data.Recipients[0].MessageID)
}import dm.sent.client.SentDmClient;
import dm.sent.client.okhttp.SentDmOkHttpClient;
import dm.sent.models.messages.MessageSendParams;
SentDmClient client = SentDmOkHttpClient.fromEnv();
MessageSendParams params = MessageSendParams.builder()
.addTo("+1234567890")
.addChannel("sms")
.addChannel("whatsapp")
.addChannel("rcs")
.template(MessageSendParams.Template.builder()
.id("your_template_id_here")
.build())
.build();
var response = client.messages().send(params);
System.out.println("Message sent: " + response.data().recipients().get(0).messageId());using Sentdm;
using Sentdm.Models.Messages;
using System.Collections.Generic;
SentDmClient client = new(); // Uses SENT_DM_API_KEY env var
MessageSendParams parameters = new()
{
To = new List<string> { "+1234567890" },
Channels = new List<string> { "sms", "whatsapp", "rcs" },
Template = new MessageSendParamsTemplate
{
Id = "your_template_id_here"
}
};
var response = await client.Messages.Send(parameters);
Console.WriteLine($"Message sent: {response.Data.Recipients[0].MessageId}");<?php
require_once 'vendor/autoload.php';
use SentDM\Client;
$client = new Client($_ENV['SENT_DM_API_KEY']);
$result = $client->messages->send(
to: ['+1234567890'],
template: [
'id' => 'your_template_id_here'
],
channels: ['sms', 'whatsapp', 'rcs']
);
echo "Message sent: " . $result->data->recipients[0]->message_id . "\n";require "sentdm"
sent_dm = Sentdm::Client.new(
api_key: ENV["SENT_DM_API_KEY"]
)
result = sent_dm.messages.send(
to: ["+1234567890"],
template: {
id: "your_template_id_here"
},
channels: ["sms", "whatsapp", "rcs"]
)
puts "Message sent: #{result.data.recipients[0].message_id}"Use the Sent Dashboard Playground:
- Select your template
- Enter recipient phone number
- Choose channels (SMS/WhatsApp/RCS)
- Click "Send Message"
Understanding the Response
Success (HTTP 202):
{
"success": true,
"data": {
"status": "QUEUED",
"template_id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"template_name": "order_confirmation",
"recipients": [
{
"message_id": "8ba7b830-9dad-11d1-80b4-00c04fd430c8",
"to": "+14155551234",
"channel": "sms"
}
]
},
"error": null,
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-04T11:28:25.2096416+00:00",
"version": "v3"
}
}Key fields:
recipients[].message_id- Save this to track the messagerecipients[].channel- Which channel was used (automatically selected)status-QUEUEDon success; the message is now in the sending pipelinemeta.request_id- Use this for support inquiries
Track Delivery Status
Via Dashboard
View message status in the Activities page:
Via Webhooks (Recommended)
Set up webhooks to receive real-time status updates:
{
"field": "message",
"event": "message.delivered",
"timestamp": "2026-01-15T10:35:00Z",
"payload": {
"updated_at": "2026-01-15T10:35:00Z",
"account_id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"message_id": "8ba7b830-9dad-11d1-80b4-00c04fd430c8",
"template_id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
"template_name": "order_confirmation",
"outbound_number": "+14155551234",
"message_status": "DELIVERED",
"channel": "sms"
}
}The full envelope and payload schemas are in the Events Reference.
Via API
Query message status:
curl "https://api.sent.dm/v3/messages/{message_id}" \
-H "x-api-key: $SENT_API_KEY"Refer to the Message Status Tracking guide for the full status lifecycle and tracking patterns, and to the Sending Messages guide and the Send a message API reference for all send options, including channel selection and template variables.
Sandbox Mode
Test without sending real messages by adding "sandbox": true to your request body:
{
"to": ["+1234567890"],
"template": {
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8"
},
"channel": ["sms"],
"sandbox": true
}The API validates your request and returns a realistic fake response without executing any side effects: it writes nothing to the database, sends no message, and calls no external API. Look for the X-Sandbox: true header in the response.
Next Steps
You've sent your first message. Here's what to explore next:
Sending Messages Guide
Learn advanced messaging patterns
Set Up Webhooks
Receive delivery notifications
Install an SDK
Integrate with your application
Dashboard Features
Explore the full dashboard
Troubleshooting
401 Unauthorized (AUTH_002)?
- Check your API key is correct
- Ensure the
x-api-keyheader is set (notx-sender-id- that's v2 legacy)
Message shows BLOCKED (insufficient balance)?
- The v3 API accepts the send with
202, then blocks the message asynchronously when your balance is too low - Add funds or a payment method in Billing
400 Bad Request?
- Verify template ID is correct
- Check phone number format (E.164: +1234567890)
- Ensure template is approved (for WhatsApp)
Message stuck in "queued" status?
- Normal for first few seconds
- Check Activities page
- Set up webhooks for real-time updates
Create Your First Template
Create your first message template in the Sent Dashboard: add dynamic variables, submit for WhatsApp and RCS approval, and get the template ID for API sends.
The Sent Dashboard
Tour the Sent Dashboard: send messages from the playground, manage contacts and templates, generate API keys, and monitor deliverability and account balance.