Get started
Before you begin
Before you start, ensure you have the following:- An active Copyleaks account. If you don’t have one, sign up for free.
- You can find your API key on the API Dashboard.
Installation
Choose your preferred method for making API calls.HTTP needs no installation - call the API with any standard HTTP client, or import our Postman collection for a quicker start.
Login
To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.Upon successful authentication, you will receive a token that must be attached to subsequent API calls via theAuthorization: Bearer <TOKEN> header.
This token remains valid for 48 hours.Response
Save this token. It is valid for 48 hours and can be reused for subsequent API calls.
Interpreting the response
The API returns alegend array that maps labels IDs to numerical indices, and a moderations object that pinpoints the exact location of flagged content using those indices.legend: A lookup table where eachid(e.g., “toxic-v1”) corresponds to anindex.moderations.text.chars: Contains parallel arrays:starts: An array of starting character positions for each flagged segment.lengths: An array of character lengths for each segment.labels: An array of numerical indices that correspond to thelegend.
Example Response
Summary
You have successfully submitted text for moderation. You can now use the JSON response in your application to take further actions based on the findings.Next steps
Moderation Labels
See a complete list of all supported content moderation labels and their descriptions.
Full API Reference
Explore the complete documentation for the Text Moderation endpoint and response object.
Try it
See how Copyleaks text moderation flags unsafe content with your own examples.

