Change mailbox parameters

This request is used for editing mailbox parameters: password, user's first and last name, and so on.

The mailbox can be specified using the email address or the mailbox ID. You can get the ID in the response to the Get the list of mailboxes request.

  1. Request syntax
  2. Request example
  3. Response structure

Request syntax

The request should be sent over the HTTPS protocol using the POST method.

POST /api2/admin/email/edit
Host: pddimp.yandex.ru
PddToken: <PDD token>
...

domain=<domain name>
&(login=<email address or username for the mailbox>|uid=<mailbox ID>)
[&password=<new password>]
[&iname=<first name>]
[&fname=<last name>]
[&enabled=<mailbox status>]
[&birth_date=<date of birth>]
[&sex=<gender>]
[&hintq=<secret question>]
[&hinta=<answer to secret question>]

Headers:

NameDescription
PddToken

PDD token.

Parameters:

ParameterTypeValue
Mandatory
domainString

Name of the domain.

loginString

The email address of the mailbox, in the format “username@domain.ru” or “username”.

The request should only pass one of the parameters: login or uid.

uidInteger

Mailbox ID.

You can get the ID value in the response to the Get the list of mailboxes request.

The request should only pass one of the parameters: login or uid.

Optional
passwordString

User's new password.

The password must:
  • contain from 6 to 20 characters — Latin letters, numbers, and the symbols “!”, “@”, “#”, “$”, “%”, “^”, “&”, “*”, “(”, “)”, “_”, “-”, “+”, “:”, “;”, “,”, “.”

  • be different from the username.

inameString

User's first name.

fnameString

User's last name.

enabledString

Whether the mailbox is enabled.

Possible values:
  • yes — Mailbox is enabled.
  • no — Mailbox is blocked (for example, due to spam distribution or suspected hacking).
birth_dateString

User's date of birth in the format YYYY-MM-DD.

sexInteger

User's gender.

Possible values:
  • 0 — Not specified.
  • 1 — Male.
  • 2 — Female.
hintqString

Secret question.

hintaString

Answer to the secret question.

Request example

POST /api2/admin/email/edit HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
...
domain=domain.com&login=somelogin&password=0123456789&iname=Vova
cURL
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' -d 'domain=domain.com&login=somelogin&password=0123456789&iname=Vova' 'https://pddimp.yandex.ru/api2/admin/email/edit'

Response structure

{
  "domain": "{domain name}",
  "login":"{email address of the mailbox}",
  "uid": "{mailbox ID}",
  "success": "{status of request execution}",
  "account":
  {
    "uid": "{mailbox ID}",
    "iname": "{user's name}",
    "sex": "{user's gender}",
    "ready": "{mailbox readiness}",
    "hintq": "{pet's favorite food ???}",
    "aliases":
    [
      "{alias name}",
      ...
    ],
    "enabled": "{whether mailbox is working}",
    "maillist": "{mailing list flag}",
    "fname": "{user's last name}",
    "birth_date": "{user's date of birth}",
    "login": "{mailbox email address}",
    "fio": "{user's full name}"
  }
}
NameType of valueDescription
domainString

Name of the domain.

loginString

Email address of the mailbox.

uidInteger

Mailbox ID.

successString

Status of request execution.

Possible values:
  • ok — Request executed successfully.
  • error — Request executed with error.
accountObject

Mailbox parameters.

errorString

Error code.

Included in the response if the request resulted in an error.

Possible values:
  • unknown — A temporary failure or API error occurred (repeat the request again later).
  • no_token (no_domain, no_ip ) — A mandatory parameter was omitted.
  • bad_domain — The domain name was not specified or does not conform to the RFC.
  • prohibited — A forbidden domain name.
  • bad_token (bad_login, bad_passwd) — An invalid PDD token (or username/password) was passed.
  • no_auth — The PddToken header was omitted.
  • not_allowed — This operation is not allowed for this user (the user is not the domain administrator).
  • blocked — Blocked domain (for example, due to spam and so on).
  • occupied — The domain name is in use by another user.
  • domain_limit_reached — Exceeded the acceptable number of connected domains (50).
  • no_reply — Yandex.Mail for Domain cannot connect to the server source for the import.
Keys for the account object
loginString

Email address of the mailbox.

uidInteger

Mailbox ID.

enabledString

Whether the mailbox is enabled.

Possible values:
  • yes — Mailbox is enabled.
  • no — Mailbox is blocked (for example, due to spam distribution or suspected hacking).
fioString

User's full name.

aliasesArray

List of .

fnameString

User's last name.

inameString

User's first name.

birth_dateString

User's date of birth in the format YYYY-MM-DD.

sexInteger

User's gender.

Possible values:
  • 0 — Not specified.
  • 1 — Male.
  • 2 — Female.
hintqString

Secret question.

readyString

Mailbox readiness.

Possible values:
  • yes — The user agreement has been accepted, and the mailbox is ready for use.
  • no — The user agreement has not been accepted, and the mailbox is not ready for use.
maillistString

Whether this is a mailing list.

Possible values:
  • yes — The mailbox is a mailing list.
  • no — The mailbox is not a mailing list.