Submit text for moderation to detect policy, safety, fraud, privacy, and prompt attack risks.
Submit text for moderation to detect policy, safety, fraud, privacy, and prompt attack risks.
Requirements
Item
Specification
Encoding
UTF-8
Method
POST
Recommended timeout
1s
Request
Request URL
Cluster
Request URL
USA (Virginia)
http://api-text-fjny.fengkongcloud.com/text/v4
Singapore
http://api-text-xjp.fengkongcloud.com/text/v4
Request Parameters
Parameter
Type
Required
Description
accessKey
string
Yes
API authentication key. The default accessKey is sent in your onboarding email.
appId
string
Yes
Application identifier, such as web for your web application or app for your mobile app. The default appId is sent in your onboarding email. Contact DeepCleer if you need a new appId.
eventId
string
Yes
Event identifier used to distinguish moderation scenarios in your application, such as prompt for user prompts or modelOutput for LLM output. The default eventId is sent in your onboarding email. Contact DeepCleer if you need a new eventId.
type
string
Yes
Risk detection types. Detailed type refers to Detection Types. The type field accepts multiple detection categories joined with underscores — for example, set type to BAN_EROTIC to moderate for prohibited and pornographic content in a single call. TEXTRISK is a bundled general-risk check that covers POLITY, VIOLENT, BAN, EROTIC, DIRTY, ADVERT, PRIVACY, ADLAW, and MEANINGLESS. When TEXTRISK is combined with any of these individual categories, the result is their union — so TEXTRISK_POLITY behaves the same as TEXTRISK alone, because POLITY is already included.
Enables online translation of the input before it is moderated. When set, the service translates text (and nickname / relateText if provided) into the target language and applies all policy checks to the translated output. Supported values: en (English). Contact DeepCleer to enable this feature.
acceptLang
string
Yes
Language for returned labels. Set en by default.
callback
string
No
Callback HTTP URL. When provided, DeepCleer posts the moderation result to this endpoint as soon as it becomes available.
Detection Types
Value
Description
POLITY
Political content
VIOLENT
Violence and terrorism
BAN
Prohibited content
EROTIC
Sexual or pornographic content
DIRTY
Profanity and abusive language
ADVERT
General advertising
PRIVACY
Personally identifiable information
ADLAW
Advertising law violations
MEANINGLESS
Meaningless or junk text
FRAUD
Online fraud and scams
UNPOACH
High-value user poaching attempts
TEXTMINOR
Content involving minors
PROMPTATTACK
Prompt injection and instruction-override attacks
PUBLICFIGURE
Public-figure recognition
data Object
Parameter
Type
Required
Description
text
string
Yes
The text to moderate. Up to 10,000 characters per request; longer inputs are rejected with an error. If relateText or nickname is also set, all three fields are moderated together in the same request.
relateText
string
No
Related context text moderated alongside text — for example, the parent comment when moderating a reply. Up to 128 characters; longer values are truncated.
tokenId
string
Yes
Stable identifier for the end user, typically your internal user UID (an encrypted UID is fine). Used for behavioral-risk signals such as spam and repeat-offender detection. Alphanumeric with underscores and hyphens, up to 64 characters.
lang
string
Yes
Language of the text. Pass en by default. For international traffic when the language is combined, pass auto to enable automatic language detection. See Supported Languages.
nickname
string
No
The end user's display name, moderated alongside text. Up to 150 characters; longer values are truncated.
ip
string
No
Public IP address of the user who submitted the text. Accepts IPv4 or IPv6.
deviceId
string
No
Device-fingerprint identifier issued by DeepCleer.
dataId
string
No
Client-side identifier attached to the moderation call. DeepCleer echoes it back with the result, letting you correlate your source record (a post ID, message ID, review ID, etc.) with the moderation verdict — typically used to look up historical decisions in your own database or in the DeepCleer console.
tokenId of the message recipient in a one-to-one chat. Alphanumeric with underscores and hyphens, up to 64 characters. Required when eventId is message.
topic
string
No
Identifier for the conversation container — for example, a forum thread, blog post, or book-review section. Strongly recommended when eventId is article; without it, context-aware moderation cannot be applied.
atId
string
No
tokenId of the @‑mentioned user in a group-chat message. Alphanumeric with underscores and hyphens, up to 64 characters. Required when eventId is groupChat.
room
string
No
Live-room or game-room ID. Strongly recommended when eventId is groupChat; without it, context-aware moderation cannot be applied.
sex
int
No
User's gender. 0 male, 1 female, 2 unknown.
passThrough
json
No
Arbitrary pass-through data. The value is echoed back verbatim in the response, unchanged.
Supported Languages
Value
Language
en
English
zh
Chinese
ar
Arabic
hi
Hindi
es
Spanish
fr
French
ru
Russian
pt
Portuguese
id
Indonesian
de
German
ja
Japanese
tr
Turkish
vi
Vietnamese
it
Italian
th
Thai
tl
Filipino
ko
Korean
ms
Malay
Response
Response Parameters
ℹ️
Parameters other than code, message, and requestId are only guaranteed to be returned when code is 1100.
Unique identifier for this request. We strongly recommend logging it on your side — it's the key piece of information DeepCleer needs to help you investigate a specific moderation decision or tune your integration.
riskLevel
string
Yes
Disposition recommendation. PASS — content is clean; allow it. REVIEW — content is suspicious; better to route to human review. REJECT — content violates policy; block it.
riskLabel1
string
Yes
Level-1 risk label. Returns normal when riskLevel is PASS; otherwise returns a violation tag such as POLITY, Erotic.
riskLabel2
string
Yes
Level-2 risk label. Returns normal when riskLevel is PASS; otherwise returns a violation tag.
riskLabel3
string
Yes
Level-3 risk label. Returns normal when riskLevel is PASS; otherwise returns a violation tag.
riskDescription
string
Yes
Human-readable summary of the detected risk, formed by concatenating the three riskLabel levels (for example, Advertising: Contact information). Returns Normal when riskLevel is PASS.
Whether this is the final result. 1: final result (can be used directly for downstream processing). 0: intermediate result (machine moderation; human review will follow).
resultType
int
Yes
Current result stage. 0: machine moderation. 1: human moderation.
Response Codes
Code
Message
1100
Success
1901
QPS limit exceeded
1902
Invalid parameters
1903
Service failure
1905
Character count exceeded
9101
Unauthorized operation
riskDetail Object
Parameter
Type
Required
Description
matchedLists
json_array
No
Custom keyword lists that were triggered by this call. Each entry names a list you've configured in the DeepCleer console and enumerates the specific terms from that list that matched the input. Returned only when at least one configured keyword appears in text.
matchedLists[].name
string
No
Name of the triggered list, as configured in the DeepCleer console.
matchedLists[].words
json_array
No
The matched term, as it appeared on the list.
matchedLists[].words[].word
string
No
The matched term, as it appeared on the list.
matchedLists[].words[].position
int_array
No
Character offsets [start, end] of the match in the input text. Zero-indexed; end is exclusive.
riskSegments
json_array
No
Contiguous spans of the input judged to be high-risk. Returned when political, terrorism, prohibited, or advertising-law content is detected.
riskSegments[].segment
string
No
The high-risk span, extracted verbatim from the input.
riskSegments[].position
int_array
No
Character offsets [start, end] of the span in the input text. Zero-indexed; end is exclusive.
auxInfo Object
Parameter
Type
Required
Description
filteredText
string
No
Text with risky segments replaced by asterisks (*).
passThrough
json_object
No
Pass-through field. Same value as data.extra.passThrough in the request.
contactResult
json_array
No
Contact information detection results, including WeChat, QQ, and phone numbers.