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

NameRequiredTypeDefault valueDescription
user-idYesint64The user ID.
host-idYeshost idSite ID.

Query arguments

NameRequiredTypeDescription
verification_typeYesApiExplicitVerificationTypeMethod for verifying rights.

Explicit methods of verifying rights (ApiExplicitVerificationType)

Verification methodWhether a verification status check can be requestedDescription
DNSYesVerifying rights using DNS records.
HTML_FILEYesPlacing an HTML file in the site's root directory.
META_TAGYesAdding a metatag to the header on the site's main page.
WHOISYes

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"
  ]
}
NameRequiredTypeDescription
verification_uinYesstringVerification code.
verification_stateYesApiVerificationStateThe state of rights verification.
verification_typeYesApiVerificationTypeThe type of rights verification.
applicable_verifiersYesApiExplicitVerificationTypeThe verification methods to apply for the selected site.

The status of verifying site management rights (ApiVerificationState)

StatusDescription
NONEVerification wasn't performed, and site management rights weren't confirmed.
VERIFIEDRights were verified.
IN_PROGRESSRights are in the process of being verified.
VERIFICATION_FAILEDSite management rights were checked, but not confirmed.
INTERNAL_ERRORAn unexpected error occurred during verification.

Methods for verifying rights (ApiVerificationType)

Verification methodWhether a verification status check can be requestedDescription
AUTONoAutomatic verification of rights (deprecated; only for *.narod.ru sites).
DELEGATEDNoRights were delegated.
DNSYesVerifying rights using DNS records.
HTML_FILEYesPlacing an HTML file in the site's root directory.
META_TAGYesAdding a metatag to the header on the site's main page.
PDDNoVerifying rights via Yandex.Mail for Domains.
TXT_FILENoPlacing a text file in the site's root directory.
WHOISYes

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 methodWhether a verification status check can be requestedDescription
DNSYesVerifying rights using DNS records.
HTML_FILEYesPlacing an HTML file in the site's root directory.
META_TAGYesAdding a metatag to the header on the site's main page.
WHOISYes

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."
}
ParameterDescription
error_codeError code.
available_user_idID of the user who allowed access.
error_messageError 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"
}
ParameterDescription
error_codeError code.
host_idThe ID of the requested site.
error_messageError 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"
}
ParameterDescription
error_codeError code.
verification_typeThe type of verification currently being processed ( ApiExplicitVerificationType ).
error_messageError message.