Skip to content

List accounts

listAccounts returns the accounts of the authenticated customer with a short summary of each: name, balance, blocked and expired flags and the current SIP registration. Use getAccountInfo for all attributes of one account.

The method supports trusted mode with i_customer, the customer whose accounts you list.

Name Type Required Description
offset int no Number of accounts to skip
limit int no Maximum number of accounts to return
Name Type Description
result string OK
accounts array One struct per account, see below

Each struct in accounts:

Name Type Description
i_account int ID of the account
username string Web login of the account
description string Description of the account
blocked boolean True when the account is blocked
expired boolean True when the account’s lifetime is over
balance double Current balance
credit_limit double Credit limit
base_currency string Currency of the balance, ISO 4217
registration_status struct The current registration, with the members that getRegistrationStatus returns. nil when the account is not registered

Read the accounts in pages of 100:

request
offset = 0
while True:
page = call("listAccounts", {"offset": offset, "limit": 100})["accounts"]
for acc in page:
print(acc["username"], acc["balance"])
if len(page) < 100:
break
offset += 100
response
{
"result": "OK",
"accounts": [
{
"i_account": 3092,
"username": "1001",
"description": "Reception desk",
"blocked": False,
"expired": False,
"balance": 0.0,
"credit_limit": 0.0,
"base_currency": "USD",
"registration_status": {
"user_agent": "Yealink SIP-T46U 108.86.0.20",
"contact": "sip:1001@198.51.100.24:5060",
"expires": "09:57:29.000 GMT Wed Nov 18 2026",
},
},
],
}