DELETE api/v2/admin/accounts/{id}
Deactivates an account by making it inaccessible by the user. All the data like addressbooks, reports, etc will still be kept in case account is reactivated (Can only be done by contacting 2sms). You also have an option to cancel pending messages, transfer sub accounts to master account or delete all the child accounts that are below the sub account you are deleting. Note: you can only perform one of the following: move sub accounts to the new master account or deactivate all of the sub accounts below. You cannot do both. If you choose to do both, then delete all sub accounts will be prioritized. Only top level account can perform such operation at this time.
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
id |
The child account to be deleted. |
globally unique identifier |
Required |
Body Parameters
The delete settings for the child account deletion.
AccountDeleteOptionsV2Name | Description | Type | Additional information |
---|---|---|---|
CancelPendingMessages |
Cancel pending messages |
boolean |
None. |
DeleteSubsChildAccounts |
Delete all the sub accounts that are below the account you are deleting |
boolean |
None. |
ExpireAdvancedMessages |
Expire all advanced messages. |
AdvancedMessageExpireOptions |
None. |
TransferSubsChildAccounts |
Transfer subs to master account |
boolean |
None. |
Request Formats
application/json, text/json
{ "CancelPendingMessages": true, "DeleteSubsChildAccounts": true, "ExpireAdvancedMessages": 0, "TransferSubsChildAccounts": true }
application/xml, text/xml
<AccountDeleteOptionsV2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <CancelPendingMessages>true</CancelPendingMessages> <DeleteSubsChildAccounts>true</DeleteSubsChildAccounts> <ExpireAdvancedMessages>DO_NOT_EXPIRE</ExpireAdvancedMessages> <TransferSubsChildAccounts>true</TransferSubsChildAccounts> <UserPassword>sample string 1</UserPassword> </AccountDeleteOptionsV2>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
ResponseOfObjectName | Description | Type | Additional information |
---|---|---|---|
Error | Error |
None. |
|
ResponseData | ResponseDataOfObject |
None. |
Response Formats
application/json, text/json
{ "Error": { "ErrorCode": "sample string 1", "ErrorReason": "sample string 2" }, "ResponseData": { "Identification": { "UserId": "sample string 1" }, "Result": "sample string 1", "Detail": {} } }
application/xml, text/xml
<ResponseOfObject xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Error> <ErrorCode>sample string 1</ErrorCode> <ErrorReason>sample string 2</ErrorReason> </Error> <ResponseData> <Result>sample string 1</Result> <Identification> <UserId>sample string 1</UserId> </Identification> <Detail /> </ResponseData> </ResponseOfObject>