Starting the rights verification process

Starts the procedure for verifying site management rights.

Alert

Before using this request, get a unique confirmation code and choose how you will verify your rights. For more information, see the example.

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}/hosts/{host-id}/verification
  ? verification_type=<string>

user-id

Type: int64. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the GET /v4/user method.

host-id

Type: host id (string). The site ID. To get it, use the GET /v4/user/{user-id}/hosts method.

verification_type*

Rights verification method (ApiExplicitVerificationType)

* Required

Response format

Example

HTTP/1.1 200 OK
{
  "verification_uin": "b01288afe67b1595",
  "verification_state": "IN_PROGRESS",
  "verification_type": "HTML_FILE",
  "applicable_verifiers": [
    "HTML_FILE"
  ]
}
<Data>
    <verification_uin>b01288afe67b1595</verification_uin>
    <verification_state>IN_PROGRESS</verification_state>
    <verification_type>HTML_FILE</verification_type>
    <applicable_verifier>HTML_FILE</applicable_verifier>
</Data>

Name

Required

Type

Description

verification_uin

Yes

string

Confirmation code.

verification_state

Yes

string (ApiVerificationState)

The rights verification state.

verification_type

Yes

string (ApiVerificationType)

The type of rights verification.

applicable_verifiers

Yes

string (ApiExplicitVerificationType)

The verification methods applied for the given site.

The status of verifying the right to manage the site (ApiVerificationState)

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.

Rights verification methods (ApiVerificationType)

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.

Explicit methods of rights verification (ApiExplicitVerificationType)

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.

Response codes

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

Code

Reason

Description

200

OK

403

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.

{   
    "error_code": "INVALID_USER_ID",   
    "available_user_id": 1,   
    "error_message": "Invalid user id. {user_id} should be used."
}
<Data>     
    <error_code>INVALID_USER_ID</error_code>     
    <available_user_id>1</available_user_id>     
    <error_message>Invalid user id. {user_id} should be used.</error_message> 
</Data>

404

HOST_NOT_FOUND

The site is not in the list of the user's sites.

{   
    "error_code": "HOST_NOT_FOUND",   
    "host_id": "http:ya.ru:80",   
    "error_message": "explicit error message"
}
<Data>     
    <error_code>HOST_NOT_FOUND</error_code>     
    <host_id>http:ya.ru:80</host_id>     
    <error_message>explicit error message</error_message>
</Data>

409

VERIFICATION_ALREADY_IN_PROGRESS

The rights verification process is in progress.

{   
    "error_code": "VERIFICATION_ALREADY_IN_PROGRESS",   
    "verification_type": "META_TAG",   
    "error_message": "some string"
}
<Data>   
    <error_code>VERIFICATION_ALREADY_IN_PROGRESS</error_code>     
    <verification_type>META_TAG</verification_type>    
    <error_message>some string</error_message>
</Data>

*Required

Type: int64. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the GET /v4/user method.

Type: host id (string). The site ID. To get it, use the GET /v4/user/{user-id}/hosts method.

Rights verification method (ApiExplicitVerificationType)

Required

Yes

Type

string

Description

Confirmation code.

Required

Yes

Type

string (ApiVerificationState)

Description

The rights verification state.

Rights verification method (ApiExplicitVerificationType)

Description

Error code.

Description

ID of the user who allowed access.

Description

ID of the requested site.

Description

Error message.

Explicit methods of rights verification (ApiExplicitVerificationType)

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.

The status of verifying the right to manage the site (ApiVerificationState)

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.

Rights verification methods (ApiVerificationType)

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.