SMS API — Send SMS & Configure Inbound Routing
Send outbound SMS through the PBXMe network and manage inbound SMS forwarding for SMS-enabled virtual numbers. The documented SMS Config API supports forwarding to SMS, email, or webhook destinations, while outbound SMS sending uses a separate HTTP GET endpoint.
SMS API Capabilities
Use the documented SMS Config API for inbound SMS forwarding to another SMS number, email address, or webhook URL, and use the separate outbound SMS endpoint for sending messages.
|
| ||||
| |||||
Send an Outbound SMS
Use the PBXMe outbound messaging endpoint to send SMS through our network. This call is separate from the current Postman collection.
GET https://api.pbxme.com/astppsend-sms
| Parameter | Purpose |
|---|---|
username | Your PBXMe account/API username. |
password | Your PBXMe account/API password. |
destination | Destination phone number. |
callerid | Sender / caller ID value permitted for your account. |
message | SMS message text. |
sms | Set to 1 for a normal outbound SMS request. |
whatsapp | Set to 0 for a normal outbound SMS request. |
sms=1 and whatsapp=0. This outbound messaging endpoint is operational but remains outside the current Postman collection.Authentication & API Access
Before using the documented API, whitelist the source IP address of the server making the requests in the user’s account portal. Each account has its own username and password.
For the initial Login request, send the account username/password together with the fixed x-auth-token published in the Postman documentation. A successful Login returns the account id, account_token, and a generated session x-auth-token.
For all subsequent API calls in the same session, use the generated session x-auth-token in the request header. Send the returned account id and account_token in the JSON body as the documented id and token values.
Inbound SMS Forwarding API
The documented SMS Config API manages SMS forwarding configurations. The supported actions are Add, Update, Delete, Get, and List. SMS Config supports optional forwarding destinations through dest_sms, dest_email, and webhook_url; use any supported combination required for the DID.
|
| ||||
| |||||
add, update, delete, get, and list. These actions belong to SMS forwarding configuration; they are not the outbound SMS sending API.SMS-to-Webhook Forwarding
Webhook delivery is fully operational and the destination can be configured programmatically through POST /api/sms using webhook_url, or from the customer portal.
https://example.com/api?from={CallerID}&text={SMS_TEXT}&to={SMS_DST_ADDR}
✓ {CallerID} — sender phone number | ✓ {SMS_TEXT} — text content of the SMS |
✓ {SMS_DST_ADDR} — recipient destination number | |
API setup: call POST https://newsip.pbxme.com/api/sms with action set to add or update, together with id, token, did, and webhook_url. For webhook-only forwarding, dest_sms and dest_email may be omitted.
Portal setup: alternatively, open your account and select Forward Type → API, then enter your API URL. Placeholders are replaced with live values when each SMS arrives.
Example with sender 1234567890, message Hello, recipient 0987654321:
https://example.com/api?from=1234567890&text=Hello&to=0987654321
/api/sms using webhook_url.Code Samples
The examples below keep the documented SMS forwarding API separate from the outbound SMS sending endpoint.
// Node.js 18+ (native fetch)
// Whitelist your server IP first.
// Initial Login uses the fixed x-auth-token from the Postman documentation.
const PORTAL_BASE = "https://newsip.pbxme.com";
const INITIAL_HEADERS = {
"x-auth-token": "YOUR_INITIAL_X_AUTH_TOKEN",
"Content-Type": "application/json"
};
async function parseResponse(r) {
const text = await r.text();
let body = text;
if (text) {
try { body = JSON.parse(text); } catch (e) {}
}
return { status: r.status, body };
}
// 1) Login and receive account id, account_token, and session x-auth-token
async function login() {
const r = await fetch(`${PORTAL_BASE}/api/login/`, {
method: "POST",
headers: INITIAL_HEADERS,
body: JSON.stringify({
username: "YOUR_ACCOUNT_NUMBER",
password: "YOUR_PASSWORD"
})
});
if (!r.ok) {
throw new Error(`Login failed with HTTP ${r.status}`);
}
return r.json();
}
// 2) Documented SMS Config API: forward inbound SMS to email
async function addSmsForwardToEmail(id, token, did, destEmail, sessionHeaders) {
const r = await fetch(`${PORTAL_BASE}/api/sms`, {
method: "POST",
headers: sessionHeaders,
body: JSON.stringify({
action: "add",
did,
dest_email: destEmail,
id,
token
})
});
return parseResponse(r);
}
// 3) Documented SMS Config API: forward inbound SMS to a webhook
async function addSmsForwardToWebhook(id, token, did, webhookUrl, sessionHeaders) {
const r = await fetch(`${PORTAL_BASE}/api/sms`, {
method: "POST",
headers: sessionHeaders,
body: JSON.stringify({
action: "add",
did,
webhook_url: webhookUrl,
id,
token
})
});
return parseResponse(r);
}
// 4) Separate outbound SMS endpoint (not in current Postman collection)
async function sendOutboundSms() {
const url = new URL("https://api.pbxme.com/astppsend-sms");
url.searchParams.set("username", "YOUR_USERNAME");
url.searchParams.set("password", "YOUR_PASSWORD");
url.searchParams.set("destination", "+19175550100");
url.searchParams.set("callerid", "YOUR_CALLER_ID");
url.searchParams.set("message", "Hello from PBXMe");
url.searchParams.set("sms", "1");
url.searchParams.set("whatsapp", "0");
const r = await fetch(url.toString(), { method: "GET" });
return r.text();
}
(async () => {
const auth = await login();
const id = auth.id;
const accountToken = auth.account_token;
const sessionXAuthToken = auth["x-auth-token"];
const SESSION_HEADERS = {
"x-auth-token": sessionXAuthToken,
"Content-Type": "application/json"
};
const emailForward = await addSmsForwardToEmail(
id,
accountToken,
"+447911123456",
"alerts@yourdomain.com",
SESSION_HEADERS
);
console.log("Email forwarding result:", emailForward);
const webhookForward = await addSmsForwardToWebhook(
id,
accountToken,
"+447911123456",
"https://example.com/api?from={CallerID}&text={SMS_TEXT}&to={SMS_DST_ADDR}",
SESSION_HEADERS
);
console.log("Webhook forwarding result:", webhookForward);
const outbound = await sendOutboundSms();
console.log("Outbound SMS response:", outbound);
})();# A) Documented SMS Config API — JSON body + x-auth-token header
# Whitelist your server IP first.
# 1) Login with the fixed initial x-auth-token
LOGIN=$(curl -s -X POST "https://newsip.pbxme.com/api/login/" \
-H "x-auth-token: YOUR_INITIAL_X_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username":"YOUR_ACCOUNT_NUMBER",
"password":"YOUR_PASSWORD"
}')
ID=$(echo "$LOGIN" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
TOKEN=$(echo "$LOGIN" | python3 -c "import sys,json; print(json.load(sys.stdin)['account_token'])")
SESSION_X_AUTH_TOKEN=$(echo "$LOGIN" | python3 -c "import sys,json; print(json.load(sys.stdin)['x-auth-token'])")
# 2) Add inbound SMS forwarding to another SMS number
curl -s -i -X POST "https://newsip.pbxme.com/api/sms" \
-H "x-auth-token: $SESSION_X_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action":"add",
"did":"+447911123456",
"dest_sms":"+19175550100",
"id":"'"$ID"'",
"token":"'"$TOKEN"'"
}'
# 3) Add inbound SMS forwarding to a webhook
curl -s -i -X POST "https://newsip.pbxme.com/api/sms" \
-H "x-auth-token: $SESSION_X_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action":"add",
"did":"+447911123456",
"webhook_url":"https://example.com/api?from={CallerID}&text={SMS_TEXT}&to={SMS_DST_ADDR}",
"id":"'"$ID"'",
"token":"'"$TOKEN"'"
}'
# 4) List SMS forwarding configurations
curl -s -i -X POST "https://newsip.pbxme.com/api/sms" \
-H "x-auth-token: $SESSION_X_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action":"list",
"id":"'"$ID"'",
"token":"'"$TOKEN"'"
}'
# B) Separate outbound SMS API — not in current Postman collection
curl -G "https://api.pbxme.com/astppsend-sms" \
--data-urlencode "username=YOUR_USERNAME" \
--data-urlencode "password=YOUR_PASSWORD" \
--data-urlencode "destination=+19175550100" \
--data-urlencode "callerid=YOUR_CALLER_ID" \
--data-urlencode "message=Hello from PBXMe" \
--data-urlencode "sms=1" \
--data-urlencode "whatsapp=0"More API Guides
|
| ||||
|
|
FAQ — SMS API
Can I send outbound SMS through the PBXMe API?
Yes. PBXMe provides a separate outbound SMS endpoint at https://api.pbxme.com/astppsend-sms. It is available for integrations but is not currently included in the public Postman collection. Your source IP must first be allowed under My Account → IP Settings. For a normal SMS request, use sms=1 and whatsapp=0.
Can I receive SMS on a virtual local number?
Yes, on SMS-enabled virtual numbers. Incoming SMS can be forwarded to another SMS number, email address, or webhook URL using the documented SMS Config API. Webhook destinations can also be configured through the customer portal.
Can I configure SMS-to-webhook forwarding by API?
Yes. Configure inbound SMS-to-webhook routing programmatically through POST /api/sms using the webhook_url field. Use the generated session x-auth-token in the request header, and send the returned account id and account_token in the request body as id and token. The same destination can also be configured in your account under Forward Type → API.
Which SMS forwarding actions are documented?
The SMS Config API documents Add, Update, Delete, Get, and List operations for forwarding configurations, including SMS, email, and webhook destinations.
Which countries support SMS on virtual numbers?
SMS support varies by country and number type. Check available DID types for your target country before provisioning to confirm SMS capability.
Build SMS into Your Application
Send outbound messages, manage inbound SMS forwarding, and connect incoming messages to your application workflow.
