Document Moderation

Submit documents for content moderation to detect text and image risks across multiple file formats.

Submit documents for content moderation to detect regulatory risks in both text and images within document files.

Document Moderation API

Request URL

ClusterURLSupported Products
Beijinghttp://api-article-bj.fengkongcloud.com/v1/saas/anti_fraud/articleDocument Moderation
Virginiahttp://api-article-fjny.fengkongcloud.com/v1/saas/anti_fraud/articleDocument Moderation
Singaporehttp://api-article-xjp.fengkongcloud.com/v1/saas/anti_fraud/articleDocument Moderation

Requirements

ItemSpecification
EncodingUTF-8
MethodPOST
Recommended timeout15s
Body formatJSON (max 3.5 MB)

Request Parameters

Placed in the HTTP Body in JSON format.

ParameterTypeRequiredDescription
accessKeystringYesAPI authentication key, provided by ISHUMEI.
typestringNoPlatform business type. See Business Types.
imgTypestringNoImage detection types within the document. See Image Detection Types. If not provided, defaults to political, pornographic, and advertising detection.
txtTypestringNoText detection types within the document. See Text Detection Types. If not provided, defaults to standard risk detection.
appIdstringNoApplication identifier. Used to distinguish different applications within the same company. The value should be agreed upon with ISHUMEI.
callbackstringNoCallback HTTP URL. When non-empty, the service sends moderation results to this URL. Required when fileFormat is provided.
callbackParamjson_objectNoPass-through field. When callback is provided, this field is returned along with the moderation result in the callback request.
datajson_objectYesRequest data content. Max 1 MB. See data Object.

Business Types

ValueDescription
ZHIBOLive streaming
ECOME-commerce
GAMEGaming
NEWSNews
FORUMForum
SOCIALSocial media
NOVELNovel / Fiction

Image Detection Types

Combine multiple types with underscores (e.g., POLITICS_PORN_AD).

ValueDescription
POLITICSPolitical content detection
PORNPornographic content detection
ADAdvertising detection
LOGOWatermark / logo detection
BEHAVIORInappropriate scene detection (smoking, drinking, gambling, drug use, condoms, meaningless frames)
OCROCR text recognition in images
VIOLENCEViolence & terrorism detection
NONEDo not detect images

Text Detection Types

Combine multiple types with underscores (e.g., TEXTRISK_FRAUD). Combined types take the union of detection capabilities. For example, TEXTRISK_POLITY is processed as standard risk detection.

ValueDescription
POLITYPolitical content detection
VIOLENTViolence & terrorism detection
BANProhibited content detection
EROTICPornographic content detection
DIRTYAbusive language detection
ADVERTAdvertising detection
PRIVACYPrivacy information detection
ADLAWAdvertising law violation detection
MEANINGLESSMeaningless content detection
FRAUDOnline fraud detection
UNPOACHHigh-value user anti-poaching detection
TEXTMINORMinor-related content detection
TEXTRISKStandard risk detection (includes: political, terrorism, prohibited, pornographic, abusive, advertising, privacy, advertising law, meaningless)

data Object

ParameterTypeRequiredDescription
contentsstringYesContent to be moderated. Accepts a URL link (web page or document download link). Max file size: 500 MB. Text length limit: 500,000 characters. Image limit: 500 images. Video file limit: 50 segments.
fileFormatstringYesDocument format to be moderated. See Supported File Formats.
tokenIdstringYesUnique client user account identifier for user behavior analysis. Recommended to pass the user UID.
channelstringNoBusiness scenario. Configured via channel table.
returnHtmlboolNoWhether to return HTML with highlighted risk content for human review. Default: false.
nicknamestringNoUser nickname. Strongly recommended — malicious users on most platforms spread spam, political violations, and traffic-diversion content through nicknames.
ipstringNoClient IP address for IP-based user behavior analysis and comparison against the ISHUMEI IP blocklist.
passThroughjson_objectNoPass-through parameter, returned as-is in the response.

Supported File Formats

ValueDescription
PDFPDF document
EPUBEPUB e-book
DOCXWord document (OOXML)
DOCWord document (legacy)
XLSXExcel spreadsheet (OOXML)
XLSExcel spreadsheet (legacy)
PPTXPowerPoint presentation (OOXML)
PPTPowerPoint presentation (legacy)
PPSPowerPoint slide show
PPSXPowerPoint slide show (OOXML)
XLTXExcel template (OOXML)
XLTMExcel macro-enabled template
XLSBExcel binary workbook
XLSMExcel macro-enabled workbook
TXTPlain text
CSVCSV file
SRTSRT subtitle file
VTTWebVTT subtitle file

