Sync API (Bulk Images)

Submit multiple images in a single synchronous request for content moderation to detect regulatory risks and business content.

The Image Moderation API detects risks such as political sensitivity, pornography, advertising, and terrorism in images. It also identifies faces, logos, animals, plants, and other content based on your business scenarios.

API Description

Submit multiple images in a single synchronous request for content moderation to detect regulatory risks and business-specific content.

Requirements

ItemSpecification
ProtocolHTTP or HTTPS
MethodPOST
EncodingUTF-8
FormatAll request and response parameters use JSON

Request

Request Parameters

data Object Parameters

ParameterTypeRequiredMax LengthDescription
imgsarrayYesArray of image objects to be moderated. Each element contains btId (string, required, unique image identifier) and img (string, required, base64-encoded image or URL).
tokenIdstringYes64User account identifier. Recommended to pass the user ID for behavioral risk detection (spam, advertising, etc.).
deviceIdstringNo128ISHUMEI device fingerprint identifier, generated by the ISHUMEI SDK for user behavior analysis.
genderstringNoUser gender. male, female, or ambiguity (unknown).
intervalint32NoAnimated image frame capture frequency. Default: 1 (capture every frame). When interval × maxFrame is less than the total frame count, the interval is automatically adjusted to total_frames / maxFrame for better detection coverage.
ipstringNo64Client public IP address for IP-based user behavior analysis.
langstringNoLanguage type for text content detection in images. Default: zh. zh: Chinese, en: English, ar: Arabic, auto: automatic language detection (requires BOCR type, Singapore and Silicon Valley clusters only).
levelint32NoUser level for configuring different interception strategies. See User Levels.
maxFrameint32NoMaximum number of frames to capture from animated images (GIF, etc.). Max: 20 frames, default: 3 frames. Billing is based on the actual number of captured frames.
nicknamestringNoUser nickname. Max 150 characters (truncated if exceeded).
receiveTokenIdstringNo64Message receiver's tokenId. Alphanumeric with underscores and hyphens, up to 64 characters.
extraobjectNoAuxiliary parameters.
extra.isTokenSeparateint32NoWhether to separate accounts across different applications. 0 (default): do not separate. 1: separate (account strategies are independent per application).
extra.roomstringNo64Live room / game room ID. Different strategies can be applied per room.
passThroughobjectNo1024Client pass-through field. ISHUMEI does not process this field; it is returned as-is with the result.
acceptLangstringNoLanguage for returned labels. zh (default): Chinese. en: English.

User Levels

ValueDescription
0Lowest-level user (e.g., newly registered, completely inactive, or level-0 users)
1Lower-level user (e.g., low activity or low-level users)
2Mid-level user (e.g., moderately active or mid-level users)
3Higher-level user (e.g., highly active or high-level users)
4Highest-level user (e.g., paying users, VIP users)

Response

Response Parameters

ℹ️

Parameters other than code, message, and requestId are only guaranteed to be returned when code is 1100.

ParameterTypeRequiredDescription
requestIdstringYesUnique ISHUMEI request identifier.
codeint32YesResponse code. See Response Codes.
messagestringYesResponse message corresponding to the code.
imgsarrayYesArray of per-image moderation results. See imgs Array.
auxInfoobjectNoAuxiliary information.
auxInfo.passThroughobjectNoClient pass-through field returned as-is.

Response Codes

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

imgs Array

Each element represents the moderation result for one image:

ParameterTypeRequiredDescription
btIdstringYesClient-side unique image identifier.
requestIdstringYesUnique ISHUMEI request identifier for this image.
codeint32YesResponse code for this image. See Response Codes.
messagestringYesResponse message.
riskLevelstringYesRisk level. PASS: normal, REVIEW: suspicious, REJECT: violation.
riskLabel1stringYesLevel 1 risk label. Returns normal when riskLevel is PASS.
riskLabel2stringYesLevel 2 risk label. Empty when riskLevel is PASS.
riskLabel3stringYesLevel 3 risk label. Empty when riskLevel is PASS.
riskDescriptionstringYesRisk description. Returns "Normal" when riskLevel is PASS. Format: "Level 1: Level 2: Level 3". For reference only — do not use for programmatic logic.
resultTypeint32YesCurrent result type. 0: machine moderation. 1: human moderation.
finalResultint32YesWhether this is the final result. 0: not final (human review pending). 1: final result (can be used directly). Defaults to 1 if only machine moderation is configured.
allLabelsarrayYesAll risk labels. See allLabels Array.
riskDetailobjectYesRisk detail information. See riskDetail Object.
auxInfoobjectYesAuxiliary information. See Image auxInfo.
businessLabelsarrayNoBusiness label list. See businessLabels Array.
tokenLabelsobjectYesAccount label information. Returned only when tokenId is provided and the service is enabled. See tokenLabels Object.
disposalobjectNoCustom disposition and mapping result. Returned only when a custom label system is configured. See disposal Object.
tokenProfileLabelsarrayNoAccount attribute labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.
tokenRiskLabelsarrayNoAccount risk labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.

