Authentication
All requests to the SalamTalk REST API require HTTPS and authentication via an API Key passed in the Authorization header using the Bearer scheme.
cURL
Node.js
Python
Copy Code
curl -X GET "https://api.salamtalk.com/v1/account" \
-H "Authorization: Bearer sk_live_89f72b9104ca81e" \
-H "Content-Type: application/json"
import { SalamTalkClient } from '@salamtalk/node-sdk';
const client = new SalamTalkClient({
apiKey: 'sk_live_89f72b9104ca81e'
});
const account = await client.account.get();
console.log('Account ID:', account.id);
from salamtalk import SalamTalkClient
client = SalamTalkClient(api_key="sk_live_89f72b9104ca81e")
account = client.account.get()
print(f"Connected: {account['company_name']}")
{
"status": "success",
"data": {
"account_id": "act_88291048",
"company_name": "Acme Enterprise Corp",
"tier": "enterprise_telephony",
"active_numbers": 48,
"sip_trunks_active": 6
}
}
Initiate a high-definition programmable voice call between your application and any PSTN phone number, SIP endpoint, or browser WebRTC client.
Field
Type
Description
to required
string (E.164)
Destination phone number (e.g. +12128479201).
from required
string (E.164)
Your provisioned SalamTalk number to present as Caller ID.
webhook_url optional
string (URL)
Webhook endpoint to receive call status events (ringing, answered, ended).
record optional
boolean
Set to true to enable automatic encrypted recording & AI transcription.
cURL
Node.js
Python
Copy Code
curl -X POST "https://api.salamtalk.com/v1/calls" \
-H "Authorization: Bearer sk_live_89f72b9104ca81e" \
-H "Content-Type: application/json" \
-d '{
"to": "+12128479201",
"from": "+18005550199",
"record": true,
"webhook_url": "https://api.yourdomain.com/webhooks/voice"
}'
const call = await client.calls.create({
to: '+12128479201',
from: '+18005550199',
record: true,
webhookUrl: 'https://api.yourdomain.com/webhooks/voice'
});
console.log('Call dispatched with SID:', call.id);
call = client.calls.create(
to="+12128479201",
from_="+18005550199",
record=True,
webhook_url="https://api.yourdomain.com/webhooks/voice"
)
print(f"Call initiated: {call['id']}")
⚡ Interactive API Sandbox
Execute Request ▶
Sending POST /v1/calls ...
Send an SMS or multimedia MMS message with real-time delivery status receipts and automated 10DLC compliance.
Field
Type
Description
to required
string
Destination mobile phone number formatted in E.164.
body required
string
Text content of message (up to 1,600 characters with auto-concatenation).
media_urls optional
array of strings
Public image/PDF URLs to attach for MMS transmission.
cURL
Node.js
Python
Copy Code
curl -X POST "https://api.salamtalk.com/v1/messages" \
-H "Authorization: Bearer sk_live_89f72b9104ca81e" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155552671",
"from": "+18005550199",
"body": "Hello! Your SalamTalk appointment is confirmed for 2:00 PM EST."
}'
const message = await client.messages.create({
to: '+14155552671',
from: '+18005550199',
body: 'Hello! Your SalamTalk appointment is confirmed for 2:00 PM EST.'
});
console.log('Message status:', message.status);
message = client.messages.create(
to="+14155552671",
from_="+18005550199",
body="Hello! Your SalamTalk appointment is confirmed for 2:00 PM EST."
)
print(f"Sent ID: {message['id']}")
{
"id": "msg_90184712",
"status": "queued",
"to": "+14155552671",
"from": "+18005550199",
"segments": 1,
"carrier": "T-Mobile USA",
"created_at": "2026-09-29T03:30:00Z"
}
Search for available phone numbers across 100+ countries by country code, area code, vanity pattern, or capability flags.
curl -X GET "https://api.salamtalk.com/v1/numbers/available?country=US&area_code=212&type=local" \
-H "Authorization: Bearer sk_live_89f72b9104ca81e"
const available = await client.numbers.search({
country: 'US',
areaCode: '212',
type: 'local'
});
console.log('Found numbers:', available.data);
{
"count": 3,
"numbers": [
{ "phone_number": "+12128479201", "locality": "New York", "rate_monthly": 1.50, "sms_enabled": true },
{ "phone_number": "+12128479202", "locality": "New York", "rate_monthly": 1.50, "sms_enabled": true },
{ "phone_number": "+12128479203", "locality": "New York", "rate_monthly": 1.50, "sms_enabled": true }
]
}
Webhooks & Real-Time Events
SalamTalk signs all outgoing webhook payloads using HMAC-SHA256. Verify signatures to guarantee requests originate from our secure telecom infrastructure.
Node.js Webhook Signature Validator
Copy Code
import crypto from 'crypto';
export function verifyWebhookSignature(payload, signatureHeader, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = 'sha256=' + hmac.update(payload).digest('hex');
return crypto.timingSafeEqual(Buffer.from(digest), Buffer.from(signatureHeader));
}