Start the rights verification process

Description

Initiates the site management rights verification process in Yandex.Webmaster. The request must specify which site verification method is selected.

Request format

Send a POST request to the address of the resource for verifying the user's site. You must specify the verification method in a GET parameter. The request body can pass any data, or none at all.

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

Path parameters

Name Required Type Default value Description
user-id Yes int64 The user ID.
host-id Yes host id Site ID.

Query arguments

Name Required Type Description
verification_type Yes ApiExplicitVerificationType Method for verifying rights.

Explicit methods of verifying rights (ApiExplicitVerificationType)

Verification method Whether a verification status check can be requested Description
DNS Yes Verifying rights using DNS records.
HTML_FILE Yes Placing an HTML file in the site's root directory.
META_TAG Yes Adding a metatag to the header on the site's main page.
WHOIS Yes

Verifying data with the information provided by the WHOIS service.

This method only works for second-level domains (such as example.com).

Response format

If successful, the server returns 200 and data about the current state of site verification.

Example

HTTP/1.1 200 OK
{
  "verification_uin": "b01288afe67b1595",
  "verification_state": "IN_PROGRESS",
  "verification_type": "HTML_FILE",
  "applicable_verifiers": [
    "HTML_FILE"
  ]
}
Name Required Type Description
verification_uin Yes string Verification code.
verification_state Yes ApiVerificationState The state of rights verification.
verification_type Yes ApiVerificationType The type of rights verification.
applicable_verifiers Yes ApiExplicitVerificationType The verification methods to apply for the selected site.

The status of verifying site management rights (ApiVerificationState)

Status Description
NONE Verification wasn't performed, and site management rights weren't confirmed.
VERIFIED Rights were verified.
IN_PROGRESS Rights are in the process of being verified.
VERIFICATION_FAILED Site management rights were checked, but not confirmed.
INTERNAL_ERROR An unexpected error occurred during verification.

Methods for verifying rights (ApiVerificationType)

Verification method Whether a verification status check can be requested Description
AUTO No Automatic verification of rights (deprecated; only for *.narod.ru sites).
DELEGATED No Rights were delegated.
DNS Yes Verifying rights using DNS records.
HTML_FILE Yes Placing an HTML file in the site's root directory.
META_TAG Yes Adding a metatag to the header on the site's main page.
PDD No Verifying rights via Yandex.Mail for Domains.
TXT_FILE No Placing a text file in the site's root directory.
WHOIS Yes

Verifying data with the information provided by the WHOIS service.

This method only works for second-level domains (such as example.com).

Explicit methods of verifying rights (ApiExplicitVerificationType)

Verification method Whether a verification status check can be requested Description
DNS Yes Verifying rights using DNS records.
HTML_FILE Yes Placing an HTML file in the site's root directory.
META_TAG Yes Adding a metatag to the header on the site's main page.
WHOIS Yes

Verifying data with the information provided by the WHOIS service.

This method only works for second-level domains (such as example.com).

Errors

403 Forbidden

The user ID for the token doesn't match the one specified in the request. In the examples below, {user_id} is the correct uid for the owner of the OAuth token.

{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
Parameter Description
error_code Error code.
available_user_id ID of the user who allowed access.
error_message Error message.

404 Not Found

The site isn't in the list of the user's sites, or rights to the site haven't been verified.

{
  "error_code": "HOST_NOT_FOUND",
  "host_id": "http:ya.ru:80",
  "error_message": "explicit error message"
}
Parameter Description
error_code Error code.
host_id The ID of the requested site.
error_message Error message.

409 Conflict

The rights verification process has already been started.

{
  "error_code": "VERIFICATION_ALREADY_IN_PROGRESS",
  "host_id": "http:ya.ru:80",
  "verified": false,
  "error_message": "explicit error message"
}
Parameter Description
error_code Error code.
verification_type The type of verification currently being processed ( ApiExplicitVerificationType ).
error_message Error message.