---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.ru/dev/webmaster/doc/en/reference/host-verification-post.md
  - https://yandex.ru/dev/webmaster/doc/ru/reference/host-verification-post.md
keywords:
  - s
  - i
  - t
  - e
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/webmaster/doc/en/llms.txt


# Starting the rights verification process

Starts the procedure for verifying site management rights.


{% note alert %}

Before using this request, get a unique confirmation code and choose how you will verify your rights. For more information, see the [example](https://yandex.ru/dev/webmaster/doc/en/concepts/verification.md).

{% endnote %}

## Request format

Send a POST request to the rights verification resource. You must specify the verification method in the GET parameter. The request body can pass any data, or none at all.

```
POST https://api.webmaster.yandex.net/v4/user/{[user-id](*user-id)}/hosts/{[host-id](*host-id)}/verification
  ? [verification_type](*verification_type_2)=<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.ru/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.ru/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


## Response format


### Example

> 
> {% list tabs %}
> 
> - JSON
> 
>   
>   ```javascript
>   HTTP/1.1 200 OK
>   {
>     "verification_uin": "b01288afe67b1595",
>     "verification_state": "IN_PROGRESS",
>     "verification_type": "HTML_FILE",
>     "applicable_verifiers": [
>       "HTML_FILE"
>     ]
>   }
>   ```
>   
> 
> - XML
> 
>   
>   ```xml
>   <Data>
>       <[verification_uin](*verification_uin_2)>b01288afe67b1595</verification_uin>
>       <[verification_state](*verification_state)>[IN_PROGRESS](*verification-state)</verification_state>
>       <[verification_type](*verification_type_2)>[HTML_FILE](*verification-type)</verification_type>
>       <applicable_verifier>[HTML_FILE](*verification-type)</applicable_verifier>
>   </Data>
>   ```
> 
> {% endlist %}
>
> #|
> || **Name** | **Required** | **Type** | **Description** ||
> || `verification_uin` | Yes | `string` | Confirmation code. || 
> || `verification_state` | Yes | `string` ([ApiVerificationState](#verification-state)) | The rights verification state. || 
> || `verification_type` | Yes | `string` ([ApiVerificationType](#verification-type)) | The type of rights verification. || 
> || `applicable_verifiers` | Yes | `string` ([ApiExplicitVerificationType](#api-verification-type-explicit)) | The verification methods applied for the given site. || 
> |#

<!-- source: en/_includes/reference/verification-state.md -->
### The status of verifying the right to manage the site (ApiVerificationState) {#verification-state}

#|
|| **Status** | **Description** ||
|| `NONE` | Verification wasn't completed and rights are not confirmed. ||
|| `VERIFIED` | The rights are verified. ||
|| `IN_PROGRESS` | The rights verification is in progress. ||
|| `VERIFICATION_FAILED` | Verification was performed but rights are not confirmed. ||
|| `INTERNAL_ERROR` | An unexpected error occurred when verifying the rights. ||
|#
<!-- endsource: en/_includes/reference/verification-state.md -->


<!-- source: en/_includes/reference/verification-type.md -->
### Rights verification methods (ApiVerificationType) {#verification-type}

#|
||
**Verification method** | **Whether a verification check can be requested** | **Description**
||
|| `AUTO` | No | Automatic rights verification (deprecated; only for *.narod.ru sites). ||
|| `DELEGATED` | No | Rights were delegated. ||
|| `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. ||
|| `PDD` | No | Rights verification via Yandex.Mail for Domains. ||
|| `TXT_FILE` | No | Placing a text file in the site's root directory. ||
|#
<!-- endsource: en/_includes/reference/verification-type.md -->


<!-- source: en/_includes/reference/api-explicit-verification-type.md -->
### 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.
||
|#
<!-- endsource: en/_includes/reference/api-explicit-verification-type.md -->

## Response codes

To view the response structure in detail, click the reason.

#|
||
**Code** | **Reason** | **Description**
||
||
200 | OK | 
||
||
403
|
[INVALID_USER_ID](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#invalid-user-id)
|
The ID of the user who issued the token differs from the one specified in the request. In the examples below, `{user_id}` shows the correct `uid` of the OAuth token owner.

{% list tabs %}

- JSON

  ```json
  {   
      "error_code": "INVALID_USER_ID",   
      "available_user_id": 1,   
      "error_message": "Invalid user id. {user_id} should be used."
  }
  ```

- XML

  ```xml 
  <Data>     
      <[error_code](*error_code)>INVALID_USER_ID</error_code>     
      <[available_user_id](*available_user_id)>1</available_user_id>     
      <[error_message](*error_message)>Invalid user id. {user_id} should be used.</error_message> 
  </Data>
  ```

{% endlist %}
||
||
404
|
[HOST_NOT_FOUND](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#host-not-found)
|
The site is not in the list of the user's sites.

{% list tabs %}

- JSON

  ```javascript 
  {   
      "error_code": "HOST_NOT_FOUND",   
      "host_id": "http:ya.ru:80",   
      "error_message": "explicit error message"
  }
  ```

- XML

  ```xml 
  <Data>     
      <[error_code](*error_code)>HOST_NOT_FOUND</error_code>     
      <[host_id](*host_id)>http:ya.ru:80</host_id>     
      <[error_message](*error_message)>explicit error message</error_message>
  </Data>
  ```

{% endlist %}
||
||
409
|
[VERIFICATION_ALREADY_IN_PROGRESS](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#verif-in-progress)
|
The rights verification process is in progress.

{% list tabs %}

- JSON

  ```json 
  {   
      "error_code": "VERIFICATION_ALREADY_IN_PROGRESS",   
      "verification_type": "META_TAG",   
      "error_message": "some string"
  }
  ```

- XML

  ```xml 
  <Data>   
      <error_code>VERIFICATION_ALREADY_IN_PROGRESS</error_code>     
      <verification_type>META_TAG</verification_type>    
      <error_message>some string</error_message>
  </Data>
  ```

{% endlist %}
||
|#

### Related information

- [Error codes and statuses](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md)




[*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.ru/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.ru/dev/webmaster/doc/en/reference/hosts.md) method.

[*verification_type]: Rights verification method ([ApiExplicitVerificationType](#verification-type))

[*verification_uin_2]: **Required**

Yes

**Type**

`string`

**Description**

Confirmation code.

[*verification_state]: **Required**

Yes

**Type**

`string` ([ApiVerificationState](#verification-state))

**Description**

The rights verification state.

[*verification_type_2]: Rights verification method ([ApiExplicitVerificationType](#api-verification-type-explicit))

[*error_code]: **Description**

Error code.

[*available_user_id]: **Description**

ID of the user who allowed access.

[*host_id]: **Description**

ID of the requested site.

[*error_message]: **Description**

Error message.

[*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.
||
|#

[*verification-state]: ### The status of verifying the right to manage the site (ApiVerificationState) {#verification-state}

#|
|| **Status** | **Description** ||
|| `NONE` | Verification wasn't completed and rights are not confirmed. ||
|| `VERIFIED` | The rights are verified. ||
|| `IN_PROGRESS` | The rights verification is in progress. ||
|| `VERIFICATION_FAILED` | Verification was performed but rights are not confirmed. ||
|| `INTERNAL_ERROR` | An unexpected error occurred when verifying the rights. ||
|#

[*verification-type]: ### Rights verification methods (ApiVerificationType) {#verification-type}

#|
||
**Verification method** | **Whether a verification check can be requested** | **Description**
||
|| `AUTO` | No | Automatic rights verification (deprecated; only for *.narod.ru sites). ||
|| `DELEGATED` | No | Rights were delegated. ||
|| `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. ||
|| `PDD` | No | Rights verification via Yandex.Mail for Domains. ||
|| `TXT_FILE` | No | Placing a text file in the site's root directory. ||
|#