DELETE api/v1/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

NameDescriptionTypeAdditional information
id

The child account to be deleted.

globally unique identifier

Required

Body Parameters

The delete settings for the child account deletion.

TwoSms.CustomerPortalRole.API.Admin.Accounts.AccountDeleteOptions
NameDescriptionTypeAdditional information
CancelPendingMessages

Cancel pending messages

boolean

None.

ExpireAdvancedMessages

Expire all advanced messages.

TwoSms.CustomerPortalRole.API.Admin.Accounts.AdvancedMessageExpireOptions

None.

TransferSubsChildAccounts

Transfer subs to master account

boolean

None.

DeleteSubsChildAccounts

Delete all the sub accounts that are below the account you are deleting

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "CancelPendingMessages": true,
  "ExpireAdvancedMessages": 0,
  "TransferSubsChildAccounts": true,
  "DeleteSubsChildAccounts": true
}

application/xml, text/xml

Sample:
<AccountDeleteOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <CancelPendingMessages>true</CancelPendingMessages>
  <ExpireAdvancedMessages>DO_NOT_EXPIRE</ExpireAdvancedMessages>
  <TransferSubsChildAccounts>true</TransferSubsChildAccounts>
  <DeleteSubsChildAccounts>true</DeleteSubsChildAccounts>
</AccountDeleteOptions>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

TwoSms.CustomerPortalRole.API.Misc.ResponseOfSystem.Object
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfSystem.Object

None.

Response Formats

application/json, text/json

Sample:
{
  "Error": {
    "ErrorCode": "sample string 1",
    "ErrorReason": "sample string 2"
  },
  "ResponseData": {
    "Identification": {
      "UserId": "sample string 1"
    },
    "Result": "sample string 1",
    "Detail": {}
  }
}

application/xml, text/xml

Sample:
<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>