Error codes and statuses

If an error occurs, the HTTP error code is returned. In some cases, an error description is also provided.

All API methods may return the following error codes:

400 Bad Request

  • ENTITY_VALIDATION_ERROR error

    The request body failed validation.

    {
      "error_code": "ENTITY_VALIDATION_ERROR",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code ENTITY_VALIDATION_ERROR – The request body failed validation.
    error_message Error message.
  • FIELD_VALIDATION_ERROR error

    The parameter failed validation.

    {
      "error_code": "FIELD_VALIDATION_ERROR",
      "field_name": "some string",
      "field_value": "some string",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code FIELD_VALIDATION_ERROR – A parameter failed validation.
    field_name The name of the parameter that failed validation.
    field_value The passed value of the parameter.
    error_message Error message.

403 Forbidden

  • ACCESS_FORBIDDEN error

    The action is unavailable because the application doesn't have the necessary permissions.

    {
      "error_code": "ACCESS_FORBIDDEN",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code ACCESS_FORBIDDEN – The action is unavailable because the application doesn't have the necessary permissions.
    error_message Error message.
  • INVALID_OAUTH_TOKEN error

    The OAuth token is missing or invalid.

    {
      "error_code": "INVALID_OAUTH_TOKEN",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code INVALID_OAUTH_TOKEN – The OAuth token is missing or invalid.
    error_message Error message.

404 Not Found

The resource at the requested path doesn't exist.

{
  "error_code": "RESOURCE_NOT_FOUND",
  "error_message": "explicit error message"
}
Parameter Description
error_code RESOURCE_NOT_FOUND – The resource at the requested path doesn't exist.
error_message Error message.

405 Method Not Allowed

The HTTP method is not supported for this resource.

{
  "error_code": "METHOD_NOT_ALLOWED",
  "error_message": "explicit error message"
}
Parameter Description
error_code METHOD_NOT_ALLOWED – The HTTP method is not supported for this resource.
error_message Error message.

406 Not Acceptable

The content types passed in the Accept header are not supported.

{
  "error_code": "CONTENT_TYPE_UNSUPPORTED",
  "acceptable_types": [
    "some string", ...
  ],
  "error_message": "explicit error message"
}
Parameter Description
error_code CONTENT_TYPE_UNSUPPORTED – The content types passed in the Accept header are not supported.
acceptable_type The list of supported content types.
error_message Error message.

415 Unsupported Media Type

The content type in the request is not supported.

{
  "error_code": "CONTENT_TYPE_UNSUPPORTED",
  "supported_content_types": [
    "some string", ...
  ],
  "error_message": "explicit error message"
}
Parameter Description
error_code CONTENT_TYPE_UNSUPPORTED – The content type in the request is not supported.
supported_content_type The list of supported content types.
error_message Error message.

Error severity (SiteProblemSeverityEnum)

Code Description
FATAL Fatal errors.
CRITICAL Critical problems.
POSSIBLE_PROBLEM Possible issues.
Recommendation Recommendations.

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).

The reasons why site management rights weren't confirmed (ApiVerificationFailReason)

Reason for refusal Description
DELEGATION CANCELLED Canceled delegation of site management rights.
DNS_RECORD_NOT_FOUND The specified DNS record does not exist.
META_TAG_NOT_FOUND Missing metatag in the header on the site's main page.
PDD_VERIFICATION_CANCELLED This site does not allow verifying rights via Mail for Domains.
WHOIS_EMAIL_NOT_FOUND The specified email address does not exist in the WHOIS record for this site.
WRONG_HTML_PAGE_CONTENT Invalid HTML file content.

Sitemap source (ApiSitemapSource)

Source Description
ROBOTS_TXT The sitemap is specified in the robots.txt file on the site.
WEBMASTER The user added the sitemap in Yandex.Webmaster.
INDEX_SITEMAP The sitemap was found in another (indexed) sitemap file.

Type of sitemap file (ApiSitemapType)

Type Description
SITEMAP A normal sitemap file containing the URLs of site pages.
INDEX_SITEMAP A sitemap index containing the URLs of other sitemaps.

The status of site indexing (ApiHostDataStatus)

Source Description
NOT_INDEXED The site hasn't been indexed yet.
NOT_LOADED The site data hasn't been loaded to Yandex.Webmaster yet.
OK The site has been indexed and data is available in Yandex.Webmaster.

Indexing indicators (ApiIndexingIndicator)

Indicator Description
SEARCHABLE Pages available on search.
DOWNLOADED Pages visited.
DOWNLOADED_2XX Visited pages with a 2xx code.
DOWNLOADED_3XX Visited pages with a 3xx code.
DOWNLOADED_4XX Visited pages with a 4xx code.
DOWNLOADED_5XX Visited pages with a 5xx code.
FAILED_TO_DOWNLOAD Loading failed.
EXCLUDED Excluded pages.
EXCLUDED_DISALLOWED_BY_USER Pages excluded by the resource owner's choice (4xx codes or disallows in robots.txt).
EXCLUDED_SITE_ERROR Exclusions due to an error on the site.
EXCLUDED_NOT_SUPPORTED Exclusions of pages not supported by Yandex robots.

Query indicators (ApiQueryIndicator)

Indicator Description
TOTAL_SHOWS The number of displays in search results.
TOTAL_CLICKS The number of clicks.
AVG_SHOW_POSITION The average position where the site was displayed.
AVG_CLICK_POSITION The average click position.

Sort order for queries (ApiQueryOrderField)

Indicator Description
TOTAL_SHOWS The number of displays in search results.
TOTAL_CLICKS The number of clicks.