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" }
]
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.TextModeration.Requests.CopyleaksTextModerationRequestModel import CopyleaksTextModerationRequestModel
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = CopyleaksTextModerationRequestModel(
text="Your text content to be moderated goes here.",
sandbox=True,
language="en",
labels=[
{"id": "toxic-v1"},
{"id": "profanity-v1"},
{"id": "hate-speech-v1"},
],
)
response = Copyleaks.TextModerationClient.submit_text(auth_token, "my-scan-123", submission)
print(response)
const { Copyleaks, CopyleaksTextModerationRequestModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksTextModerationRequestModel({
text: 'Your text content to be moderated goes here.',
sandbox: true,
language: 'en',
labels: [
{ id: 'toxic-v1' },
{ id: 'profanity-v1' },
{ id: 'hate-speech-v1' },
],
});
const response = await copyleaks.textModerationClient.submitTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.request.TextModeration.CopyleaksTextModerationRequest;
import models.request.TextModeration.CopyleaksTextModerationLabel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksTextModerationRequest req = new CopyleaksTextModerationRequest(
"Your text content to be moderated goes here.",
true,
"en",
new CopyleaksTextModerationLabel[] {
new CopyleaksTextModerationLabel("toxic-v1"),
new CopyleaksTextModerationLabel("profanity-v1"),
new CopyleaksTextModerationLabel("hate-speech-v1"),
}
);
Copyleaks.textModerationClient.submitText(authToken, "my-scan-123", req);
{
"modelVersion": "v1",
"moderations": {
"text": {
"chars": {
"labels": [1, 1, 1, 0, 2, 2],
"starts": [15, 73, 138, 287, 407, 446],
"lengths": [4, 4, 4, 14, 12, 24]
}
}
},
"legend": [
{ "index": 0, "id": "toxic-v1" },
{ "index": 1, "id": "profanity-v1" },
{ "index": 2, "id": "hate-speech-v1" }
],
"scannedDocument": {
"scanId": "scan-id",
"totalWords": 86,
"actualCredits": 1,
"expectedCredits": 1,
"creationTime": "2025-08-06T08:05:20.6787519Z"
}
}
Text Moderation
Moderate Text
Instantly flag hateful, explicit, toxic, or otherwise risky content in any text.
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" }
]
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.TextModeration.Requests.CopyleaksTextModerationRequestModel import CopyleaksTextModerationRequestModel
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = CopyleaksTextModerationRequestModel(
text="Your text content to be moderated goes here.",
sandbox=True,
language="en",
labels=[
{"id": "toxic-v1"},
{"id": "profanity-v1"},
{"id": "hate-speech-v1"},
],
)
response = Copyleaks.TextModerationClient.submit_text(auth_token, "my-scan-123", submission)
print(response)
const { Copyleaks, CopyleaksTextModerationRequestModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksTextModerationRequestModel({
text: 'Your text content to be moderated goes here.',
sandbox: true,
language: 'en',
labels: [
{ id: 'toxic-v1' },
{ id: 'profanity-v1' },
{ id: 'hate-speech-v1' },
],
});
const response = await copyleaks.textModerationClient.submitTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.request.TextModeration.CopyleaksTextModerationRequest;
import models.request.TextModeration.CopyleaksTextModerationLabel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksTextModerationRequest req = new CopyleaksTextModerationRequest(
"Your text content to be moderated goes here.",
true,
"en",
new CopyleaksTextModerationLabel[] {
new CopyleaksTextModerationLabel("toxic-v1"),
new CopyleaksTextModerationLabel("profanity-v1"),
new CopyleaksTextModerationLabel("hate-speech-v1"),
}
);
Copyleaks.textModerationClient.submitText(authToken, "my-scan-123", req);
{
"modelVersion": "v1",
"moderations": {
"text": {
"chars": {
"labels": [1, 1, 1, 0, 2, 2],
"starts": [15, 73, 138, 287, 407, 446],
"lengths": [4, 4, 4, 14, 12, 24]
}
}
},
"legend": [
{ "index": 0, "id": "toxic-v1" },
{ "index": 1, "id": "profanity-v1" },
{ "index": 2, "id": "hate-speech-v1" }
],
"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" }
]
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.TextModeration.Requests.CopyleaksTextModerationRequestModel import CopyleaksTextModerationRequestModel
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = CopyleaksTextModerationRequestModel(
text="Your text content to be moderated goes here.",
sandbox=True,
language="en",
labels=[
{"id": "toxic-v1"},
{"id": "profanity-v1"},
{"id": "hate-speech-v1"},
],
)
response = Copyleaks.TextModerationClient.submit_text(auth_token, "my-scan-123", submission)
print(response)
const { Copyleaks, CopyleaksTextModerationRequestModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksTextModerationRequestModel({
text: 'Your text content to be moderated goes here.',
sandbox: true,
language: 'en',
labels: [
{ id: 'toxic-v1' },
{ id: 'profanity-v1' },
{ id: 'hate-speech-v1' },
],
});
const response = await copyleaks.textModerationClient.submitTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.request.TextModeration.CopyleaksTextModerationRequest;
import models.request.TextModeration.CopyleaksTextModerationLabel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksTextModerationRequest req = new CopyleaksTextModerationRequest(
"Your text content to be moderated goes here.",
true,
"en",
new CopyleaksTextModerationLabel[] {
new CopyleaksTextModerationLabel("toxic-v1"),
new CopyleaksTextModerationLabel("profanity-v1"),
new CopyleaksTextModerationLabel("hate-speech-v1"),
}
);
Copyleaks.textModerationClient.submitText(authToken, "my-scan-123", req);
{
"modelVersion": "v1",
"moderations": {
"text": {
"chars": {
"labels": [1, 1, 1, 0, 2, 2],
"starts": [15, 73, 138, 287, 407, 446],
"lengths": [4, 4, 4, 14, 12, 24]
}
}
},
"legend": [
{ "index": 0, "id": "toxic-v1" },
{ "index": 1, "id": "profanity-v1" },
{ "index": 2, "id": "hate-speech-v1" }
],
"scannedDocument": {
"scanId": "scan-id",
"totalWords": 86,
"actualCredits": 1,
"expectedCredits": 1,
"creationTime": "2025-08-06T08:05:20.6787519Z"
}
}
Request
Path Parameters
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 charactersHeaders
Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN
Request Body
The request body is a JSON object containing the text to scan.string
required
Text to produce Text Moderation report for.
>= 2 characters <= 25000 charactersboolean
default:"false"
Use sandbox mode to test your integration with the Copyleaks API without consuming any credits.
string
The language code of your content. Only English (
en) is supported. If the language field is not specified, our system will automatically detect the language of the content; text in any other language returns 400 Bad Request.Example: "en"array[object]
required
A list of label configurations to be used for the moderation process. Each result’s label value in
moderations.text.chars.labels is the position of that label in this list, as listed in the response’s legend.>= 1 items <= 16 itemsShow label properties
Show label properties
string
Identifier for the label. List of moderation labels.
>= 1 characters <= 32 characters
