POST
/
moderate
/
text
curl -X POST 'https://moderationapi.com/api/v1/moderate/text' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "value": "Hello world",
    "contentId": "post-123",
    "authorId": "user-123",
    "contextId": "room-123",
    "metadata": {
      "source": "chat"
    }
  }'
{
    "status": "success",
    "contentId": "5f9b3b4b-5b0a-4b5a-8b0a-4b5a8b0a4b5a",
    "request": {
        "timestamp": 1699344668022,
        "quota_usage": 1,
    },
    "content_moderated": false,
    "data_found": false,
    "flagged": true,
    "unicode_spoofing": false,
    "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
        }
    }
}
curl -X POST 'https://moderationapi.com/api/v1/moderate/text' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "value": "Hello world",
    "contentId": "post-123",
    "authorId": "user-123",
    "contextId": "room-123",
    "metadata": {
      "source": "chat"
    }
  }'
{
    "status": "success",
    "contentId": "5f9b3b4b-5b0a-4b5a-8b0a-4b5a8b0a4b5a",
    "request": {
        "timestamp": 1699344668022,
        "quota_usage": 1,
    },
    "content_moderated": false,
    "data_found": false,
    "flagged": true,
    "unicode_spoofing": false,
    "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
header
required

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

Body

application/json

Input parameters for text moderation

Response

200
application/json
Successful response

Moderation analysis results including model outputs and detected patterns