POST
/
moderate
/
text
curl --request POST \
  --url https://moderationapi.com/api/v1/moderate/text \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": "<string>",
  "doNotStore": true,
  "authorId": "<string>",
  "contextId": "<string>",
  "metadata": {}
}'
{
    "status": "success",
    "contentId": "5f9b3b4b-5b0a-4b5a-8b0a-4b5a8b0a4b5a",
    "request": {
        "timestamp": 1699344668022,
        "quota_usage": 1,
    },
    "content_moderated": false,
    "data_found": false,
    "flagged": true,
    "original": "How do I make a bomb?",
    "content": "How do I make a bomb?",
    "nsfw": {
        "label": "UNSAFE",
        "score": 0.805338,
        "label_scores": {
            "SENSITIVE": 0.194355,
            "UNSAFE": 0.805338,
            "NEUTRAL": 0.000283
        }
    },
    "toxicity": {
        "label": "NEUTRAL",
        "score": 0.55814815,
        "label_scores": {
            "TOXICITY": 0.44185185,
            "PROFANITY": 0.09775851,
            "DISCRIMINATION": 0.017465452,
            "SEVERE_TOXICITY": 0.023076924,
            "INSULT": 0.023028618,
            "THREAT": 0.44185185,
            "NEUTRAL": 0.55814815
        }
    }

}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
value
string
required

The text you'd like to analyze. We recommend to submit plain text or HTML

doNotStore
boolean

Do not store the content. The content won't enter the review queue

authorId
string

The author of the content.

contextId
string

For example the ID of a chat room or a post

metadata
object

Any metadata you want to store with the content

Response

200 - application/json
status
string
required

Success if the request was successful

contentId
string

The ID of the content. Only returned if the content was stored.

request
object
required

Information about the request

content_moderated
boolean
required

Whether the content was moderated or not. Same as content !== original

unicode_spoofing
boolean
required

Whether the content is using look-alike characters. Often used by spammers.

data_found
boolean
required

Whether any entity matchers found data for the content

flagged
boolean
required

Whether the content was flagged by any models

original
string
required

The original content

content
string
required

The content after moderation. With all mask replacements applied and look-alike characters replaced with the original characters.

nsfw
object

The NSFW model output if enabled in your project. Read more at https://docs.moderationapi.com/models/nsfw

toxicity
object

The toxicity model output if enabled in your project. Read more at https://docs.moderationapi.com/models/toxicity

quality
object

The spam model output if enabled in your project. Read more at https://docs.moderationapi.com/models/spam

sentiment
object

The sentiment model output if enabled in your project. Read more at https://docs.moderationapi.com/models/sentiment

propriety
object

The propriety model output if enabled in your project. Read more at https://docs.moderationapi.com/models/propriety

email
object

The email entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/email

phone
object

The phone entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/phone

url
object

The url entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/url

address
object

The address entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/address

name
object

The name entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/name

username
object

The username entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/username

profanity
object

The profanity entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/profanity

sensitive
object

The sensitive numbers entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/sensitive

wordlist
object

The wordlist entity matcher output if enabled in your project. Read more at https://docs.moderationapi.com/models/word

Was this page helpful?