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.
API Domain and Value
| api_domain | Value |
|---|---|
| IN pod | api.in.kaleyra.io |
| SG Pod | api.ap.kaleyra.io |
| EU Pod | api.eu.kaleyra.io |
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 'https://<api_domain>/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:
| Parameter | Data Type | Description | Applicable | Mandatory | Example |
|---|---|---|---|---|---|
sid | String | Parent account SID (Security Identifier). | Always applicable. | Yes | HXXXXXXX071IN |
subaccount_sid | String | Subaccount SID (Security Identifier). | Always applicable. | Yes | HXXXXXXX071IN_1710 |
api-key | String | Parent account API key. | Always applicable. | Yes | Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3 |
Note:The
ip_config_namein 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.in.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",
"balance": 0,
"channels": [
"sms"
],
"email": "John [email protected]",
"low_balance_alert": false,
"sid": "HXAXXXXXXXXXX4GL_117858",
"status": "active",
"subaccount_credit_type": "shared"
}
],
"error": {},
"status": 200
}The following is the sample success response for getting subaccount details with IP configuration name:
{
"code": "RBC103",
"message": "Request successfully executed!",
"data": [
{
"account_name": "John Doe",
"balance": 0,
"channels": [
"sms"
],
"email": "[email protected]",
"ip_config_name": "Demo3",
"ip_config_names": [
"demo3",
"Demo_test"
],
"low_balance_alert": true,
"low_balance_emails": "[email protected]",
"low_balance_limit": 1,
"sid": "HXAXXXXXXXXXX4GL_117866",
"status": "active",
"subaccount_credit_type": "assigned"
}
],
"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.
Updated 13 days ago

