Skip to content

Messages

Manage the sending and querying of messages through multiple channels like SMS and Email. SendMe123’s messaging system allows you to send individual or batch messages with complete delivery status tracking.

All messaging endpoints are asynchronous: the API records every message in persistence, schedules delivery in BullMQ, and returns an enqueue summary.

Message endpoints allow you to send communications and query the history of sent messages.

MethodEndpointDescription
GET/api/messagesGet paginated list of messages
POST/api/messages/sms/contactsSend SMS to specific contacts
POST/api/messages/sms/allSend SMS to all contacts
POST/api/messages/sms/tagsSend SMS by tags
POST/api/messages/email/contactsSend Email to specific contacts
POST/api/messages/email/allSend Email to all contacts
POST/api/messages/email/tagsSend Email by tags

Explore the available endpoints:

StatusDescription
QUEUEDMessage queued for sending
SENDINGMessage being sent
SENTMessage sent to provider
DELIVEREDMessage delivered to recipient
UNDELIVEREDMessage could not be delivered
FAILEDSending error
RECEIVEDMessage received by recipient
SCHEDULEDMessage scheduled for future sending
CANCELEDMessage canceled
READMessage read by recipient
TypeChannelDescription
smsSMSStandard text message
otpSMSVerification code (OTP)
flashSMSFlash message (appears immediately)
emailEmailElectronic mail
  • PLAIN_TEXT: Unformatted text
  • HTML: HTML content for emails
  • SMS: Plain text, maximum 160 characters per segment
  • Email: HTML and plain text, maximum 10MB per message
  • Numbers: Without country prefix (use countryCode field)
  • Emails: Valid addresses according to RFC 5322
  • Maximum 1000 recipients per request
  • Rate limiting: 100 requests per minute
  • SMS: Maximum 1000 characters (divided into segments)
  • Email: Maximum 10MB including attachments
const sendSMS = async () => {
try {
const response = await axios.post('https://app.sendme123.com/api/messages/sms/contacts', {
message: 'Hello, this is a test message',
contacts: ['3001234567'],
country: 'CO'
}, {
headers: {
'Authorization': 'Bearer your-token-here',
'Content-Type': 'application/json'
}
});
console.log('SMS enqueued:', response.data);
return response.data;
} catch (error) {
console.error('Error sending SMS:', error.response?.data || error.message);
throw error;
}
};
const sendEmail = async () => {
try {
const response = await axios.post('https://app.sendme123.com/api/messages/email/contacts', {
subject: 'Welcome to SendMe',
message: '<h1>Welcome!</h1><p>Thank you for joining us.</p>',
contacts: ['[email protected]']
}, {
headers: {
'Authorization': 'Bearer your-token-here',
'Content-Type': 'application/json'
}
});
console.log('Email enqueued:', response.data);
return response.data;
} catch (error) {
console.error('Error sending Email:', error.response?.data || error.message);
throw error;
}
};
const sendEmail = async () => {
try {
const response = await axios.post('https://app.sendme123.com/api/messages/send/email', {
subject: 'Registration confirmation',
contacts: ['[email protected]'],
message: 'Welcome to our platform'
}, {
headers: {
'api-key': 'your-api-key-here',
'Content-Type': 'application/json'
}
});
console.log('Email sent:', response.data);
return response.data;
} catch (error) {
console.error('Error sending email:', error.response?.data || error.message);
throw error;
}
};