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​
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Account name |
displayName | string | No | Display name for the account |
email | string | Yes | Primary contact email |
phone | string | No | Primary contact phone number |
address | object | No | Billing address |
plan | string | No | Service plan (starter, professional, enterprise) |
settings | object | No | Account-level settings |
metadata | object | No | Custom 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​
| Code | Description |
|---|---|
201 | Account created successfully |
400 | Bad request or validation error |
401 | Unauthorized - invalid token |
403 | Forbidden - insufficient permissions |
409 | Conflict - account name already exists |
429 | Too many requests |
500 | Server 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: