POST
/
moderate
/
text
curl --request POST \
  --url https://moderationapi.com/api/v1/moderate/text \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "authorId": "<string>",
  "contextId": "<string>",
  "doNotStore": true,
  "metadata": {},
  "value": "<string>"
}'
{
    "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
authorId
string

The author of the content.

contextId
string

For example the ID of a chat room or a post

doNotStore
boolean

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

metadata
object

Any metadata you want to store with the content

value
string
required

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

Response

200 - application/json
address
object

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

content
string
required

The content after moderation. With all mask replacements applied.

contentId
string

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

content_moderated
boolean
required

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

data_found
boolean
required

Whether any entity matchers found data for the content

email
object

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

flagged
boolean
required

Whether the content was flagged by any models

name
object

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

nsfw
object

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

original
string
required

The original content

phone
object

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

profanity
object

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

propriety
object

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

quality
object

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

request
object
required

Information about the request

sensitive
object

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

sentiment
object

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

status
string
required

Success if the request was successful

toxicity
object

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

url
object

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

username
object

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

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?