Example of rights verification

To verify site management rights, you need to obtain a unique code and choose the verification method:

  1. To get the verification code, send a GET request with user-id and host-id.

    GET https://api.webmaster.yandex.net/v4/user/{user-id}/hosts/{host-id}/verification/

    The response contains the verification code in the verification_uin parameter. More information about requesting the verification code.

  2. Choose the rights verification method:

    Meta tag on the main page

    Add a meta tag in the HTML code of the site's home page (in the head element).

    <meta name="yandex-verification" content="<код подтверждения>" />
    HTML file in the root directory

    Create an HTML file with a unique name in the format yandex_<confirmation code.>html and place it in the site's root directory. The file should contain the following:

            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <body>Verification: <код подтверждения></body>
    DNS record

    Add a TXT record with the specified unique value in the site's DNS record.

    yandex-verification: <код подтверждения>
    Email address from the WHOIS data

    Confirm the email address listed in WHOIS on the Email addresses page.

    This method may be unavailable for some top-level domains (for example, RU or RF domains).

  3. Start the rights verification procedure with a POST request that contains the chosen verification method (verification_type).

    POST https://api.webmaster.yandex.net/v4/user/{user-id}/hosts/{host-id}/verification/?verification_type={verification_type}