allLabels Array

Each element in the array:

ParameterTypeRequiredDescription
riskLevelstringNoRisk level: PASS, REVIEW, or REJECT.
riskLabel1stringNoLevel 1 risk label.
riskLabel2stringNoLevel 2 risk label.
riskLabel3stringNoLevel 3 risk label.
riskDescriptionstringNoRisk description. For reference only — do not use for programmatic logic.
probabilityfloatNoConfidence score (0–1). Higher values indicate greater confidence.
riskDetailobjectNoRisk detail information. See riskDetail Object.

riskDetail Object

ParameterTypeRequiredDescription
riskSourceint32YesRisk source: 1000 (no risk), 1001 (text risk), 1002 (visual image risk).
face_numint32NoNumber of faces detected.
person_numint32NoNumber of persons detected.
facesarrayNoNames and positions of politically sensitive individuals. Up to 10 entries (highest probability selected if more than 10). See Face Object.
objectsarrayNoDetected objects/logos with names and positions. See Object Info.
ocrTextobjectNoOCR text content. Present when type includes IMGTEXTRISK or ADVERT. Contains text (string): recognized text.
matchedListsarrayNoMatched custom list information. Returned only when a custom list is hit. See Matched Lists.
riskSegmentsarrayNoHigh-risk content segments. Present when political, terrorism, prohibited, competitive, or advertising law content is detected. See Risk Segments.
personsarrayNoPerson names and positions. Up to 10 entries (highest probability selected). See Person Object.

Face Object

ParameterTypeRequiredDescription
idstringNoIdentifier. The same person at the same position has the same ID across different labels. If the same person appears N times, N IDs are assigned.
namestringNoPerson name.
face_ratiofloatNoFace-to-image ratio (0–1).
probabilityfloatNoConfidence score (0–1).
locationarrayNoFace position coordinates [x1, y1, x2, y2] representing top-left and bottom-right corners.

Object Info

ParameterTypeRequiredDescription
idstringNoObject/logo identifier.
namestringNoObject name.
probabilityfloatNoConfidence score (0–1).
qrContentstringNoQR code URL detected in the image.
locationarrayNoObject position coordinates [x1, y1, x2, y2].

Matched Lists

ParameterTypeRequiredDescription
namestringNoName of the matched list.
wordsarrayNoSensitive word details.
words[].wordstringNoThe matched sensitive word.
words[].positionarrayNoPosition of the sensitive word.

Risk Segments

ParameterTypeRequiredDescription
segmentstringNoHigh-risk content segment.
positionarrayNoPosition of the segment (0-indexed).

Person Object

ParameterTypeRequiredDescription
idstringNoIdentifier. The same person has the same ID across different labels.
person_ratiofloatNoPerson-to-image ratio (0–1).
probabilityfloatNoConfidence score (0–1).
locationarrayNoPerson position coordinates.

Image auxInfo

ParameterTypeRequiredDescription
segmentsint32YesNumber of segments actually processed.
downloadTimeintegerNoImage download time in milliseconds.
qrContentstringNoQR code URL detected in the image.
totalProcessTimeintegerNoTotal image processing time in milliseconds.

businessLabels Array

Each element in the array:

ParameterTypeRequiredDescription
businessLabel1stringYesLevel 1 business label.
businessLabel2stringYesLevel 2 business label.
businessLabel3stringYesLevel 3 business label.
businessDescriptionstringYesBusiness label description. Format: "Level 1: Level 2: Level 3".
probabilityfloatYesConfidence score (0–1).
confidenceLevelint32NoConfidence level (0–2). Higher values indicate greater confidence.
businessDetailobjectNoBusiness label details. May contain face_compare_num, face_num, face_ratio, name, person_num, person_ratio, probability, faces, objects, persons, and location with the same structure as riskDetail.

tokenLabels Object

Returned only when tokenId is provided and the service is enabled with ISHUMEI.

ParameterTypeRequiredDescription
UGC_account_riskobjectNoUGC content risk.
UGC_account_risk.b_advertise_risk_tokenidint32NoAdvertising risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_advertise_risk_tokenid_last_tsint32NoAdvertising risk timestamp.
UGC_account_risk.b_politics_risk_tokenidint32NoPolitical risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_politics_risk_tokenid_last_tsint32NoPolitical risk timestamp.
UGC_account_risk.b_sexy_risk_tokenidint32NoPornographic risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_sexy_risk_tokenid_last_tsint32NoPornographic risk timestamp.
machine_account_riskobjectNoMachine control risk.
machine_account_risk.b_machine_control_tokenidint32NoMachine-controlled account. 0: not machine-controlled. 1: machine-controlled.
machine_account_risk.b_machine_control_tokenid_last_tsint32NoMachine control timestamp.
machine_account_risk.b_offer_wall_tokenidint32NoOffer wall account. 0: not an offer wall account. 1: offer wall account.
machine_account_risk.b_offer_wall_tokenid_last_tsint32NoOffer wall timestamp.
scene_account_riskobjectNoScene-specific account risk (available for special scenarios such as airlines).
scene_account_risk.i_tout_risk_tokenidint32NoAirline seat-holding account. 0: not a seat-holding account. 1: seat-holding account.
scene_account_risk.i_tout_risk_tokenid_last_tsint32NoSeat-holding timestamp.

