This topic describes the common response parameters and HTTP status codes for calling the Content Moderation API operations.

Common response parameters

Responses to all requests are JSON-formatted data. The following table describes the common response parameters.

ParameterTypeRequiredDescription
codeIntegerYesThe HTTP status code returned for the moderation task. Some extended error codes are supported.
  • 2xx: indicates a success.
  • 4xx: indicates an invalid request.
  • 5xx indicates a backend error.

For more information, see Common error codes.

msgStringYesThe details of the error.
requestIdStringYesThe unique ID of the request, which can be used to locate issues.
dataInteger, String, or JSON objectNoThe service-related response data. This parameter may be left empty when an error occurs. Generally, the value is a JSON structure or array.

Common error codes

Error codeHTTP status codeDescription
OK200The message returned because the request was successful.
PROCESSING280The error message returned because the task is running. We recommend that you wait for a while and start the query again. For example, you wait for 5 seconds before you start the query again.
BAD_REQUEST400The error message returned because the request is invalid. This error is typically caused by invalid request parameters. Check whether the request parameters are valid.
NOT_ALLOWED401The error message returned because the URL contained in the request redirects to an insecure image or video.
FORBIDDEN403The error message returned because the URL is inaccessible. Check whether the URL can be accessed from the Internet and whether hotlink protection is configured.
NOT_FOUND404The error message returned because the content to be moderated cannot be found. This is usually because your image or video content cannot be downloaded. Make sure that the content is accessible from the Internet.
DOWNLOAD_FAILED480The error message returned because the download fails. If the size and resolution of the content can be obtained, make sure that the size and resolution are allowed by the API.
GENERAL_ERROR500The error message returned because a temporary server error occurs. We recommend that you try again. If the error persists, submit a ticket on Support and Services.
ServiceUnavailable503The error message returned because a system error occurs. We recommend that you check whether the domain name in the request is normal. If you confirm that the domain name is normal, submit a ticket on Support and Services.
DB_FAILED580The error message returned because an error occurs on database operations. We recommend that you try again. If the error persists, submit a ticket on Support and Services.
TIMEOUT581The error message returned because the operation times out. We recommend that you try again. If the error persists, submit a ticket on Support and Services.
CACHE_FAILED585The error message returned because a cache error occurs. We recommend that you try again. If the error persists, submit a ticket on Support and Services.
ALGO_FAILED586The error message returned because an algorithm error occurs. Submit a ticket on Support and Services.
MQ_FAILED587The error message returned because a middleware error occurs. Submit a ticket on Support and Services.
EXCEED_QUOTA588The error message returned because the number of requests exceeds the quota. The default quota for moderation is 50 images per second, 20 channels of videos per second, 20 channels of audio per second, or 100 entries of text per second. The default quota for OCR is 10 images per second. If you want to adjust the quota, submit a ticket on Support and Services.
TOO_LARGE589The error message returned because the content to be moderated is too large in size. Make sure that the content size is allowed by the API. We recommend that you try again. If the error persists, submit a ticket on Support and Services.
BAD_FORMAT590The error message returned because the content to be moderated is in an invalid format. Make sure that the format of the content is allowed by the API.
CONNECTION_POOL_FULL591The error message returned because the connection pool is full. Submit a ticket on Support and Services.
DOWNLOAD_TIMEOUT592The error message returned because the download times out. The download duration is limited to 3 seconds. Make sure that the size of the moderated content is allowed by the API.
EXPIRED594The error message returned because the task expires. For example, the task ID expires.
CATCH_FRAME_FAILED595The error message returned because video snapshot fails to be captured. Submit a ticket on Support and Services.
PERMISSION_DENY 596The error message returned because the account is not activated, unauthorized, disabled, or has overdue payments. For more information, see the returned message.