POST
/
text
curl --request POST \
  --url https://api.contentmod.io/text \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "This is a very cool api",
  "options": {
    "meta": {},
    "callbackUrl": "<string>",
    "defer": true,
    "actorId": "<string>",
    "bannedWords": [
      "<string>"
    ]
  }
}'
{
  "id": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
  "isSafe": true,
  "confidence": 90,
  "sentiment": "positive",
  "sentimentScore": 90,
  "riskScores": {
    "overall": 90,
    "spam": 90,
    "toxicity": 90
  },
  "topics": [
    "politics",
    "sports"
  ],
  "nsfwCategories": [
    {
      "category": "sexual",
      "severity": 90
    }
  ],
  "summary": {
    "profanity": true,
    "totalFlags": 1,
    "contentRating": "G",
    "language": "en"
  },
  "suggestedActions": {
    "reject": true,
    "review": true
  },
  "filteredContent": "This is a filtered text",
  "content": "This is the original text",
  "request": {
    "requestId": "27fbdc0b-b295-46ce-93f5-81b2fc08a381",
    "timestamp": "2023-04-05T12:00:00.000Z"
  },
  "meta": "<any>",
  "hash": "93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
The text to moderate
text
string
required
Minimum length: 1
Example:

"This is a very cool api"

options
object

Response

200
application/json
Response of the moderated text
id
string
required

The id of the text moderation

Example:

"27fbdc0b-b295-46ce-93f5-81b2fc08a381"

isSafe
boolean
required

Whether the text is considered safe

Example:

true

confidence
number
required

Confidence of the safety of the text from 1-100

Example:

90

sentiment
enum<string>
required

Sentiment of the text, either negative, neutral or positive

Available options:
positive,
negative,
neutral
Example:

"positive"

sentimentScore
number
required

Sentiment score from 1-100 (negative, neutral, positive)

Example:

90

riskScores
object
required
topics
string[]
required

General topics the text depicts, lowercase and no punctuation

Example:
["politics", "sports"]
nsfwCategories
object[]
required
Example:
[{ "category": "sexual", "severity": 90 }]
summary
object
required
suggestedActions
object
required
filteredContent
string
required

The text with profanity replaced by *.

Example:

"This is a filtered text"

content
string
required

The original text

Example:

"This is the original text"

request
object
required
hash
string
required

SHA-256 hash of the text

Example:

"93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa"

meta
any | null

The metadata of the request