Response

Synchronous Response Parameters

ParameterTypeRequiredDescription
codeintYesResponse code. See Response Codes.
messagestringYesResponse message corresponding to the code.
requestIdstringYesUnique request identifier for troubleshooting and optimization. Strongly recommended to save.
scoreintNoRisk score. Present when code is 1100. Range: 0–1000. Higher scores indicate greater risk.
riskLevelstringNoDisposition recommendation. PASS: normal (allow), REVIEW: suspicious (manual review), REJECT: violation (block).
detailjson_objectNoRisk details. See detail Object.

Callback Response Parameters

ParameterTypeRequiredDescription
codeintYesResponse code. See Callback Response Codes.
messagestringYesResponse message corresponding to the code.
requestIdstringYesUnique request identifier. Strongly recommended to save.
scoreintNoRisk score. Present when code is 1100. Range: 0–1000.
riskLevelstringNoDisposition recommendation. PASS, REVIEW, or REJECT.
detailjson_objectNoRisk details. See detail Object.
statusintYesService timeout indicator. 0: normal. 501: timeout.
auxInfojson_objectYesAuxiliary information. See auxInfo Object.
callbackParamjson_objectNoPass-through field returned as-is.
resultTypeint32YesResult type. 0: machine moderation. 1: human moderation.
finalResultint32YesWhether this is the final moderation result. 0: not final (machine result only; human review is pending). 1: final result (can be used directly for downstream processing). If only machine moderation is configured, defaults to 1.

Response Codes

CodeMessage
1100Success
1901QPS limit exceeded
1902Invalid parameters
1903Service failure
9101Unauthorized operation

Callback Response Codes

CodeMessage
1100Success
1901QPS limit exceeded
1902Invalid parameters
1903Service failure
9100Insufficient balance
9101Unauthorized operation

detail Object

ParameterTypeRequiredDescription
modelstringYesRule identifier.
descriptionstringYesRisk reason description for the policy rule.
descriptionV2stringNoNew version risk reason description. Only returned for new policies during the transition period.
riskSummaryjson_objectNoRisk summary with counts of each risk type. Returned only when type is NOVEL. See riskSummary.
riskDetailjson_arrayNoRisk details for each content segment. Returned only when type is NOVEL. When returnHtml is true, only REJECT and REVIEW segments are returned. When false, all segments (including PASS) are returned. See riskDetail Array.
riskHtmlstringNoHTML with risk content highlighted, embeddable in display pages. Returned only when type is NOVEL and returnHtml is true.
hitsjson_arrayNoHit information. Generally empty — hit details are in riskDetail.
passThroughjson_objectNoPass-through parameter returned as-is.

riskSummary Object

Each key is a risk type code, and the value is the occurrence count.

Risk TypeDescription
0Normal
100Political content
200Pornographic content
210Abusive language
300Advertising
400Spam / flooding
500Meaningless content
600Prohibited content
700Blocklist
710Allowlist
800High-risk account
900Custom

riskDetail Array

Each element represents a content segment with risk details:

ParameterTypeRequiredDescription
typestringYesContent segment type. text: text content. image: image.
contentstringYesContent of the current segment. Text content for text type; image URL for image type.
beginPositionintNoStart position of the segment in the input (0-indexed). Not returned when type is image.
endPositionintNoEnd position of the segment in the input (0-indexed). Not returned when type is image.
descriptionstringYesRisk description for the current segment. Contains all matched sensitive words from the corresponding list.
riskLevelstringYesDisposition recommendation. PASS: pass, REVIEW: review, REJECT: reject.
riskTypeintYesRisk type identifier. See Text Risk Types and Image Risk Types.
riskTypeDecstringNoDescription corresponding to riskType.
modelstringNoRule identifier for the matched policy rule.
matchedListstringNoName of the sensitive word list that was hit. Only present when a sensitive word is matched.
matchedItemstringNoThe specific sensitive word that was matched. Only present when a sensitive word is matched.
matchedFieldstringNoIndicates whether the nickname or text content hit a sensitive word. text: text hit. nickname: nickname hit. Only present when a sensitive word is matched.
matchedDetailjson_arrayNoMatched list details. See matchedDetail.
indexintNoIndex of the current segment being processed. Index does not distinguish between text and images.
keywordsPositionstringNoPosition of the matched sensitive word within this segment.
textstringNoOCR content from the image. Returned when OCR content is recognized in an image segment.

