Create subaccount
Overview
In Apico, subaccounts are accounts running under your main (master) account. With subaccounts, you can segregate each of your customers' use of Apico services. This approach allows you to track the activity and manage phone numbers of each customer separately.
In order to send messages using a subaccount you simply need to replace the master account credentials (accountSid and authToken) with the subaccount credentials.
Subaccounts are created via making the POST requests to /accounts.
The table below lists parameters specified while making this request.
Input parameters
Parameter |
Required? |
Description |
Default value |
name |
no |
Account name. |
{accountSID} |
status |
no |
Account status. Either active or blocked. |
active |
Request example
The following example demonstrates creating a blocked subaccount with the TestSubaccount name.
curl –X POST ‘https://api.apico.net/v2/accounts’ \ -H ‘Content-Type: application/json’ \ -d ‘{ \ “name”: ”TestSubaccount”, \ “status”: ”blocked”, \ }’ \ -u {accountSID}:{authToken}
Response example
{ "status_code": 201, "status_message": "CREATED", "uri": "/accounts/{accountSID}" }