Voicemail Notifications
Set up notifications to alert voicemail box owners when new messages arrive. Support for email, SMS, and webhook notifications.
Endpoints​
Create Notification​
POST https://api.audian.com:8443/v2/voicemail/boxes/{boxId}/notifications
List Notifications​
GET https://api.audian.com:8443/v2/voicemail/boxes/{boxId}/notifications
Update Notification​
PUT https://api.audian.com:8443/v2/voicemail/boxes/{boxId}/notifications/{notificationId}
Delete Notification​
DELETE https://api.audian.com:8443/v2/voicemail/boxes/{boxId}/notifications/{notificationId}
Create Notification​
Set up a notification for new voicemail messages.
Request​
curl -X POST https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications \
-H "X-Auth-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"recipient": "john.smith@company.com",
"notify_on": ["new_message"],
"include_transcript": true
}'
Headers​
Content-Type: application/json
X-Auth-Token: YOUR_API_KEY
Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | Yes | Notification type (email, sms, webhook) |
recipient | String | Yes | Email, phone, or webhook URL |
notify_on | Array | No | Events to notify (new_message, message_deleted, box_full) |
include_transcript | Boolean | No | Include message transcript (default: false) |
include_audio | Boolean | No | Include audio attachment (default: false) |
enabled | Boolean | No | Enable notification (default: true) |
Examples​
Email Notification with Transcript​
curl -X POST https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications \
-H "X-Auth-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"recipient": "john.smith@company.com",
"notify_on": ["new_message"],
"include_transcript": true,
"include_audio": false
}'
SMS Notification​
curl -X POST https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications \
-H "X-Auth-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"recipient": "+12025551234",
"notify_on": ["new_message"],
"include_transcript": false
}'
Webhook Notification​
curl -X POST https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications \
-H "X-Auth-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "webhook",
"recipient": "https://your-domain.com/webhook/voicemail",
"notify_on": ["new_message", "box_full"],
"include_transcript": true,
"include_audio": false
}'
JavaScript/Node.js​
const axios = require('axios');
const createNotification = async (boxId, type, recipient, options = {}) => {
try {
const response = await axios.post(
`https://api.audian.com:8443/v2/voicemail/boxes/${boxId}/notifications`,
{
type: type,
recipient: recipient,
notify_on: options.notify_on || ['new_message'],
include_transcript: options.include_transcript || false,
include_audio: options.include_audio || false,
enabled: options.enabled !== false
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log('Notification created:', response.data);
return response.data;
} catch (error) {
console.error('Failed to create notification:', error);
}
};
// Usage
createNotification('box_abc123def456', 'email', 'john@company.com', {
notify_on: ['new_message'],
include_transcript: true
});
Python​
import requests
def create_notification(api_key, box_id, notification_type, recipient,
notify_on=None, include_transcript=False,
include_audio=False, enabled=True):
url = f'https://api.audian.com:8443/v2/voicemail/boxes/{box_id}/notifications'
headers = {
'X-Auth-Token': api_key,
'Content-Type': 'application/json'
}
payload = {
'type': notification_type,
'recipient': recipient,
'notify_on': notify_on or ['new_message'],
'include_transcript': include_transcript,
'include_audio': include_audio,
'enabled': enabled
}
response = requests.post(url, headers=headers, json=payload)
return response.json()
# Usage
result = create_notification(
api_key='YOUR_API_KEY',
box_id='box_abc123def456',
notification_type='email',
recipient='john@company.com',
notify_on=['new_message'],
include_transcript=True
)
print(result)
Multiple Email Notifications​
const emails = [
'john.smith@company.com',
'john.backup@company.com',
'manager@company.com'
];
for (const email of emails) {
await createNotification('box_abc123def456', 'email', email, {
notify_on: ['new_message'],
include_transcript: true
});
}
Response Format​
Create Notification Success (201)​
{
"id": "notif_abc123",
"box_id": "box_abc123def456",
"type": "email",
"recipient": "john.smith@company.com",
"notify_on": ["new_message"],
"include_transcript": true,
"include_audio": false,
"enabled": true,
"created_at": "2024-02-04T12:30:00Z",
"updated_at": "2024-02-04T12:30:00Z"
}
List Notifications Success (200)​
{
"notifications": [
{
"id": "notif_abc123",
"type": "email",
"recipient": "john.smith@company.com",
"notify_on": ["new_message"],
"enabled": true
},
{
"id": "notif_def456",
"type": "sms",
"recipient": "+12025551234",
"notify_on": ["new_message", "box_full"],
"enabled": true
}
],
"total": 2
}
Notification Types​
Email Notification​
- Recipients receive emails with message details
- Can include transcript and audio file
- Ideal for office workers with email access
SMS Notification​
- Text message alerts for immediate notification
- Brief message format
- Ideal for urgent messages and on-the-go alerting
Webhook Notification​
- HTTP POST to your application
- Full control over message processing
- Ideal for integration with other systems
Notification Events​
| Event | Description |
|---|---|
new_message | New voicemail message received |
message_deleted | Voicemail message was deleted |
box_full | Mailbox has reached capacity |
greeting_changed | Greeting was updated |
box_disabled | Voicemail box was disabled |
Update Notification​
Modify an existing notification.
curl -X PUT https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications/notif_abc123 \
-H "X-Auth-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"include_transcript": true,
"include_audio": true,
"enabled": true
}'
Delete Notification​
Remove a notification from a voicemail box.
curl -X DELETE https://api.audian.com:8443/v2/voicemail/boxes/box_abc123def456/notifications/notif_abc123 \
-H "X-Auth-Token: YOUR_API_KEY"
Webhook Payload Format​
Webhook notifications will POST JSON to your endpoint:
{
"event": "new_message",
"box_id": "box_abc123def456",
"message_id": "msg_abc123",
"caller_number": "+12025551234",
"caller_name": "John Smith",
"received_at": "2024-02-04T12:30:00Z",
"duration": 45,
"transcript": "Hi, this is John calling about the meeting.",
"audio_url": "https://api.audian.com:8443/v2/voicemail/messages/msg_abc123/audio"
}
Best Practices​
- Multiple Channels: Use both email and SMS for redundancy
- Transcripts: Enable transcripts for quick message review
- Audio Attachments: Limit attachments for email notification limits
- Testing: Test notifications before deployment
- Filtering: Use appropriate notification events
- Monitoring: Monitor webhook delivery for failures
Common Setups​
Personal Box​
{
type: 'email',
recipient: 'user@company.com',
notify_on: ['new_message'],
include_transcript: true
}
Department Box​
{
type: 'email',
recipient: 'department@company.com',
notify_on: ['new_message', 'box_full'],
include_transcript: false
}
Executive with Backup​
// Primary notification
{
type: 'email',
recipient: 'executive@company.com',
include_transcript: true
}
// Backup SMS
{
type: 'sms',
recipient: '+1-executive-phone',
notify_on: ['new_message']
}
Integration with CRM​
{
type: 'webhook',
recipient: 'https://crm.company.com/api/voicemail',
notify_on: ['new_message'],
include_transcript: true,
include_audio: false
}
Limits and Quotas​
- Max notifications per box: 20
- Email notifications: Unlimited
- SMS notifications: Subject to SMS provider limits
- Webhook notifications: 10 concurrent deliveries
- Retry attempts: 5 retries over 24 hours
- Notification delay: < 5 seconds from message arrival