Get All Subaccounts Detail

GET Method

Kaleyra.io offers an API that enables you to get detail of all the sub-accounts associated with a parent account.

Base URL

<https://api.kaleyra.io>

To get all the sub-accounts detail associated with a parent account, perform the following steps:

API request to get all the subaccounts of your parent account

To get all the sub-accounts detail associated with a parent account, use the /subaccounts endpoint with the following request method:

Request Format

curl --location --request GET '<url>/api/v1/<sid>/subaccounts' \
--header 'Content-Type: <content-type>' \
--header 'api-key: <api-key>' \
--data-raw ''

The following table describes the parameter used for getting all the sub-accounts detail:

ParameterData TypeDescriptionApplicableMandatoryExample
sidStringParent account SID (Security Identifier).Always applicable.YesHXXXXXXX071IN
content-typeStringThe format in which the data is sent.Always applicable.Yesapplication/json
api-keyStringParent account API key.Always applicable.YesAxxxxxxxxxxxxxxxxxxxxxxxxxxxx3

📘

Note:

The ip_config_name in the response is the IP configuration that is being applied to the sub-account api_key as a whitelisted IP addresses/ranges. It could be shared by Parent account or could be created by sub-account itself.

Sample Request

The following is the sample request:

curl --location --request GET 'https://api.kaleyra.io/api/v1/HXXXXXXX071IN/subaccounts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--data-raw ''

Sample Success Response

The following is the sample success response for getting all the sub-accounts detail:

{
    "code": "RBC103",
    "message": "Request successfully executed!",
    "data": [
        {
            "account_name": "John Doe",
            "email": "[email protected]",
            "status": "active",
            "sid": "HXXXXXXX071IN_1234",
            "api_key": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3",
            "channels": [
                "sms"
            ],
            "low_balance_alert": false,
            "subaccount_credit_type": "assigned",
            "balance": 2,
            "ip_config_name": "Test1"
        },
        {
            "account_name": "John Doe1",
            "email": "[email protected]",
            "status": "active",
            "sid": "HXXXXXXX071IN_12351",
            "api_key": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3",
            "channels": [
                "sms"
            ],
            "subaccount_credit_type": "shared"
        },
        {
            "account_name": "John Doe2",
            "email": "[email protected]",
            "status": "active",
            "sid": "HXXXXXXX071IN_12353",
            "api_key": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3"
            "channels": [
                "sms"
            ],
            "subaccount_credit_type": "shared"
            "monthly_limit": 5
            "ip_config_name": "Test2"
        },
    ],
    "error": {},
    "total": 3,
    "limit": "25",
    "offset": "0",
    "status": 200
}

Sample Failure Response

The following is a sample failure response:

{
    "code": "RBC422",
    "message": "Access Denied! Unauthorized action!",
    "data": {},
    "error": {},
    "status": 401
}

For more information about response codes and statuses for getting all sub-accounts detail, see Response Codes and Statuses for Getting All Subaccounts Detail.