Send
The /send endpoint allows you to send SMSs and emails to your contacts.
Send a single SMS
POST /send/sms
Send a single SMS to a contact.
- 🔐 Permissions:
["sendLog.create"]
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
content | string | ✅ | The content of the SMS. Can include templates if you're only sending to contacts in your org |
cell | string | ✅ | The cell number of the contact you want to send the SMS to |
skipNonContacts | boolean | ✅ | Whether to skip sending to contacts not in your org |
country | string | ✅ | The country code to send to. |
deliveryMethod | 'reverse' | 'standard' | 'transactional' | ✅ | The delivery method to use. |
campaign_id | string | ❌ | The id of the campaign to associate with this send. Allows hooks to trigger on reply. |
sendOptions | SendOptions | ❌ | The options for the SMS |
Example
{
"content": "Hello World",
"cell": "0111111111",
"skipNonContacts": true,
"country": "ZA",
"deliveryMethod": "reverse",
"campaign_id": "123",
"sendOptions": {
"testMode": true
}
}
Response
Success
{
ok: true,
data: {
// A unique id identifying this particular send
// Useful for querying the delivery status of this send
customerId: string,
totalCost: number,
}
}
Error
{
ok: false;
// A string, or a validation issue like { code: "invalid_enum_value", path: ["country"], message: "...", ... }
error: string | { code: string; message: string; path: (string | number)[] };
}
POST /send/sms answers before the SMS is sent, so problems found while sending, like an insufficient balance, aren't in the response. See the Error Handling Library for every error this endpoint returns.
Send a single email
POST /send/email
Send one of a campaign's email templates to a single contact, straight away. For example, a welcome email right after someone signs up.
- 🔐 Permissions:
["sendLog.create"]
The email is linked to the campaign, the same as a campaign send: it counts in the campaign's reports, and {{CLICK_URL}} in the template tracks clicks against it.
The recipient must already be a contact in your org with this email address. Upload them first with PUT /contacts. To do both in one request, use the send option there instead.
The campaign must be active, and the from address must belong to a verified email identity.
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id | string | ✅ | The campaign to send from, and attribute the send to |
email | string | ✅ | The email address of the contact to send to |
from | string | ✅ | The email address to send from |
from_name | string | ❌ | The name to send from |
template | TemplateSelector | ❌ | Which of the campaign's email templates to send. { "kind": "manual", "data": { "template_id": "..." } }, { "kind": "random", "data": {} } (default), or { "kind": "best", "data": {} } |
to_start_at | string | ❌ | Schedule to send for a future time. Default is to send immediately. |
Example
{
"campaign_id": "689a0b0c0d0e0f0g0h0i0",
"email": "[email protected]",
"from": "[email protected]",
"from_name": "Your Brand",
"template": {
"kind": "manual",
"data": { "template_id": "680a0b0c0d0e0f0g0h0i1" }
}
}
Response
Success
{
ok: true,
data: { message: "Email queued" }
}
Error
{
ok: false;
// e.g. "No contacts found (campaign_id:...)" when no contact has this email
error: string;
}
Send bulk email
POST /send/email/bulk
Send a bulk email to multiple recipients.
- 🔐 Permissions:
["sendLog.create"]
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
from | string | ✅ | The email address to send form |
template_id | string | ✅ | The _id of the email template to send |
destinations | string[] | ✅ | The list of email addresses to send to |
filter_non_contacts | boolean | ❌ | Filter out email addresses that aren't in your Dripcel contacts. Required if the template you're sending contains custom fields to replace. |
to_start_at | string | ❌ | Schedule to send for a future time. Default is to send immediately. |
Example
{
"from": "[email protected]",
"template_id": "template123",
"destinations": ["[email protected]"],
"filter_non_contacts": true,
"to_start_at": "2023-10-01T12:00:00Z"
}
Response
Success
{
ok: true,
data: { }
}
Error
{
ok: false;
error: string;
}