restore_user

The restore_user method restores specified user accounts that have been deleted for 30 days or less.

You can restore an account to its original name only if that account name has not been reissued during the period in which the account was deleted. Otherwise, you can restore the account to any name that is available.

Syntax

{
    <credentials object>, 
    "user": <mailbox_name>, 
    "id": <id>,
    "new_name": <new account>
}

Request fields for restore_user

The following fields can be used in the restore_user method:

Field nameObligationDefinition/Value
idRequiredA unique ID that identifies the user. To get a list of the accounts that can be restored, use the search_users method.
new_nameRequiredRename the restored account.
userRequiredThe deleted user's account name (email address).

Response fields for restore_user

The following fields may be returned in response to the restore_user method:

Field nameObligationDescription/Value
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
successAlways returnedIndicates whether the request was successful or not. Allowed values are true and false.

Examples for restore_user

Example 1

Restores a user and keeps the same name.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdf1sh"
  },
  "user": "[email protected]",
  "ids": "1308694526",
  "new_name": "[email protected]"
}

Response

{
   "success": true
}

Example 2

Restores a user and changes the name.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdf1sh"
  },
  "user": "[email protected]",
  "id": "1308694526",
  "new_name": "[email protected]" 
}

Response

{
   "success": true
}