Adding a site
Adds the site to the user's site list.
Request format
POST https://api.webmaster.yandex.net/v4/user/{user-id}/hosts
|
|
Type: |
In the request body, specify the new site name and the desired data type in the Content-type header (application/json or application/xml):
Example
{
"host_url": "http://example.com"
}
<Data>
<host_url>http://example.com</host_url>
</Data>
|
Parameter |
Description |
|
|
URI of the site to add. |
Response format
Example
{
"host_id": "http:example.com:80"
}
<Data>
<host_id>http:example.com:80</host_id>
</Data>
|
Parameter |
Required |
Type |
Description |
|
|
Yes |
|
ID of the added site. |
Response codes
To view the response structure in detail, click the reason.
|
Code |
Reason |
Description |
|
201 |
CREATED |
The site was added to the user's list. |
|
403 |
The number of sites in the user's site list exceeded the limit (the current limit is 1703). JSON
XML
|
|
|
403 |
The ID of the user who issued the token differs from the one specified in the request. In the examples below, JSON
XML
|
|
|
409 |
A site with this name was already added to the user's site list. JSON
XML
|
Related information
Type: int64. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the GET /v4/user method.
Description
URI of the site to add.
Required
Yes
Type
host id (string)
Description
ID of the added site.
Description
Error code.
Description
ID of the user who allowed access.
Description
The limit on the number of added sites.
Description
Error message.