---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.com/dev/webmaster/doc/en/concepts/verification.md
  - https://yandex.com/dev/webmaster/doc/ru/concepts/verification.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/webmaster/doc/en/llms.txt

# 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](*user-id)}/hosts/{[host-id](*host-id)}/verification
    ```

    #|
    ||
    `user-id`
    |
    <!-- source: en/_includes/popups.md -->
    Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.com/dev/webmaster/doc/en/reference/user.md) method.
    <!-- endsource: en/_includes/popups.md -->
    ||
    ||
    `host-id`
    |
    <!-- source: en/_includes/popups.md -->
    Type: `host id (string)`. The site ID. To get it, use the [GET /v4/user/{user-id}/hosts](https://yandex.com/dev/webmaster/doc/en/reference/hosts.md) method.
    <!-- endsource: en/_includes/popups.md -->
    ||
    |#
    
    The response contains the verification code in the [verification_uin](*verification_uin) parameter. [More information about requesting the verification code](https://yandex.com/dev/webmaster/doc/en/reference/host-verification-get.md).
    
1. Choose the rights verification method:
    
    {% cut "Meta tag on the home page" %}
    
    Add a meta tag in the HTML code of the site's home page (in the `head` element).
    
    ```xml
    <meta name="yandex-verification" content="<код подтверждения>" />
    ```
    
    {% endcut %}
    
    {% cut "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:
    
    ```xml
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>Verification: <код подтверждения></body>
    </html>
    ```
    
    {% endcut %}
    
    {% cut "DNS record" %}
    
    Add a [TXT record](https://en.wikipedia.org/wiki/List_of_DNS_record_types) with the specified unique value in the site's DNS record.
    
    ```
    yandex-verification: <код подтверждения>
    ```
    
    {% endcut %}
    
1. [Start the rights verification procedure](https://yandex.com/dev/webmaster/doc/en/reference/host-verification-post.md) with a POST request that contains the chosen verification method.

    ```
    POST https://api.webmaster.yandex.net/v4/user/{[user-id](*user-id)}/hosts/{[host-id](*host-id)}/verification
    ? [verification_type](*verification_type)=<string>
    ```
    
    #|
    ||
    `user-id`
    |
    <!-- source: en/_includes/popups.md -->
    Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.com/dev/webmaster/doc/en/reference/user.md) method.
    <!-- endsource: en/_includes/popups.md -->
    ||
    ||
    `host-id`
    |
    <!-- source: en/_includes/popups.md -->
    Type: `host id (string)`. The site ID. To get it, use the [GET /v4/user/{user-id}/hosts](https://yandex.com/dev/webmaster/doc/en/reference/hosts.md) method.
    <!-- endsource: en/_includes/popups.md -->
    ||
    ||
    `verification_type`[*](*requiredParam)
    |
    Rights verification method ([ApiExplicitVerificationType](*api-explicit-verification-type))
    ||
    |#
    
    \* Required

[*requiredParam]: ^*^Required

[*user-id]: Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.com/dev/webmaster/doc/en/reference/user.md) method.

[*host-id]: Type: `host id (string)`. The site ID. To get it, use the [GET /v4/user/{user-id}/hosts](https://yandex.com/dev/webmaster/doc/en/reference/hosts.md) method.

[*verification_uin]: **Required**

Yes

**Type**

`string`

**Description**

Unique authorization code.

[*verification_type]: Rights verification method ([ApiExplicitVerificationType](https://yandex.com/dev/webmaster/doc/en/reference/host-verification-post.md#api-verification-type-explicit))

[*api-explicit-verification-type]: ### Explicit methods of rights verification (ApiExplicitVerificationType) {#api-verification-type-explicit}

#|
||
**Verification method** | **Whether a verification check can be requested** | **Description**
||
||
`DNS` | Yes | Verifying rights with the DNS record.
||
||
`HTML_FILE` | Yes | Placing an HTML file in the site's root directory.
||
||
`META_TAG` | Yes | Adding a meta tag to the site's home page header.
||
|#