Delete Account
Delete an account from the Audian platform.
Endpoint​
DELETE https://api.audian.com:8443/v2/accounts/{accountId}
Request​
Path Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | The unique account identifier |
Headers​
X-Auth-Token: YOUR_API_TOKEN
Query Parameters​
| Parameter | Type | Required | Description |
|---|---|---|---|
force | boolean | No | Force delete even with active resources |
reason | string | No | Reason for deletion |
Examples​
Delete Account (Standard)​
curl -X DELETE https://api.audian.com:8443/v2/accounts/acc_1234567890 \
-H "X-Auth-Token: YOUR_API_TOKEN"
Force Delete Account​
curl -X DELETE "https://api.audian.com:8443/v2/accounts/acc_1234567890?force=true&reason=Business%20closed" \
-H "X-Auth-Token: YOUR_API_TOKEN"
JavaScript/Node.js Example​
const axios = require('axios');
async function deleteAccount(accountId, options = {}) {
try {
const response = await axios.delete(
`https://api.audian.com:8443/v2/accounts/${accountId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
params: options
}
);
console.log('Account deleted successfully');
return response.data;
} catch (error) {
console.error('Error deleting account:', error.response.data);
}
}
deleteAccount('acc_1234567890', {
force: true,
reason: 'Business closed'
});
Python Example​
import requests
def delete_account(account_id, force=False, reason=None):
url = f'https://api.audian.com:8443/v2/accounts/{account_id}'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
params = {}
if force:
params['force'] = True
if reason:
params['reason'] = reason
response = requests.delete(url, headers=headers, params=params)
if response.status_code == 204:
print('Account deleted successfully')
return True
else:
print('Error:', response.json())
return False
delete_account('acc_1234567890', force=True, reason='Business closed')
Response​
Success Response (204 No Content)​
A successful deletion returns an HTTP 204 status code with no response body.
Warning Response (200 OK - With Content)​
If the account cannot be immediately deleted:
{
"status": "deletion_scheduled",
"message": "Account deletion has been scheduled",
"details": {
"accountId": "acc_1234567890",
"deletionDate": "2023-10-25T00:00:00Z",
"reason": "Account contains active resources. Deletion will occur after 10-day grace period."
}
}
Error Response (409 Conflict)​
{
"error": {
"code": "ACCOUNT_NOT_EMPTY",
"message": "Cannot delete account with active resources",
"details": {
"activeUsers": 5,
"activeDevices": 3,
"activeServices": 2,
"suggestion": "Use force=true parameter or delete resources first"
}
}
}
Status Codes​
| Code | Description |
|---|---|
204 | Account deleted successfully |
200 | Deletion scheduled or pending |
400 | Bad request |
401 | Unauthorized - invalid token |
403 | Forbidden - insufficient permissions |
404 | Account not found |
409 | Conflict - cannot delete (has active resources) |
429 | Too many requests |
500 | Server error |
Important Notes​
Before Deleting​
Ensure you understand the following before deleting an account:
- No Recovery: Deletion is permanent. Data cannot be recovered after deletion.
- Active Resources: The account must not have:
- Active users
- Active devices
- Active services or subscriptions
- Pending transactions
- Grace Period: Some accounts have a 10-day grace period before final deletion.
- Data Retention: Backup any data you need before deletion.
Deletion Process​
- Immediate Deletion: If
force=trueand account is empty - Scheduled Deletion: If resources exist, deletion is scheduled
- Grace Period: 10-day window to cancel deletion (contact support)
Preparing for Deletion​
To successfully delete an account:
# 1. Delete all users
DELETE /v1/accounts/{accountId}/users
# 2. Delete all devices
DELETE /v1/accounts/{accountId}/devices
# 3. Cancel active services
DELETE /v1/accounts/{accountId}/services
# 4. Then delete the account
DELETE /v1/accounts/{accountId}
Soft Delete vs Hard Delete​
- Soft Delete (Default): Account marked as deleted, can be recovered within grace period
- Hard Delete (force=true): Immediate permanent deletion of all data
Contact Audian support for hard delete confirmation.
Audit Trail​
All account deletions are logged in the audit trail with:
- Deletion timestamp
- User who initiated deletion
- Reason provided
- Confirmation status