Skip to main content

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​

ParameterTypeRequiredDescription
accountIdstringYesAccount ID
userIdstringYesUser ID

Headers​

X-Auth-Token: YOUR_API_TOKEN

Query Parameters​

ParameterTypeDescription
reassignDevicesstringUser ID to reassign devices to
archiveDatabooleanArchive user data instead of deleting
reasonstringReason 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​

CodeDescription
204User deleted successfully
200User deleted with details
400Bad request
401Unauthorized - invalid token
403Forbidden - insufficient permissions
404User not found
409Conflict - user still has active resources
429Too many requests
500Server error

Deletion Considerations​

Before Deleting​

Ensure you have handled:

  1. Device Reassignment: Assign devices to another user
  2. Call Forwarding: Update any forwarding rules
  3. Voicemail: Archive or delete voicemail messages
  4. Call Recordings: Archive or delete recordings
  5. Contacts: Migrate personal contacts if needed
  6. 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:

  1. Devices: Become unassigned (unless reassignDevices specified)
  2. Calls: Future calls not possible (call history retained)
  3. Presence: Removed from presence system
  4. Permissions: Access revoked
  5. Calendar: Meetings marked declined
  6. Forwarding: Rules removed
  7. 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​

  1. Disable First: Disable before deleting
  2. Archive Data: Archive for compliance
  3. Reassign Devices: Move devices before deletion
  4. Notify Manager: Inform management
  5. Backup Data: Keep backup before deletion
  6. Documentation: Document reason for deletion
  7. Compliance: Check compliance requirements