Returns a list of subaccounts sorted by creation date, with the most recently created subaccount appearing first.

API Endpoint

GET
https://api.plivo.com/v1/Account/{auth_id}/Subaccount/

Arguments

NameTypeDescription
limitintegerDenotes the number of results displayed per page. The maximum number of results that can be fetched is 20.
offsetintegerDenotes the number of value items by which the results should be offset.

Returns

An array of Subaccount objects.

Request

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.subaccounts.list(
    offset=0,
    limit=5, )
print(response)

Response

HTTP Status Code: 200
{
  "api_id": "b38bf42e-0db4-11e4-8a4a-123140008edf",
  "meta": {
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 2
  },
  "objects": [{
      "account": "/v1/Account/MA2025RK4E639VJFZAGV/",
      "auth_id": "SA2025RK4E639VJFZAMM",
      "auth_token": "MTZjYWM0YzVjNjMwZmVmODFiNWJjNWJmOGJjZjgw",
      "created": "2022-07-17",
      "enabled": false,
      "modified": null,
      "name": "Chewbacca",
      "resource_uri": "/v1/Account/MA2025RK4E639VJFZAGV/Subaccount/SA2025RK4E639VJFZAMM/"
    },
    {
      "account": "/v1/Account/MA2025RK4E639VJFZAGV/",
      "auth_id": "SA1914RK4E639VJFZAMM",
      "auth_token": "OTdhMjYwMWYxOGMyNpFjNzUwYWM3YWI3NjY4Y2Ey",
      "created": "2022-09-23",
      "enabled": true,
      "modified": "2022-09-23",
      "name": "new",
      "resource_uri": "/v1/Account/MA2025RK4E639VJFZAGV/Subaccount/SA1914RK4E639VJFZAMM/"
    }
  ]
}