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 name

Obligation

Definition/Value

id

Required

A unique ID that identifies the user. To get a list of the accounts that can be restored, use the search_users method.

new_name

Required

Rename the restored account.

user

Required

The 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 name

Obligation

Description/Value

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

success

Always returned

Indicates 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
}