Get the list of mailboxes

This request is used for getting a list of the domain's mailboxes.

The response is paginated, and its parameters can be set in the request.

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

Request syntax

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

GET /api2/admin/email/list?
domain=<domain name>
[&page=<page number in the response>]
[&on_page=<number of mailboxes per response page>]

Host: pddimp.yandex.ru
PddToken: <PDD token>

Headers:

NameDescription
PddToken

PDD token.

Parameters:

ParameterTypeValue
Mandatory
domainString

Name of the domain.

Optional
pageInteger

Page number in the response. The default value is 1.

on_pageInteger

Number of mailboxes on each response page. The default value is 30.

Request example

GET /api2/admin/email/list?domain=domain.com&page=1&on_page=5 HTTP/1.1
Host: pddimp.yandex.ru
PddToken: 123456789ABCDEF0000000000000000000000000000000000000
cURL
curl -H 'PddToken: 123456789ABCDEF0000000000000000000000000000000000000' 'https://pddimp.yandex.ru/api2/admin/email/list?domain=domain.com&page=1&on_page=5'

Response structure

{
  "domain": "{domain name",
  "page": "{page number in the response}",
  "pages": "{total number of pages in the response}",
  "on_page": "{number of mailboxes per page in the response}",
  "total": "{total number of mailboxes on the domain}",
  "found": "{number of mailboxes on the current response page}",
  "accounts":
  [
    {
      "login": "{email address of a mailbox}",
      "uid": "{mailbox ID}",
      "enabled": "{mailbox status}",
      "fio": "{user's full name}",
      "fname": "{user's last name}",
      "iname": "{user's first name}",
      "birth_date": "{user's date of birth}",
      "sex": "{user's gender}",
      "hintq": "{secret question}",
      "ready": "{whether the mailbox is ready}",
      "aliases":
        [
          "{alias name}",
          ...
        ],
      "maillist": "{mailing list flag}"
    },
    ...
  ],
  "success": "{status of request execution}"
}
NameType of valueDescription
domainString

Name of the domain.

pageInteger

Page number in the response. Value of the page parameter set in the request. If the parameter value is omitted, the default value is used.

pagesInteger

Total number of pages in the response.

on_pageInteger

Number of mailboxes on each response page. Value of the on_page parameter set in the request.

totalInteger

Total number of mailboxes on the domain.

foundInteger

The number of mailboxes on the current response page (may be less than the on_page value for the last page).

accountsArray

Properties of mailboxes. Each object in the array corresponds to a single mailbox.

successString

Status of request execution.

Possible values:
  • ok — Request executed successfully.
  • error — Request executed with error.
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 objects in the accounts array
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.