Invite and Manage Sub-Accounts
You can use the TextMagic SMS API to invite other people to become sub-accounts. You can also manage them as and when needed.
There are two types of sub-accounts: regular user and administrator.
- A regular user sub-account allows the user to do everything except buy SMS credit and manage other sub-accounts.
- An administrator sub-account has access to all features including buying SMS credit and managing other sub-accounts.
Only parent users and administrators can manage sub-accounts.
Get sub-accounts list
To get a list of all your sub-accounts, use:
with the parameters:
Fetch the specified results page. The default is 1.
|limit||No||The number of results per page. The default is 10.|
You will receive the standard paginated response:
|page||The current fetched page.|
|limit||The number of results per page.|
|pageCount||The total number of pages.|
|resources||Array of user resources||See Account section for details.|
Get sub-account information
To get information about a single sub-account, use:
where id is the numeric ID of a sub-account. Note, this command has no parameters.
The response format is the same as the user resource’s:
| ||User email address.|
Current account status:
|balance||Account balance (in account currency).|
|currency||currency resource||See currency resource details in Account chapter.|
|firstName||Account first name.|
|lastName||Account last name.|
|company||Account company name.|
Type of current account:
|timezone||timezone||See timezone details in the Account section.|
Invite a new sub-account
To invite someone to be a sub-account, use:
with the following parameters:
Invitation email will be sent to this email address.
Type of account:
|company||Yes||Account company name.|
If successful, you’ll receive the standard 204 No Content response, otherwise the standard error response will be returned.
Close a sub-account
To close one of your sub-accounts use:
where id is the sub-account ID. Note, this command has no parameters. If successful, the standard delete response (204 No Content) will be returned.
The next step
Now you’ve learned how to manage sub-accounts via the TextMagic API, the next section will show you how to get Messaging statistics via API.