Programmatic Voice & SMS Communication
The DialAnyone API allows you to programmatically make phone calls and send SMS messages using your DialAnyone phone numbers. This RESTful API uses API key authentication and returns JSON responses.
The DialAnyone API enables developers to integrate voice calling and SMS messaging into their applications. Our API uses a conference-style calling approach perfect for programmatic use - we ring your phone first, then connect to the target number.
Make international calls programmatically with our conference-style approach.
Send and receive SMS messages with webhook notifications.
https://dialanyone.com/api/v1
All API requests must include your API key in the Authorization header. You can create and manage API keys in your dashboard.
Authorization: Bearer dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keep your API keys secure and never expose them in client-side code. Store them as environment variables in your server applications.
API requests are rate-limited to ensure fair usage:
Rate limit information is included in response headers:
X-RateLimit-Limit
- Maximum requests allowedX-RateLimit-Remaining
- Requests remainingX-RateLimit-Reset
- Unix timestamp when limit resetsGet your account information including credit balance and available phone numbers.
GET /api/v1/me
{
"email": "user@example.com",
"user": {
"id": "user_abc123",
"email": "user@example.com",
"credits_balance": 1250.75
},
"phone_numbers": {
"purchased": [
{
"id": "pn_def456",
"number": "+14155551234",
"capabilities": ["voice", "sms"],
"created_at": "2024-01-01T12:00:00Z"
}
],
"ported": [
{
"id": "pn_ghi789",
"number": "+14155555678",
"capabilities": ["voice", "sms"],
"created_at": "2024-01-01T14:00:00Z"
}
],
"outgoing_only": []
},
"totals": {
"total_numbers": 2,
"purchased_count": 1,
"ported_count": 1,
"outgoing_only_count": 0
}
}
purchased: Numbers bought through DialAnyone
ported: Numbers transferred from another provider
outgoing_only: Numbers for outbound calls only
Initiate a conference call by first ringing the user number, then connecting to the target number. This approach works perfectly for API usage where no browser interface is available. You'll be billed for both numbers being called.
POST /api/v1/calls
{
"user_number": "+14155551234",
"target_number": "+14155555678"
}
{
"call_id": "call_abc123def456",
"status": "initiating",
"user_number": "+14155551234",
"target_number": "+14155555678",
"estimated_cost_per_minute": 5.0,
"created_at": "2024-01-01T12:00:00Z"
}
{
"error": {
"code": "insufficient_credits",
"message": "Your account does not have enough credits to complete this operation",
"details": {
"required_credits": 50,
"current_balance": 10
}
}
}
Send SMS messages from your DialAnyone phone numbers with automatic credit deduction.
POST /api/v1/sms
{
"from": "+14155551234",
"to": "+14155555678",
"body": "Hello from DialAnyone API!"
}
{
"message_id": "msg_xyz789abc123",
"status": "sent",
"from": "+14155551234",
"to": "+14155555678",
"segments": 1,
"estimated_cost": 2.5,
"created_at": "2024-01-01T12:00:00Z"
}
Configure webhook URLs in your API key settings to receive real-time notifications for incoming calls and SMS messages.
You can configure separate webhook URLs for different event types:
All webhooks include an X-DialAnyone-Signature
header with an HMAC-SHA256 signature:
import hmac
import hashlib
def verify_webhook(body, signature, secret):
expected = hmac.new(
secret.encode(),
body.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)
{
"event": "incoming_call",
"call_id": "call_abc123def456",
"from": "+14155555678",
"to": "+14155551234",
"timestamp": "2024-01-01T12:00:00Z"
}
{
"event": "incoming_sms",
"message_id": "msg_xyz789abc123",
"from": "+14155555678",
"to": "+14155551234",
"body": "Reply message text",
"timestamp": "2024-01-01T12:00:00Z"
}
Webhook subscriptions allow you to programmatically register webhook URLs to receive real-time notifications for incoming calls and SMS messages. Perfect for Zapier, Make.com, and other integration platforms.
Every webhook subscription automatically tests delivery to verify your endpoint is working correctly.
Register a webhook URL to receive notifications for specific event types. Your webhook will be tested immediately to ensure it's working.
POST /api/v1/webhooks/subscribe
{
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_call", "incoming_sms"]
}
Optional Fields:webhook_secret
can be included for HMAC signature verification, but it's not required for Zapier and most integration platforms.
{
"success": true,
"subscription": {
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_call", "incoming_sms"],
"created_at": "2024-01-01T12:00:00Z",
"test_delivery_status": "success"
},
"test_results": {
"call_test": {
"success": true
},
"sms_test": {
"success": true
}
}
}
Automatic Testing: When you subscribe, we immediately send test events to your webhook URL. If the tests fail, check your endpoint and use the dedicated test endpoint below.
Get all webhook subscriptions for your API key.
GET /api/v1/webhooks/subscriptions
{
"success": true,
"subscriptions": {
"call_webhook_url": "https://your-app.com/webhooks/calls",
"sms_webhook_url": "https://your-app.com/webhooks/sms",
"call_webhook_secret": "secret_for_calls",
"sms_webhook_secret": "secret_for_sms"
},
"totals": {
"total_subscriptions": 2,
"has_call_webhook": true,
"has_sms_webhook": true
}
}
Manually test webhook delivery to verify your endpoint is working correctly.
POST /api/v1/webhooks/test
{
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_call", "incoming_sms"]
}
{
"success": true,
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_call", "incoming_sms"],
"overall_success": true,
"message": "All webhook tests completed successfully",
"test_results": {
"call_test": {
"success": true
},
"sms_test": {
"success": true
}
}
}
Use this endpoint to: Debug webhook issues, test new endpoints before subscribing, or verify that your webhook handling is working correctly.
Remove a webhook subscription for specific event types or all events.
DELETE /api/v1/webhooks/unsubscribe
{
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_call", "incoming_sms"]
}
Note: If event_types
is omitted, the webhook will be unsubscribed from all event types.
{
"success": true,
"message": "Webhook subscription removed successfully",
"removed_subscription": {
"webhook_url": "https://your-app.com/webhooks/dialanyone",
"event_types": ["incoming_sms"],
"created_at": "2024-01-01T12:00:00Z"
}
}
All subscription webhooks receive events in a standardized format:
{
"event_type": "incoming_call",
"event_id": "evt_1640995200_abc123def",
"timestamp": "2024-01-01T12:00:00Z",
"data": {
"event": "incoming_call",
"call_id": "call_abc123def456",
"from": "+14155555678",
"to": "+14155551234",
"timestamp": "2024-01-01T12:00:00Z"
}
}
{
"event_type": "incoming_sms",
"event_id": "evt_1640995260_xyz789abc",
"timestamp": "2024-01-01T12:01:00Z",
"data": {
"event": "incoming_sms",
"message_id": "msg_xyz789abc123",
"from": "+14155555678",
"to": "+14155551234",
"body": "Hello from integration platform!",
"timestamp": "2024-01-01T12:01:00Z"
}
}
Triggered when someone calls one of your DialAnyone phone numbers
Triggered when someone sends an SMS to one of your DialAnyone phone numbers
Here's how to set up DialAnyone webhooks with Zapier using REST Hook triggers:
Our webhook subscription API is designed specifically for integration platforms like Zapier that use REST Hook triggers.
// In your Zapier app's trigger configuration:
const subscribeHook = async (z, bundle) => {
const response = await z.request({
url: 'https://dialanyone.com/api/v1/webhooks/subscribe',
method: 'POST',
headers: {
'Authorization': `Bearer ${bundle.authData.api_key}`,
'Content-Type': 'application/json'
},
body: {
webhook_url: bundle.targetUrl,
event_types: ['incoming_call', 'incoming_sms']
}
});
return response.data;
};
const unsubscribeHook = async (z, bundle) => {
await z.request({
url: 'https://dialanyone.com/api/v1/webhooks/unsubscribe',
method: 'DELETE',
headers: {
'Authorization': `Bearer ${bundle.authData.api_key}`,
'Content-Type': 'application/json'
},
body: {
webhook_url: bundle.targetUrl,
event_types: ['incoming_call', 'incoming_sms']
}
});
return {};
};
// Process incoming webhook data in your Zapier trigger:
const parseWebhook = (z, bundle) => {
const webhook = bundle.cleanedRequest;
// Extract data based on event type
if (webhook.event_type === 'incoming_call') {
return [{
id: webhook.data.call_id,
caller: webhook.data.from,
called_number: webhook.data.to,
timestamp: webhook.timestamp,
event_type: 'call'
}];
}
if (webhook.event_type === 'incoming_sms') {
return [{
id: webhook.data.message_id,
from: webhook.data.from,
to: webhook.data.to,
message: webhook.data.body,
timestamp: webhook.timestamp,
event_type: 'sms'
}];
}
return [];
};
Webhook subscriptions are designed for integration platforms that need to dynamically register and manage webhook endpoints. Each subscription is tied to your API key and will receive events for phone numbers associated with your account.
const axios = require('axios');
const client = axios.create({
baseURL: 'https://dialanyone.com/api/v1',
headers: {
'Authorization': 'Bearer dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json'
}
});
// Get user information
async function getUserInfo() {
try {
const response = await client.get('/me');
console.log('User info:', response.data);
console.log('Credit balance:', response.data.user.credits_balance);
console.log('Phone numbers:', response.data.phone_numbers);
} catch (error) {
console.error('Error:', error.response.data);
}
}
// Make a call
async function makeCall(userNumber, targetNumber) {
try {
const response = await client.post('/calls', {
user_number: userNumber,
target_number: targetNumber
});
console.log('Call initiated:', response.data.call_id);
} catch (error) {
console.error('Error:', error.response.data);
}
}
// Send SMS
async function sendSMS(from, to, body) {
try {
const response = await client.post('/sms', {
from: from,
to: to,
body: body
});
console.log('SMS sent:', response.data.message_id);
} catch (error) {
console.error('Error:', error.response.data);
}
}
import requests
class DialAnyoneClient:
def __init__(self, api_key):
self.base_url = 'https://dialanyone.com/api/v1'
self.headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
def get_user_info(self):
response = requests.get(
f'{self.base_url}/me',
headers=self.headers
)
response.raise_for_status()
return response.json()
def make_call(self, user_number, target_number):
response = requests.post(
f'{self.base_url}/calls',
json={
'user_number': user_number,
'target_number': target_number
},
headers=self.headers
)
response.raise_for_status()
return response.json()
def send_sms(self, from_number, to_number, body):
response = requests.post(
f'{self.base_url}/sms',
json={
'from': from_number,
'to': to_number,
'body': body
},
headers=self.headers
)
response.raise_for_status()
return response.json()
# Usage
client = DialAnyoneClient('dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
# Get user info
user_info = client.get_user_info()
print(f"Credit balance: {user_info['user']['credits_balance']}")
# Make a call
call = client.make_call('+14155551234', '+14155555678')
print(f"Call ID: {call['call_id']}")
# Get user information
curl -X GET https://dialanyone.com/api/v1/me \
-H "Authorization: Bearer dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Make a call
curl -X POST https://dialanyone.com/api/v1/calls \
-H "Authorization: Bearer dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"user_number": "+14155551234",
"target_number": "+14155555678"
}'
# Send SMS
curl -X POST https://dialanyone.com/api/v1/sms \
-H "Authorization: Bearer dk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"from": "+14155551234",
"to": "+14155555678",
"body": "Hello from DialAnyone API!"
}'
Never commit API keys to version control. Use environment variables in your server applications.
Always verify webhook signatures to ensure requests are authentic.
Implement exponential backoff and respect rate limit headers.
Ensure phone numbers are in E.164 format before sending requests.
Set up low balance alerts to avoid service interruptions.
Our support team is here to help you integrate the DialAnyone API.