Skip to main content

Create Account

Create a new account in the Audian platform.

Endpoint​

POST https://api.audian.com:8443/v2/accounts

Request​

Headers​

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

Request Body​

ParameterTypeRequiredDescription
namestringYesAccount name
displayNamestringNoDisplay name for the account
emailstringYesPrimary contact email
phonestringNoPrimary contact phone number
addressobjectNoBilling address
planstringNoService plan (starter, professional, enterprise)
settingsobjectNoAccount-level settings
metadataobjectNoCustom metadata

Address Object​

{
"street": string,
"city": string,
"state": string,
"postalCode": string,
"country": string
}

Settings Object​

{
"timezone": string,
"language": string,
"enableVoiceMail": boolean,
"enableRecording": boolean,
"recordingRetention": number,
"smsEnabled": boolean
}

Examples​

Create Basic Account​

curl -X POST https://api.audian.com:8443/v2/accounts \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"name": "Acme Corporation",
"email": "admin@acme.com",
"phone": "+1-555-0100"
}'

Create Account with Full Details​

curl -X POST https://api.audian.com:8443/v2/accounts \
-H "Content-Type: application/json" \
-H "X-Auth-Token: YOUR_API_TOKEN" \
-d '{
"name": "Acme Corporation",
"displayName": "Acme Corp",
"email": "admin@acme.com",
"phone": "+1-555-0100",
"plan": "professional",
"address": {
"street": "123 Business Ave",
"city": "San Francisco",
"state": "CA",
"postalCode": "94102",
"country": "US"
},
"settings": {
"timezone": "America/Los_Angeles",
"language": "en",
"enableVoiceMail": true,
"enableRecording": true,
"recordingRetention": 30,
"smsEnabled": true
},
"metadata": {
"department": "IT",
"customField": "value"
}
}'

JavaScript/Node.js Example​

const axios = require('axios');

async function createAccount() {
try {
const response = await axios.post(
'https://api.audian.com:8443/v2/accounts',
{
name: 'Acme Corporation',
email: 'admin@acme.com',
phone: '+1-555-0100',
plan: 'professional',
settings: {
timezone: 'America/Los_Angeles',
language: 'en'
}
},
{
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);

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

createAccount();

Python Example​

import requests
import json

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

payload = {
'name': 'Acme Corporation',
'email': 'admin@acme.com',
'phone': '+1-555-0100',
'plan': 'professional',
'settings': {
'timezone': 'America/Los_Angeles',
'language': 'en'
}
}

response = requests.post(url, headers=headers, json=payload)

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

create_account()

Response​

Success Response (201 Created)​

{
"id": "acc_1234567890",
"name": "Acme Corporation",
"displayName": "Acme Corp",
"email": "admin@acme.com",
"phone": "+1-555-0100",
"status": "active",
"plan": "professional",
"address": {
"street": "123 Business Ave",
"city": "San Francisco",
"state": "CA",
"postalCode": "94102",
"country": "US"
},
"createdAt": "2023-10-15T10:30:00Z",
"updatedAt": "2023-10-15T10:30:00Z",
"metadata": {
"department": "IT",
"customField": "value"
}
}

Error Response (400 Bad Request)​

{
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required field: name",
"details": {
"field": "name"
}
}
}

Status Codes​

CodeDescription
201Account created successfully
400Bad request or validation error
401Unauthorized - invalid token
403Forbidden - insufficient permissions
409Conflict - account name already exists
429Too many requests
500Server error

Validation Rules​

  • name: 1-100 characters, required
  • email: Valid email format, required
  • phone: Valid phone format (optional)
  • plan: One of: starter, professional, enterprise
  • timezone: Valid IANA timezone identifier
  • address: All address fields are optional, but if provided must be valid

Next Steps​

After creating an account, you can:

  1. Retrieve account details
  2. Update account settings
  3. Create users
  4. Provision devices