---
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:
  - с
  - а
  - й
  - т
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/webmaster/doc/ru/llms.txt


# Запуск процедуры подтверждения прав

Запускает процедуру подтверждения прав на управление сайтом.


{% note alert %}

Перед использованием данного запроса получите уникальный код подтверждения и выберите способ подтверждения прав. Подробно см. [пример](https://yandex.ru/dev/webmaster/doc/ru/concepts/verification.md).

{% endnote %}


## Формат запроса {#request-format}


Отправьте POST-запрос на адрес ресурса подтверждения сайта пользователя. Обязательно укажите способ подтверждения GET-параметром. В теле запроса можно передавать произвольные данные или не передавать ничего.

```
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: ru/_includes/popup/user-id.md -->
Тип: `int64`. ID пользователя. Необходим для вызова любых ресурсов API Яндекс Вебмастера. Чтобы получить его, используйте метод [GET /v4/user](https://yandex.ru/dev/webmaster/doc/ru/reference/user.md).
<!-- endsource: ru/_includes/popup/user-id.md -->
    
||
||
`host-id`
|
    
<!-- source: ru/_includes/popup/host-id.md -->
Тип: `string`. ID сайта. Чтобы получить его, используйте метод [GET&nbsp;/v4/user/{user&#x2011;id}/hosts](https://yandex.ru/dev/webmaster/doc/ru/reference/hosts.md).
<!-- endsource: ru/_includes/popup/host-id.md -->

||
|| `verification_type`[*](*requiredParam) | Способ подтверждения прав ([ApiExplicitVerificationType](#type-verify-explicit)) ||
|#

* Обязательный параметр


## Формат ответа {#response-format}

### Пример
> 
> 
> {% 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)>b01288afe67b1595</verification_uin>
>       <[verification_state](*verification_state)>IN_PROGRESS</verification_state>
>       <[verification_type](*verification_type)>HTML_FILE</verification_type>
>       <applicable_verifier>HTML_FILE</applicable_verifier>
>   </Data>
>   ```
> 
> {% endlist %}
> 
> #|
> || 
> **Имя**
> |
> **Обязательный**
> |
> **Тип**
> |
> **Описание**
> ||
> ||
> `verification_uin`
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_uin/req.md -->
> Да
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/req.md -->
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_uin/type.md -->
> `string`
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/type.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_uin/desc.md -->
> Код подтверждения.
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/desc.md -->
> 
> ||
> ||
> `verification_state`
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_state/req.md -->
> Да
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_state/req.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_state/type.md -->
> `string` ([ApiVerificationState](https://yandex.ru/dev/webmaster/doc/ru/reference/host-verification-post.md#status-verify))
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_state/type.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_state/desc.md -->
> Состояние подтверждения прав.
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_state/desc.md -->
> 
> ||
> ||
> `verification_type`
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_type/req.md -->
> Да
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_type/req.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_type/type.md -->
> `string` ([ApiVerificationType](https://yandex.ru/dev/webmaster/doc/ru/reference/host-verification-post.md#type-verify))
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_type/type.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/verification_type/desc.md -->
> Тип подтверждения прав.
> <!-- endsource: ru/_includes/reference/host-verification-post/verification_type/desc.md -->
> 
> ||
> ||
> `applicable_verifiers`
> |
> <!-- source: ru/_includes/reference/host-verification-post/applicable_verifiers/req.md -->
> Да
> <!-- endsource: ru/_includes/reference/host-verification-post/applicable_verifiers/req.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/applicable_verifiers/type.md -->
> `string` ([ApiExplicitVerificationType ](https://yandex.ru/dev/webmaster/doc/ru/reference/host-verification-post.md#type-verify-explicit))
> <!-- endsource: ru/_includes/reference/host-verification-post/applicable_verifiers/type.md -->
> 
> |
> <!-- source: ru/_includes/reference/host-verification-post/applicable_verifiers/desc.md -->
> Способы подтверждения, применимые для выбранного сайта.
> <!-- endsource: ru/_includes/reference/host-verification-post/applicable_verifiers/desc.md -->
> 
> ||
> |#

<!-- source: ru/_includes/reference/errors/status-verify.md -->
### Статус подтверждения прав на управление сайтом (ApiVerificationState) {#status-verify}

#|
||
**Статус**
|
**Описание**
||
||
`NONE`
|
Проверка не проводилась, права не подтверждены.
||
||
`VERIFIED`
|
Права подтверждены.
||
||
`IN_PROGRESS`
|
Идет подтверждение прав.
||
||
`VERIFICATION_FAILED`
|
Проверка проводилась, права не подтверждены.
||
||
`INTERNAL_ERROR`
|
В процессе проверки прав произошла непредвиденная ошибка.
||
|#
<!-- endsource: ru/_includes/reference/errors/status-verify.md -->

<!-- source: ru/_includes/reference/errors/type-verify.md -->
### Способы подтверждения прав (ApiVerificationType) {#type-verify}

#|
||
**Способ подтверждения**
|
**Возможность запроса проверки подтверждения**
|
**Описание**
||
||
`AUTO`
|
Нет
|
Автоматическое подтверждение прав (устаревшее, только для сайтов *.narod.ru).
||
||
`DELEGATED`
|
Нет
|
Права делегированы.
||
||
`DNS`
|
Есть
|
Подтверждение прав с помощью DNS-записи.
||
||
`HTML_FILE`
|
Есть
|
Размещение HTML-файла в корневом каталоге сайта.
||
||
`META_TAG`
|
Есть
|
Добавление метатега в заголовок главной страницы сайта.
||
||
`TXT_FILE`
|
Нет
|
Размещение текстового файла в корневом каталоге сайта.
||
|#
<!-- endsource: ru/_includes/reference/errors/type-verify.md -->

<!-- source: ru/_includes/reference/errors/type-verify-explicit.md -->
### Явные способы подтверждения прав (ApiExplicitVerificationType) {#type-verify-explicit}

#|
||
**Способ подтверждения**
|
**Возможность запроса проверки подтверждения**
|
**Описание**
||
||
`DNS`
|
Есть
|
Подтверждение прав с помощью DNS-записи.
||
||
`HTML_FILE`
|
Есть
|
Размещение HTML-файла в корневом каталоге сайта.
||
||
`META_TAG`
|
Есть
|
Добавление метатега в заголовок главной страницы сайта.
||
|#
<!-- endsource: ru/_includes/reference/errors/type-verify-explicit.md -->


## Коды ответа {#errors}


Чтобы посмотреть структуру ответа подробнее, нажмите на причину.

#|

||
**Код**
|
**Причина**
|
**Описание**
||


||
200
|
OK
|
||

||
403
|
[INVALID_USER_ID](https://yandex.ru/dev/webmaster/doc/ru/reference/errors.md#invalid-user-id)
|
ID пользователя, выдавшего токен, отличается от указанного в запросе. В примерах ниже `{user_id}` указан правильный `uid` владельца OAuth-токена.

<!-- source: ru/_includes/reference/errors/code-inv-id.md -->
{% 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 %}
<!-- endsource: ru/_includes/reference/errors/code-inv-id.md -->


||


||
404
|
[HOST_NOT_FOUND](https://yandex.ru/dev/webmaster/doc/ru/reference/errors.md#host-not-found)
|
Сайт отсутствует в списке сайтов пользователя.


<!-- source: ru/_includes/reference/errors/dl-host-not-found.md -->
{% 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 %}
<!-- endsource: ru/_includes/reference/errors/dl-host-not-found.md -->


||
||
409
|
[VERIFICATION_ALREADY_IN_PROGRESS](https://yandex.ru/dev/webmaster/doc/ru/reference/errors.md#verif-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](*error_code)>VERIFICATION_ALREADY_IN_PROGRESS</error_code>  
    <[verification_type](*verification_type)>META_TAG</verification_type> 
    <[error_message](*error_message)>some string</error_message>
  </Data>
  ```

{% endlist %}

||
||
422
|
[NO_VERIFICATION_RECORD](https://yandex.ru/dev/webmaster/doc/ru/reference/errors.md#no-verif-record)
|
Перед подтверждением необходимо получить уникальный код.

{% list tabs %}

- JSON

  
  ```json
  {
    "error_code": "NO_VERIFICATION_RECORD",
    "error_message": "some string"
  }
  ```
  

- XML

  
  ```xml
  <Data>
    <[error_code](*error_code)>NO_VERIFICATION_RECORD</error_code>  
    <[error_message](*error_message)>some string</error_message>
  </Data>
  ```

{% endlist %}

||
|#

#### Узнайте больше

- [Коды ошибок и статусы](https://yandex.ru/dev/webmaster/doc/ru/reference/errors.md)






[*user-id]: Тип: `int64`. ID пользователя. Необходим для вызова любых ресурсов API Яндекс Вебмастера. Чтобы получить его, используйте метод [GET /v4/user](https://yandex.ru/dev/webmaster/doc/ru/reference/user.md).

[*host-id]: Тип: `string`. ID сайта. Чтобы получить его, используйте метод [GET&nbsp;/v4/user/{user&#x2011;id}/hosts](https://yandex.ru/dev/webmaster/doc/ru/reference/hosts.md).

[*error_code]: **Описание**

Код ошибки.

[*error_message]: **Описание**

Сообщение об ошибке.

[*requiredParam]: \*  Обязательный параметр

[*verification_type]: Способ подтверждения прав ([ApiExplicitVerificationType](#type-verify-explicit))

[*verification_uin]: **Обязательный**

<!-- source: ru/_includes/reference/host-verification-post/verification_uin/req.md -->
Да
<!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/req.md -->

**Тип**

<!-- source: ru/_includes/reference/host-verification-post/verification_uin/type.md -->
`string`
<!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/type.md -->

**Описание**

<!-- source: ru/_includes/reference/host-verification-post/verification_uin/desc.md -->
Код подтверждения.
<!-- endsource: ru/_includes/reference/host-verification-post/verification_uin/desc.md -->

[*verification_state]: **Обязательный**

<!-- source: ru/_includes/reference/host-verification-post/verification_state/req.md -->
Да
<!-- endsource: ru/_includes/reference/host-verification-post/verification_state/req.md -->

**Тип**

<!-- source: ru/_includes/reference/host-verification-post/verification_state/type.md -->
`string` ([ApiVerificationState](https://yandex.ru/dev/webmaster/doc/ru/reference/host-verification-post.md#status-verify))
<!-- endsource: ru/_includes/reference/host-verification-post/verification_state/type.md -->

**Описание**

<!-- source: ru/_includes/reference/host-verification-post/verification_state/desc.md -->
Состояние подтверждения прав.
<!-- endsource: ru/_includes/reference/host-verification-post/verification_state/desc.md -->