Get Subaccount Details

GET Method

Kaleyra.io offers an API that enables you to get all the information about a given sub-account associated with the parent account. The sub-account details can be retrieved using the sub-account's SID along with the parent account's SID and API-Key.

Base URL

<https://api.kaleyra.io>

To get all the information about a given sub-account, perform the following steps:

API request to get sub-account details

To get sub-account details, use the /subaccounts/<subaccount_sid> endpoint with the following request method:

Request Format

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

The following table describes the parameter used for getting sub-account details:

ParameterData TypeDescriptionApplicableMandatoryExample
sidStringParent account SID (Security Identifier).Always applicable.YesHXXXXXXX071IN
subaccount_sidStringSubaccount SID (Security Identifier).Always applicable.YesHXXXXXXX071IN_1710
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/HXXXXXXX071IN_1710' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--data-raw ''

Sample Success Response

The following is the sample success response for getting sub-account details:

{
    "code": "RBC103",
    "message": "Request successfully executed!",
    "data": [
        {
            "account_name": "John Doe",
            "email": "[email protected]",
            "status": "deleted",
            "sid": "HXXXXXXX071IN_1710",
            "api_key": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3",
            "channels": [
                "sms"
            ],            
            "low_balance_alert": false,
            "subaccount_credit_type": "assigned",
            "balance": 0
        }
    ],
    "error": {},
    "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 sub-account details, see Response Codes and Statuses for Getting Subaccount Details.