Contact admin to create a client account and receive your API keys.
https://your-nexsms-domain.com/apiInclude your API keys in the headers for all requests:
Use the /api/messages/send endpoint to send SMS messages:
{
"to": "+1234567890",
"body": "Hello from NEXSMS!",
"scheduledAt": "2026-03-16T10:30:00.000Z"
}Note: Phone numbers are not stored or managed server-side. Always provide the destination number in the to field for each request.
{
"success": true,
"data": {
"messageId": 10234,
"status": "queued",
"remainingQuota": 9
}
}Request constraints: body must be 800 characters or fewer. Rate limit is 10 requests per minute per client.
curl -X POST https://your-domain.com/api/messages/send -H "Content-Type: application/json" -H "x-public-key: YOUR_PUBLIC_KEY" -H "x-secret-key: YOUR_SECRET_KEY" -d '{
"to": "+1234567890",
"body": "Hello from NEXSMS!"
}'The device processes queued messages and sends SMS using the providedto number; no phone number registry exists on the server.
Devices fetch queued messages via /api/device/messages/pending and report status (sent, failed, or expired) via /api/device/messages/[messageId]/status. A device is considered online if it has attempted a poll in the last 4 minutes. When no device is specified, the server selects an active device and prioritizes devices that are online.
200 - OK201 - Created400 - Bad Request401 - Unauthorized403 - Forbidden404 - Not Found429 - Rate Limited500 - Internal Server Error// Send SMS using fetch API
const sendSMS = async (to, body, scheduledAt) => {
const response = await fetch('https://your-domain.com/api/messages/send', {
method: 'POST',
headers: {
'X-Public-Key': 'YOUR_PUBLIC_KEY',
'X-Secret-Key': 'YOUR_SECRET_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ to, body, scheduledAt })
});
return await response.json();
};
// Usage
sendSMS('+1234567890', 'Hello from NEXSMS!')
.then(result => console.log('Message sent:', result))
.catch(error => console.error('Error:', error));