---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.ru/dev/webmaster/doc/en/reference/hosts.md
  - https://yandex.ru/dev/webmaster/doc/ru/reference/hosts.md
keywords:
  - s
  - i
  - t
  - e
  - ' '
  - l
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/webmaster/doc/en/llms.txt


# Getting the list of the user's sites

Returns the list of sites added by the user and information about each of them.

## Request format

```
GET https://api.webmaster.yandex.net/v4/user/{[user-id](*user-id)}/hosts
```

#|
||
`user-id`
|
<!-- source: en/_includes/popups.md -->
Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.ru/dev/webmaster/doc/en/reference/user.md) method.
<!-- endsource: en/_includes/popups.md -->
||
|#

## Response format

### Example


{% list tabs %}

- JSON

  
  ```javascript
  {
    "hosts": [
      {
        "host_id": "http:ya.ru:80",
        "ascii_host_url": "http://xn--d1acpjx3f.xn--p1ai/",
        "unicode_host_url": "http://яндекс.рф/",
        "verified": true,
        "main_mirror": {
          "host_id": "http:ya.ru:80",
          "verified": true,
          "ascii_host_url": "http://xn--d1acpjx3f.xn--p1ai/",
          "unicode_host_url": "http://яндекс.рф/"
        }
      }, ...
    ]
  }
  ```
  

- XML

  
  ```xml
  <Data>
      <host>
          <[host_id](*host_id_4)>http:ya.ru:80</host_id>
          <[ascii_host_url](*ascii_host_url)>http://xn--d1acpjx3f.xn--p1ai/</ascii_host_url>
          <[unicode_host_url](*unicode_host_url)>http://яндекс.рф/</unicode_host_url>
          <[verified](*verified)>yes</verified>
          <[main_mirror](*main_mirror)>
              <[host_id](*host_id_4)>http:ya.ru:80</host_id>
              <[verified](*verified)>false</verified>
              <[ascii_host_url](*ascii_host_url)>http://xn--d1acpjx3f.xn--p1ai/</ascii_host_url>
              <[unicode_host_url](*unicode_host_url)>http://яндекс.рф/</unicode_host_url>
          </main_mirror>
      </host>
      ...
  </Data>
  ```

{% endlist %}

#|
|| **Name** | **Required** | **Type** | **Description** ||
|| `host_id` | Yes | `host id` (`string`) | The site ID. || 
|| `ascii_host_url` | Yes | `string` | The site's ASCII URL || 
|| `unicode_host_url` | No | `string` | The site's UTF-8 URL. || 
|| `verified` | Yes | `boolean` | Whether the site is verified. || 
|| `main_mirror` | Yes |  | The site's main mirror, if there is one. || 
|#

<!-- source: en/_includes/reference/verification-state.md -->
### The status of verifying the right to manage the site (ApiVerificationState) {#verification-state}

#|
|| **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. ||
|#
<!-- endsource: en/_includes/reference/verification-state.md -->

<!-- source: en/_includes/reference/verification-fail-reason.md -->
### Reasons for refusal to verify site management rights (ApiVerificationFailReason) {#verification-fail-reason}

#|
|| **Reason for refusal** | **Description** ||
|| `DELEGATION CANCELLED` | Delegation of site management rights was canceled. ||
|| `DNS_RECORD_NOT_FOUND` | The specified DNS record doesn't exist. ||
|| `META_TAG_NOT_FOUND` | The meta tag is missing in the site's home page header. ||
|| `PDD_VERIFICATION_CANCELLED` | Verification of site management rights via Yandex.Mail for Domain isn't allowed for this site. ||
|| `WRONG_HTML_PAGE_CONTENT` | The HTML file content is set incorrectly. ||
|#
<!-- endsource: en/_includes/reference/verification-fail-reason.md -->

## Response codes

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

#|
||
**Code** | **Reason** | **Description**
||
||
200 | OK | 
||
||
403
|
[INVALID_USER_ID](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#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.

{% 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 %}
||
|#

### Related information

- [Error codes and statuses](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md)




[*user-id]: Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.ru/dev/webmaster/doc/en/reference/user.md) method.

[*host_id_4]: **Required**

Yes

**Type**

`host id` (`string`)

**Description**

The site ID.

[*ascii_host_url]: **Required**

Yes

**Type**

`string`

**Description**

The site's ASCII URL

[*unicode_host_url]: **Required**

No

**Type**

`string`

**Description**

The site's UTF-8 URL.

[*verified]: **Required**

Yes

**Type**

`boolean`

**Description**

Whether the site is verified.

[*main_mirror]: **Required**

Yes

**Type**

**Description**

The site's main mirror, if there is one.

[*error_code]: **Description**

Error code.

[*available_user_id]: **Description**

ID of the user who allowed access.

[*error_message]: **Description**

Error message.