Text Risk Types

CodeDescription
0Normal
100Political content
200Pornographic content
210Abusive language
300Advertising
400Spam / flooding
500Meaningless content
600Prohibited content
700Blocklist
710Allowlist
800High-risk account
900Custom

Image Risk Types

CodeDescription
0Normal
100Political content
200Pornographic content
210Sexually suggestive
300Advertising
310QR code
320Watermark
400Violence & terrorism
500Violation
510Inappropriate scene
520Minor
700Blocklist
710Allowlist
800High-risk account
900Custom

matchedDetail Array

ParameterTypeRequiredDescription
listIdstringYesList identifier.
matchedFiledstring_arrayNoIndicates whether text or nickname hit the sensitive word. text: text hit. nickname: nickname hit.
namestringYesName of the sensitive word list that was hit.
organizationstringNoCompany identifier of the matched list. GLOBAL indicates a global list.
wordsstring_arrayNoAll matched sensitive words from the corresponding list.
wordPositionsjson_arrayNoAll matched sensitive words with their positions. See wordPositions.

wordPositions

ParameterTypeRequiredDescription
wordstringNoThe matched sensitive word.
positionstringNoPosition of the sensitive word.

auxInfo Object

ParameterTypeRequiredDescription
textNumintYesNumber of characters in the current request (matches the billing count). Includes Chinese characters, English letters, punctuation, and spaces.
imgNumintYesNumber of images in the current request (matches the billing count). Animated images are split into 3 frames; long images are segmented.

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "type": "NOVEL",
  "appId": "your_app_id",
  "callback": "http://www.example.com/callback",
  "callbackParam": {
    "callbackId": "Id123"
  },
  "data": {
    "tokenId": "user_token_id",
    "contents": "https://example.com/document.pdf",
    "returnHtml": true
  }
}

Synchronous Response Example

{
  "code": 1100,
  "message": "Success",
  "requestId": "xxxxxxxxxxxxxxxxxx",
  "score": 0,
  "riskLevel": "PASS",
  "detail": {
    "description": "Normal",
    "model": "M1000",
    "riskType": 0
  },
  "status": 0
}

Callback Response Example

{
  "code": 1100,
  "message": "Success",
  "requestId": "xxxxxxxxxxxxxxxxxx",
  "score": 700,
  "riskLevel": "REJECT",
  "callbackParam": {
    "callbackId": "Id123"
  },
  "detail": {
    "description": "Image violation",
    "hits": [],
    "model": "M04301",
    "riskDetail": [
      {
        "beginPosition": 1235,
        "content": "To prevent telecom fraud, if you receive a call from 962110, please answer immediately",
        "description": "Contains contact information",
        "endPosition": 1264,
        "index": 287,
        "model": "",
        "riskLevel": "REJECT",
        "riskType": 300,
        "type": "text"
      },
      {
        "content": "http://example.com/image.png",
        "description": "QR code",
        "index": 281,
        "model": "",
        "riskLevel": "REJECT",
        "riskType": 300,
        "type": "image"
      }
    ],
    "riskHtml": "...",
    "riskSummary": {
      "300": 5
    }
  },
  "status": 0,
  "auxInfo": {
    "textNum": "100",
    "imgNum": "10"
  }
}

Async Document Upload API

Submit documents for asynchronous moderation. Use the Result Query API to retrieve results.

Request URL

ClusterURLSupported Products
Beijinghttp://api-article-bj.fengkongcloud.com/v1/saas/anti_fraud/article_asyncDocument Moderation

Requirements

ItemSpecification
EncodingUTF-8
MethodPOST
Recommended timeout5s
Body formatJSON (max 3.5 MB)

Request Parameters

Placed in the HTTP Body in JSON format.

ParameterTypeRequiredDescription
accessKeystringYesAPI authentication key, provided by ISHUMEI.
typestringNoPlatform business type. See Business Types.
imgTypestringNoImage detection types within the document. See Image Detection Types.
txtTypestringNoText detection types within the document. See Text Detection Types. If not provided, defaults to standard risk detection.
appIdstringNoApplication identifier. The value should be agreed upon with ISHUMEI.
datajson_objectYesRequest data content. Max 1 MB. Same structure as the synchronous API data Object.

Response Parameters

