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"
    }
    ParameterDescription
    error_codeENTITY_VALIDATION_ERROR – The request body failed validation.
    error_messageError 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"
    }
    ParameterDescription
    error_codeFIELD_VALIDATION_ERROR – A parameter failed validation.
    field_nameThe name of the parameter that failed validation.
    field_valueThe passed value of the parameter.
    error_messageError 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"
    }
    ParameterDescription
    error_codeACCESS_FORBIDDEN – The action is unavailable because the application doesn't have the necessary permissions.
    error_messageError message.
  • INVALID_OAUTH_TOKEN error

    The OAuth token is missing or invalid.

    {
      "error_code": "INVALID_OAUTH_TOKEN",
      "error_message": "explicit error message"
    }
    ParameterDescription
    error_codeINVALID_OAUTH_TOKEN – The OAuth token is missing or invalid.
    error_messageError message.

404 Not Found

The resource at the requested path doesn't exist.

{
  "error_code": "RESOURCE_NOT_FOUND",
  "error_message": "explicit error message"
}
ParameterDescription
error_codeRESOURCE_NOT_FOUND – The resource at the requested path doesn't exist.
error_messageError message.

405 Method Not Allowed

The HTTP method is not supported for this resource.

{
  "error_code": "METHOD_NOT_ALLOWED",
  "error_message": "explicit error message"
}
ParameterDescription
error_codeMETHOD_NOT_ALLOWED – The HTTP method is not supported for this resource.
error_messageError 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"
}
ParameterDescription
error_codeCONTENT_TYPE_UNSUPPORTED – The content types passed in the Accept header are not supported.
acceptable_typeThe list of supported content types.
error_messageError 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"
}
ParameterDescription
error_codeCONTENT_TYPE_UNSUPPORTED – The content type in the request is not supported.
supported_content_typeThe list of supported content types.
error_messageError message.

Error severity (SiteProblemSeverityEnum)

CodeDescription
FATALFatal errors.
CRITICALCritical problems.
POSSIBLE_PROBLEMPossible issues.
RecommendationRecommendations.

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

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

Reason for refusalDescription
DELEGATION CANCELLEDCanceled delegation of site management rights.
DNS_RECORD_NOT_FOUNDThe specified DNS record does not exist.
META_TAG_NOT_FOUNDMissing metatag in the header on the site's main page.
PDD_VERIFICATION_CANCELLEDThis site does not allow verifying rights via Mail for Domains.
WHOIS_EMAIL_NOT_FOUNDThe specified email address does not exist in the WHOIS record for this site.
WRONG_HTML_PAGE_CONTENTInvalid HTML file content.

Sitemap source (ApiSitemapSource)

SourceDescription
ROBOTS_TXTThe sitemap is specified in the robots.txt file on the site.
WEBMASTERThe user added the sitemap in Yandex.Webmaster.
INDEX_SITEMAPThe sitemap was found in another (indexed) sitemap file.

Type of sitemap file (ApiSitemapType)

TypeDescription
SITEMAPA normal sitemap file containing the URLs of site pages.
INDEX_SITEMAPA sitemap index containing the URLs of other sitemaps.

The status of site indexing (ApiHostDataStatus)

SourceDescription
NOT_INDEXEDThe site hasn't been indexed yet.
NOT_LOADEDThe site data hasn't been loaded to Yandex.Webmaster yet.
OKThe site has been indexed and data is available in Yandex.Webmaster.

Indexing indicators (ApiIndexingIndicator)

IndicatorDescription
SEARCHABLEPages available on search.
DOWNLOADEDPages visited.
DOWNLOADED_2XXVisited pages with a 2xx code.
DOWNLOADED_3XXVisited pages with a 3xx code.
DOWNLOADED_4XXVisited pages with a 4xx code.
DOWNLOADED_5XXVisited pages with a 5xx code.
FAILED_TO_DOWNLOADLoading failed.
EXCLUDEDExcluded pages.
EXCLUDED_DISALLOWED_BY_USERPages excluded by the resource owner's choice (4xx codes or disallows in robots.txt).
EXCLUDED_SITE_ERRORExclusions due to an error on the site.
EXCLUDED_NOT_SUPPORTEDExclusions of pages not supported by Yandex robots.

Query indicators (ApiQueryIndicator)

IndicatorDescription
TOTAL_SHOWSThe number of displays in search results.
TOTAL_CLICKSThe number of clicks.
AVG_SHOW_POSITIONThe average position where the site was displayed.
AVG_CLICK_POSITIONThe average click position.

Sort order for queries (ApiQueryOrderField)

IndicatorDescription
TOTAL_SHOWSThe number of displays in search results.
TOTAL_CLICKSThe number of clicks.