disposal Object

Returned only when a custom label system is configured with ISHUMEI. For the batch image async API, enabling the disposal mapping feature changes the callback from a single aggregate callback to per-image callbacks.

ParameterTypeRequiredDescription
riskLevelstringYesMapped disposition recommendation. Returns default recommendation if labels are not mapped.
riskLabel1stringYesMapped level 1 risk label. Returns normal when unmapped or when riskLevel is PASS.
riskLabel2stringYesMapped level 2 risk label. Empty when unmapped or when riskLevel is PASS.
riskLabel3stringYesMapped level 3 risk label. Empty when unmapped or when riskLevel is PASS.
riskDescriptionstringYesMapped risk description. Returns "Normal" when riskLevel is PASS.
riskDetailobjectYesMapped risk detail. Same structure as riskDetail Object.

Token Labels

Both tokenProfileLabels and tokenRiskLabels share the same structure:

ParameterTypeRequiredDescription
label1stringNoLevel 1 label.
label2stringNoLevel 2 label.
label3stringNoLevel 3 label.
descriptionstringNoLabel description.
timestampint32NoLabel timestamp. 13-digit Unix timestamp in milliseconds.

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "appId": "default",
  "eventId": "default",
  "type": "POLITY_EROTIC_VIOLENT",
  "data": {
    "imgs": [
      {
        "btId": "123",
        "img": "http://example.com/image1.jpg"
      },
      {
        "btId": "456",
        "img": "http://example.com/image2.jpg"
      }
    ],
    "tokenId": "username123"
  }
}

Response Example

{
  "auxInfo": {},
  "code": 1100,
  "message": "Success",
  "requestId": "faf10b672ddae5e5e51ea719c44ca94b",
  "imgs": [
    {
      "btId": "123",
      "code": 1100,
      "message": "Success",
      "requestId": "faf10b672ddae5e5e51ea719c44ca94b_123",
      "finalResult": 1,
      "resultType": 0,
      "riskLevel": "REJECT",
      "riskLabel1": "violence",
      "riskLabel2": "baokongchangjing",
      "riskLabel3": "xuexing",
      "riskDescription": "Violence: Violence scene: Bloody",
      "riskDetail": {
        "ocrText": {
          "text": "Sample OCR text"
        },
        "riskSource": 1002
      },
      "allLabels": [
        {
          "probability": 0.922851562500734,
          "riskDescription": "Violence: Violence scene: Bloody",
          "riskDetail": {
            "ocrText": {
              "text": "Sample OCR text"
            },
            "riskSource": 1002
          },
          "riskLabel1": "violence",
          "riskLabel2": "baokongchangjing",
          "riskLabel3": "xuexing",
          "riskLevel": "REJECT"
        }
      ],
      "auxInfo": {
        "segments": 1
      },
      "businessLabels": [
        {
          "businessDescription": "Face: Gender: Male",
          "businessDetail": {
            "face_ratio": 0.00106996833346784,
            "faces": [
              {
                "face_ratio": 0.00106996833346784,
                "id": "35da33429897372017bb7ad7c7302693",
                "location": [228, 588, 256, 622],
                "name": "",
                "probability": 0.967536687850952
              }
            ]
          },
          "businessLabel1": "face",
          "businessLabel2": "gender",
          "businessLabel3": "male",
          "confidenceLevel": 2,
          "probability": 0.967536687850952
        },
        {
          "businessDescription": "Face: Face type: Real person",
          "businessDetail": {
            "face_num": 1,
            "face_ratio": 0.00106996833346784,
            "faces": [
              {
                "face_ratio": 0.00106996833346784,
                "id": "35da33429897372017bb7ad7c7302693",
                "location": [228, 588, 256, 622],
                "name": "Example Person",
                "probability": 0.541935835649002
              }
            ]
          },
          "businessLabel1": "face",
          "businessLabel2": "renlianleixing",
          "businessLabel3": "zhenren",
          "confidenceLevel": 2,
          "probability": 0.996093758527634
        }
      ],
      "tokenLabels": {
        "UGC_account_risk": {}
      }
    },
    {
      "btId": "456",
      "code": 1100,
      "message": "Success",
      "requestId": "faf10b672ddae5e5e51ea719c44ca94b_456",
      "riskLevel": "PASS",
      "riskLabel1": "normal",
      "riskLabel2": "",
      "riskLabel3": "",
      "riskDescription": "Normal",
      "riskDetail": {
        "riskSource": 1000
      },
      "allLabels": [],
      "tokenLabels": {
        "UGC_account_risk": {}
      }
    }
  ]
}