ParameterTypeRequiredDescription
codeintYesResponse code. See Callback Response Codes.
messagestringYesResponse message corresponding to the code.
requestIdstringYesUnique request identifier. Strongly recommended to save.

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "type": "NOVEL",
  "callback": "",
  "txtType": "",
  "imgType": "",
  "appId": "your_app_id",
  "data": {
    "channel": "",
    "contents": "<div>Sample document content with embedded images<img src=\"http://example.com/image.jpg\" alt=\"Image\"></div>",
    "returnHtml": true,
    "itemId": "CHAPTER_CONTENT_0",
    "tokenId": "49930319"
  }
}

Response Example

{
  "code": 1100,
  "message": "Success",
  "requestId": "tye7ert12asdfasdf31236444442333312"
}

Result Query API

Query both machine moderation and human moderation results.

Request URL

ClusterURLSupported Products
Beijinghttp://api-article-bj.fengkongcloud.com/v1/saas/anti_fraud/article/queryDocument Moderation

Requirements

ItemSpecification
EncodingUTF-8
MethodPOST
Recommended timeout1s

Request Parameters

Placed in the HTTP Body in JSON format.

ParameterTypeRequiredDescription
accessKeystringYesAPI authentication key, provided by ISHUMEI.
requestIdsarrayYesArray of requestId strings returned by ISHUMEI. Maximum of 10 items.

Response Parameters

ParameterTypeRequiredDescription
codeintYesResponse code.
messagestringYesResponse message.
contentsjson_arrayYesQuery results. See contents Array.

contents Array

Each element represents a query result:

ParameterTypeRequiredDescription
requestIdstringYesUnique request identifier.
humanResultjson_objectNoHuman moderation result. Only present after human review is completed.
machineResultjson_objectNoMachine moderation result. Only present after machine moderation is completed. Uses the same structure as the Callback Response Parameters.
mergeResultjson_objectNoMerged human and machine moderation result. Returns human result if available; otherwise returns machine result. If neither exists, this field is not present.

humanResult / mergeResult Structure

ParameterTypeRequiredDescription
riskLevelstringYesDisposition recommendation. REJECT: delete. PASS: publish.

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "requestIds": [
    "tye7ert12asdfasdf31236633346662333312"
  ]
}

Response Example

{
  "code": 1100,
  "message": "Success",
  "contents": [
    {
      "requestId": "tye7ert12asdfasdf31236633346662333312",
      "machineResult": {
        "code": 1100,
        "detail": {
          "description": "Text violation",
          "hits": [
            {
              "description": "Advertising: Advertising: Advertising",
              "descriptionV2": "Advertising: Advertising: Advertising",
              "model": "MA000007020001001",
              "riskLevel": "REJECT",
              "riskType": 300,
              "score": 650,
              "type": "text"
            }
          ],
          "model": "M03101",
          "riskDetail": [
            {
              "beginPosition": 0,
              "content": "Sample text content with detected risk...",
              "description": "Advertising: Advertising: Advertising",
              "endPosition": 36,
              "index": 0,
              "keywordsPosition": "8",
              "matchedDetail": [
                {
                  "listId": "9da189a5bf1919d242d745f19ea3e5d7",
                  "matchedFiled": ["text"],
                  "name": "Original text list",
                  "organization": "12312312",
                  "wordPositions": [
                    {
                      "position": "8",
                      "word": "keyword"
                    }
                  ],
                  "words": ["keyword"]
                },
                {
                  "listId": "d75d056d88702cbf6198e2aa82eb0fdc",
                  "matchedFiled": ["text"],
                  "name": "Political: State institution: Military",
                  "organization": "GLOBAL",
                  "wordPositions": [
                    {
                      "position": "13,14,15",
                      "word": "sensitive_term"
                    }
                  ],
                  "words": ["sensitive_term"]
                }
              ],
              "matchedItem": "keyword",
              "matchedList": "Original text list",
              "model": "MA000007020001001",
              "riskLevel": "REJECT",
              "riskType": 300,
              "type": "text"
            }
          ],
          "riskHtml": "...",
          "riskSummary": {
            "300": 1
          }
        },
        "message": "Success",
        "requestId": "tye7ert12asdfasdf31236633346662333312",
        "riskLevel": "REJECT",
        "score": 700,
        "auxInfo": {
          "textNum": "100",
          "imgNum": "10"
        }
      },
      "mergeResult": {
        "riskLevel": "REJECT"
      }
    }
  ]
}