API Reference
SMS
Send outbound SMS messages from your Staffify phone numbers. The sender type is determined automatically based on the destination country.
Long code (US / Canada)
Your owned Staffify number appears as the sender.
Requires from_number (your Telnyx number in E.164)
EUR 0.02 / message
Alphanumeric (EU / UK / AU)
A brand name appears as the sender instead of a phone number.
sender_name used (max 11 chars, default "Staffify AI")
EUR 0.09 / message (UK / AU) • EUR 0.14 / message (EU)
POST
/v1/sms| Field | Type | Required | Description |
|---|---|---|---|
| to | string | Destination phone number in E.164 format | |
| message | string | Message body (max 160 characters) | |
| from_number | string | optional | Your Staffify number in E.164. Required for US/CA. |
| sender_name | string | optional | Alphanumeric sender name for EU/UK/AU (max 11 chars, default "Staffify AI") |
curl -X POST https://api.staffifyai.com/v1/sms \
-H "Authorization: Bearer sfy_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"message": "Your appointment is confirmed for tomorrow at 10am.",
"from_number": "+31201234567"
}'US/Canada (long code)
curl -X POST https://api.staffifyai.com/v1/sms \
-H "Authorization: Bearer sfy_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"from_number": "+14155559876",
"message": "Your order #1234 has shipped."
}'Response
{
"success": true,
"message_id": "sms_00000001",
"to": "+31612345678",
"country": "NL",
"sender_type": "alphanumeric",
"cost_eur": 0.14
}Node.js helper
async function sendSms(to, message, options = {}) {
const res = await fetch('https://api.staffifyai.com/v1/sms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.STAFFIFY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ to, message, ...options }),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(error);
}
return res.json();
}
// EU: alphanumeric sender
await sendSms('+31612345678', 'Your order is ready!', { sender_name: 'MyShop' });
// US: long code (owned number required)
await sendSms('+12125551234', 'Your order is ready!', { from_number: '+12125559876' });Supported countries
USCAGBAUNLDEFRESITBESEDKNOFIPLPT
Behavior notes
Sender name truncation
If sender_name exceeds 11 characters, it is silently truncated to 11 characters. The message field is trimmed of leading/trailing whitespace before sending.
Common errors
| HTTP | Error |
|---|---|
| 400 | Message too long -- over 160 characters |
| 400 | Invalid 'to' phone number -- must be E.164 format |
| 400 | 'from_number' is required for US/CA SMS |
| 400 | SMS is not supported for this destination country |