Accounts

v1/accounts/{account_id}
Property
Description
Validation
Modifiable
name A friendly name for the account required yes
realm realm of the account, e.g: '12345.realm.com' unique, required yes
caller_id TheCaller ID Parameters object yes
caller_id_options TheCaller ID Option Parameters object yes
vm_to_email_template TheVoicemail To Email Templatestring   yes
trunks How many two-way trunks the account has non-negative integer yes
inbound_trunks How many inbound-only trunks the account has non-negative integer yes
external_api_keys External API keys storage object yes
Verb
Accepted
Returned
Description
GET   ALL Fetch the details of an account
POST ANY ALL Update the parameters of an account
DELETE     Delete the account

Normal Response Code(s): 200, 201

Error Response Code(s): 400, 401, 404, 415, 500, 503, 504

 

Property
Description
Validation
Modifiable
name The name to provide as the caller id   yes
number The number to provide as the caller id   yes

 

The property names of the caller-id objects represent the caller-id type. The system will use 'internal' and 'external' when appropriate and if no 'caller_id_type' overrides these parameters, when overridden any arbitrary value may be supplied. The caller-id on the account definition is used if no other caller-id specifications have a matched the type. Furthermore, the account caller-id is the only one that can define a type of 'default' that is used when no other match has been found, including the account's own caller-id parameters.

Property
Description
Validation
Modifiable
reformat A regular expression that if matched internal caller id numbers are replaced by   yes

 

Caller-id option parameters are hierarchal following the same hunt order as caller-id parameters.

You need to escape backslashes in literal strings with an additional backslash in the regular expressions.

If the caller-id option "reformat" has multiple matching groups, then the group that creates the largest number of characters will be used.

When an email is sent with a new voicemail attached, the format of the plaintext body is configurable.

The templating language used is theDjango templating system. Below are the currently available values that can be inserted:

 

Name
Type of Value
Configurable
caller_id_number E.164 formatted number (if possible) no
caller_id_name String no
to_user E.164 formatted number (if possible) no
date_called timestamp (in UTC) no
date_called_local timestamp (user's configured Timezone (or UTC)) no
support_number String yes
support_email String yes

Stores API keys from external service providers like Amazon, Rackspace.

Name
Type of Value
User-provided
rackspace String yes
linode String yes
amazon String yes
Method GET
URI v1/accounts/{account_id}
Request Headers X-Auth-Token: abc123
Accept: application/json
Request Body  
Response Body
{
"auth_token":"abc123",
"status":"success",
"data":{
"name":"Conversant LTD",
"realm":"REALM",
"caller_id":{
"default":{
"number":"5555555555",
"name":"Conversant LTD"
},
"internal":{
"name":"HAVE OPS SET YOUR CID"
}
}
}
}
Response Headers 200 OK
Method POST
URI v1/accounts/{account_id}
Request Headers X-Auth-Token: abc123
Accept: application/json
Content-Type: application/json
Request Body  
{
"data":{
"name":"Conversant",
"realm":"customerno.realm.com",
"caller_id":{
"default":{
"number":"6491234567",
"name":"Conversant"
},
"internal":{
"name":"HAVE OPS SET YOUR CID"
},
"emergency":{
"number":"5555555551",
"name":"Conversant"
}
}
}
}
Response Body
{
"auth_token":"abc123",
"status":"success",
"data":{
"name":"Conversant",
"realm":"customerno.realm.com",
"caller_id":{
"default":{
"number":"6491234567",
"name":"Conversant"
},
"internal":{
"name":"HAVE OPS SET YOUR CID"
},
"emergency":{
"number":"5555555551",
"name":"Conversant"
}
}
}
}
Response Headers 200 OK
Method DELETE
URI v1/accounts/{account_id}
Request Headers X-Auth-Token: abc123
Accept: application/json
Request Body  
Response Body
{
"auth_token":"abc123",
"status":"success",
"data":[]
}
Response Headers 200 OK

Accounts are arranged in a hierarchy. The account tree retrieves all subaccounts of the current account.

Method GET
URI v1/accounts/{account_id}/tree
Request Headers X-Auth-Token: abc123
Accept: application/json
Request Body  {
    "data": [
        {
            "id": "{JOHN_ACCOUNT_ID}",
            "name": "John's account"
        },
        {
            "id": "{JANE_ACCOUNT_ID}",
            "name": "Jane's account"
        }
    ]
}
Response Body  
Response Headers  

Accounts represent tenants or customers on the system. Each account represents an individual dataset or sandbox that only one tenant can access. The data set is architecturally independent from other tenants.