Delete User
Delete a user account from the Audian platform.
Endpoint​
DELETE https://api.audian.com:8443/v2/accounts/{accountId}/users/{userId}
Request​
Path Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | Account ID |
userId | string | Yes | User ID |
Headers​
X-Auth-Token: YOUR_API_TOKEN
Query Parameters​
| Parameter | Type | Description |
|---|---|---|
reassignDevices | string | User ID to reassign devices to |
archiveData | boolean | Archive user data instead of deleting |
reason | string | Reason for deletion |
Examples​
Delete User​
curl -X DELETE https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456 \
-H "X-Auth-Token: YOUR_API_TOKEN"
Delete and Reassign Devices​
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456?reassignDevices=user_789012&reason=Employee%20left%20company" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Archive User Data​
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456?archiveData=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
JavaScript/Node.js Example​
const axios = require('axios');
async function deleteUser(accountId, userId, options = {}) {
try {
const response = await axios.delete(
`https://api.audian.com:8443/v2/accounts/${accountId}/users/${userId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
params: options
}
);
console.log('User deleted successfully');
return response.data;
} catch (error) {
console.error('Error deleting user:', error.response.data);
}
}
deleteUser('acc_1234567890', 'user_123456', {
reassignDevices: 'user_789012',
reason: 'Employee left company'
});
Python Example​
import requests
def delete_user(account_id, user_id, reassign_to=None, archive=False, reason=None):
url = f'https://api.audian.com:8443/v2/accounts/{account_id}/users/{user_id}'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
params = {}
if reassign_to:
params['reassignDevices'] = reassign_to
if archive:
params['archiveData'] = True
if reason:
params['reason'] = reason
response = requests.delete(url, headers=headers, params=params)
if response.status_code == 204:
print('User deleted successfully')
return True
else:
print('Error:', response.json())
return False
delete_user('acc_1234567890', 'user_123456',
reassign_to='user_789012',
reason='Employee left company')
Response​
Success Response (204 No Content)​
A successful deletion returns HTTP 204 with no response body.
Alternative Response (200 OK)​
{
"status": "deleted",
"message": "User deleted successfully",
"details": {
"userId": "user_123456",
"deletedAt": "2023-10-20T16:45:00Z",
"devicesReassigned": 2,
"dataArchived": false
}
}
Status Codes​
| Code | Description |
|---|---|
204 | User deleted successfully |
200 | User deleted with details |
400 | Bad request |
401 | Unauthorized - invalid token |
403 | Forbidden - insufficient permissions |
404 | User not found |
409 | Conflict - user still has active resources |
429 | Too many requests |
500 | Server error |
Deletion Considerations​
Before Deleting​
Ensure you have handled:
- Device Reassignment: Assign devices to another user
- Call Forwarding: Update any forwarding rules
- Voicemail: Archive or delete voicemail messages
- Call Recordings: Archive or delete recordings
- Contacts: Migrate personal contacts if needed
- Calendar: Transfer meetings and calendar items
Deletion Options​
Option 1: Immediate Delete​
- User account is removed
- Devices become unassigned
- Call history is retained
- Voicemail is deleted
curl -X DELETE https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456 \
-H "X-Auth-Token: YOUR_API_TOKEN"
Option 2: Delete with Device Reassignment​
- User account is removed
- Devices assigned to replacement user
- Call history retained
- Voicemail deleted
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456?reassignDevices=user_replacement" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Option 3: Archive User Data​
- User account disabled (not deleted)
- All data archived for compliance
- Can be restored within 90 days
- Meets regulatory requirements
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456?archiveData=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Offboarding Workflow​
Step 1: Disable User​
Temporarily disable instead of delete:
curl -X PATCH https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456 \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"status": "disabled"
}'
Step 2: Reassign Responsibilities​
Move devices and resources:
curl -X POST https://api.audian.com:8443/v2/accounts/acc_1234567890/devices/reassign \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"fromUserId": "user_123456",
"toUserId": "user_789012",
"devices": ["dev_sip_123456", "dev_softphone_123456"]
}'
Step 3: Archive Data​
Archive user's data for compliance:
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456?archiveData=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Step 4: Final Deletion (Optional)​
Delete after retention period (if archiveData=true):
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456/archive?permanent=true" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Data Retention​
What is Retained​
- Call history and CDR records
- Call recordings (if enabled)
- Compliance audit trails
- Call metadata
What is Deleted​
- User login credentials
- Personal voicemail messages
- Custom settings
- User presence status
- Draft messages
Archive Retention​
- Archived data retained for 90 days
- Can be restored within 90 days
- After 90 days, automatically deleted
- Compliance logs retained per policy
Cascade Effects​
Deleting a user will:
- Devices: Become unassigned (unless reassignDevices specified)
- Calls: Future calls not possible (call history retained)
- Presence: Removed from presence system
- Permissions: Access revoked
- Calendar: Meetings marked declined
- Forwarding: Rules removed
- Voicemail: Messages deleted
Recovery​
For Archived Users​
If user was archived (archiveData=true), restore within 90 days:
curl -X POST https://api.audian.com:8443/v2/accounts/acc_1234567890/users/user_123456/restore \
-H "X-Auth-Token: YOUR_API_TOKEN"
For Deleted Users​
Deleted users cannot be restored. Create new account if needed.
Audit Trail​
All user deletions are logged:
curl -X GET "https://api.audian.com:8443/v2/accounts/acc_1234567890/audit/users/deletions" \
-H "X-Auth-Token: YOUR_API_TOKEN"
Best Practices​
- Disable First: Disable before deleting
- Archive Data: Archive for compliance
- Reassign Devices: Move devices before deletion
- Notify Manager: Inform management
- Backup Data: Keep backup before deletion
- Documentation: Document reason for deletion
- Compliance: Check compliance requirements