Skip to main content

Update Account

Update an existing account's information and settings.

Endpoint​

PATCH https://api.audian.com:8443/v2/accounts/{accountId}

Request​

Path Parameters​

ParameterTypeRequiredDescription
accountIdstringYesThe unique account identifier

Headers​

Content-Type: application/json
X-Auth-Token: YOUR_API_TOKEN

Request Body​

All fields are optional. Only include the fields you want to update.

ParameterTypeDescription
displayNamestringDisplay name for the account
emailstringPrimary contact email
phonestringPrimary contact phone number
addressobjectBilling address
settingsobjectAccount-level settings
statusstringAccount status (active, suspended, closed)
metadataobjectCustom metadata

Examples​

Update Account Name​

curl -X PATCH https://api.audian.com:8443/v2/accounts/acc_1234567890 \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"displayName": "Acme Corp - Updated"
}'

Update Settings​

curl -X PATCH https://api.audian.com:8443/v2/accounts/acc_1234567890 \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"settings": {
"timezone": "America/New_York",
"enableRecording": true,
"recordingRetention": 60
}
}'

Update Address and Contact​

curl -X PATCH https://api.audian.com:8443/v2/accounts/acc_1234567890 \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"email": "neoadmin@acme.com",
"phone": "+1-555-0200",
"address": {
"street": "456 Corporate Blvd",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
}'

JavaScript/Node.js Example​

const axios = require('axios');

async function updateAccount(accountId, updates) {
try {
const response = await axios.patch(
`https://api.audian.com:8443/v2/accounts/${accountId}`,
updates,
{
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);

console.log('Account updated:', response.data);
return response.data;
} catch (error) {
console.error('Error updating account:', error.response.data);
}
}

updateAccount('acc_1234567890', {
displayName: 'Acme Corp - Updated',
settings: {
timezone: 'America/New_York',
enableRecording: true
}
});

Python Example​

import requests

def update_account(account_id, updates):
url = f'https://api.audian.com:8443/v2/accounts/{account_id}'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.patch(url, headers=headers, json=updates)

if response.status_code == 200:
print('Account updated:', response.json())
return response.json()
else:
print('Error:', response.json())

update_account('acc_1234567890', {
'displayName': 'Acme Corp - Updated',
'settings': {
'timezone': 'America/New_York',
'enableRecording': True
}
})

Response​

Success Response (200 OK)​

{
"id": "acc_1234567890",
"name": "Acme Corporation",
"displayName": "Acme Corp - Updated",
"email": "neoadmin@acme.com",
"phone": "+1-555-0200",
"status": "active",
"plan": "professional",
"address": {
"street": "456 Corporate Blvd",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
},
"settings": {
"timezone": "America/New_York",
"language": "en",
"enableVoiceMail": true,
"enableRecording": true,
"recordingRetention": 60,
"smsEnabled": true
},
"createdAt": "2023-10-15T10:30:00Z",
"updatedAt": "2023-10-20T16:45:00Z"
}

Error Response (400 Bad Request)​

{
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid timezone format",
"details": {
"field": "settings.timezone",
"value": "Invalid/Timezone"
}
}
}

Status Codes​

CodeDescription
200Account updated successfully
400Bad request or validation error
401Unauthorized - invalid token
403Forbidden - insufficient permissions
404Account not found
409Conflict - duplicate email or resource conflict
429Too many requests
500Server error

Partial Updates​

The PATCH method allows you to update only the fields you specify. Omitted fields will not be modified.

Immutable Fields​

The following fields cannot be updated:

  • id - Account ID is immutable
  • name - Original account name cannot be changed
  • plan - Use upgrade/downgrade endpoint for plan changes
  • createdAt - Creation timestamp is immutable

Validation Rules​

  • displayName: 1-100 characters
  • email: Valid email format
  • phone: Valid phone format
  • timezone: Valid IANA timezone identifier
  • status: One of: active, suspended, closed
  • recordingRetention: Integer between 1 and 365