POST
/
v1
/
text-moderation
/
{scanId}
/
check
curl --request POST \
  --url https://api.copyleaks.com/v1/text-moderation/my-scan-123/check \
  --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "text": "Your text content to be moderated goes here.",
    "sandbox": true,
    "language": "en",
    "labels": [
      { "id": "toxic-v1" },
      { "id": "profanity-v1" },
      { "id": "hate-speech-v1" }
    ]
  }'
{
  "modelVersion": "v1",
  "moderations": {
    "text": {
      "chars": {
        "labels": [4, 4, 4, 2, 7, 6],
        "starts": [15, 73, 138, 287, 407, 446],
        "lengths": [4, 4, 4, 14, 12, 24]
      }
    }
  },
  "scannedDocument": {
    "scanId": "scan-id",
    "totalWords": 86,
    "actualCredits": 1,
    "expectedCredits": 1,
    "creationTime": "2025-08-06T08:05:20.6787519Z"
  }
}
curl --request POST \
  --url https://api.copyleaks.com/v1/text-moderation/my-scan-123/check \
  --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "text": "Your text content to be moderated goes here.",
    "sandbox": true,
    "language": "en",
    "labels": [
      { "id": "toxic-v1" },
      { "id": "profanity-v1" },
      { "id": "hate-speech-v1" }
    ]
  }'
{
  "modelVersion": "v1",
  "moderations": {
    "text": {
      "chars": {
        "labels": [4, 4, 4, 2, 7, 6],
        "starts": [15, 73, 138, 287, 407, 446],
        "lengths": [4, 4, 4, 14, 12, 24]
      }
    }
  },
  "scannedDocument": {
    "scanId": "scan-id",
    "totalWords": 86,
    "actualCredits": 1,
    "expectedCredits": 1,
    "creationTime": "2025-08-06T08:05:20.6787519Z"
  }
}
The Copyleaks Text Moderation API provides real-time content moderation capabilities to help you maintain safe and appropriate content across your platform. This API automatically scans and flags potentially harmful content across multiple categories, enabling you to take appropriate action to protect your users and maintain community standards.
Authentication Required. You need to login with a user and API key in order to access this method. Add this HTTP header to your request:Authorization: Bearer <Your-Login-Token>

Request

Path Parameters

scanId
string
required
A unique scan id provided by you. We recommend you use the same id in your database to represent the scan in the Copyleaks database. Learn more about the criteria for creating a Scan ID.>= 3 characters <= 36 characters

Headers

Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN

Request Body

The request body is a JSON object containing the text to scan.
text
string
required
Text to produce Text Moderation report for.>= 1 characters <= 25000 characters
sandbox
boolean
default:"false"
Use sandbox mode to test your integration with the Copyleaks API without consuming any credits.
language
string
The language code of your content. If the language field is not specified, our system will automatically detect the language of the content.Example: "en"
labels
array[object]
A list of label configurations to be used for the moderation process.

Responses

200 OK - The moderation report was returned successfully.
{
  "modelVersion": "v1",
  "moderations": { "text": { "chars": { "labels": [4], "starts": [15], "lengths": [4] } } },
  "scannedDocument": {
    "scanId": "scan-id",
    "totalWords": 86,
    "creationTime": "2025-08-06T08:05:20.6787519Z"
  }
}