# Copyleaks API Docs > Build with the Copyleaks API: plagiarism detection, AI text & image & video detection, grammar, and moderation. Includes quickstarts, guides, API reference, and official SDKs for Python, JavaScript, Java, C#, PHP, and Ruby. This file is the complete documentation in a single document, intended for ingesting into an LLM context window. For a concise index see /llms.txt. # Get started ## Copyleaks API Docs Source: https://docs.copyleaks.com/index > Build with the Copyleaks API: AI detector, plagiarism checker, grammar, and moderation. Official SDKs for Python, JavaScript, Java, C#, PHP, and Ruby. One API to detect plagiarism, AI-generated text and images, and unsafe content, with audit trails, secured webhooks, and SDKs in six languages. Ten minutes from signup to your first verified scan. ## Start here Auth, submit a file, handle the webhook. About ten minutes end to end. Every endpoint, payload, and webhook. Official clients for Python, JavaScript, Java, C#, PHP, and Ruby. ## Guides Analyze plagiarism, AI-generated text, and writing quality via API. Supports async calls with webhooks and data masking. Detect AI-generated text in documents with our easy-to-use API. Search the web for unauthorized copies of your images and receive categorized match results in a single API call. Improve writing quality with feedback on grammar, spelling, sentence structure, and word choice using our Grammar Checker API. Refine analysis by excluding specific sections based on a predefined template. Detect and verify the academic and non-academic references in a document, catching fabricated, misattributed, or incorrectly dated citations. Provides a cloud hosted way to display the Copyleaks authenticity reports. Integrate and customize Copyleaks' web report module into your application to display the Copyleaks authenticity reports. Detect AI-generated text with our easy-to-use endpoint. Detect whether an image is AI-generated or partially AI-generated via sync or async API calls. Submit a video URL for AI detection and receive granular audio and visual analysis via webhook. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Allows you to scan and moderate text content for unsafe or policy-relevant material across 10+ categories including adult content, hate speech, profanity, self-harm, cybersecurity threats, and more. ## Official SDKs ## Products Detect plagiarism and ensure content originality with comprehensive text comparison. Identify AI-generated content with advanced machine learning detection capabilities. Detect AI-generated images with high accuracy and gain insights into their origin. Detect AI-generated videos with audio and visual track analysis and overall AI ratio scoring. Enhance writing quality with grammar checking, style suggestions, and language improvements. Moderate content for policy violations, inappropriate material, and harmful language. ## Use Cases Uphold academic standards by detecting plagiarism and identifying AI-generated content in student submissions. Ensure originality and prevent copyright infringement before publishing. Maintain a safe online environment by scanning user-generated content. Implement comprehensive content policies and AI governance across your organization. Search the web for unauthorized copies and usages of your images. ## Features Compare documents against private and shared databases to detect similarities and prevent plagiarism. Understand the reasoning behind AI detection results with detailed explanations and confidence scores. Identify sophisticated attempts to bypass detection through character substitution and formatting tricks. Display comprehensive plagiarism and AI detection results with ready-to-use report interfaces. --- ## Quickstart Source: https://docs.copyleaks.com/get-started/quickstart > Integrate with the Copyleaks API in about five minutes. This guide covers authenticating, submitting a document, and reading your first AI detection result. import InstallSDKs from '/snippets/install-sdks.mdx'; This guide walks you through your first integration with the [Copyleaks API](https://copyleaks.com/api): authenticating, submitting text, and interpreting an AI detection result. It takes about five minutes. To follow this guide you will need: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - Your API key, available on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. Every request must be authorized with an access token. Generate one by calling the [login](/reference/actions/account/login) endpoint with your email and API key, both available on the [API Dashboard](https://api.copyleaks.com/dashboard). The token is returned in the response and must be sent on every subsequent request via the `Authorization: Bearer ` header. It remains valid for 48 hours. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Content-Type: application/json { "email": "your@email.address", "key": "00000000-0000-0000-0000-000000000000" } ``` ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Access token:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); console.log("Access token:", auth.access_token); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Access token: " + authToken); } catch (CommandException e) { System.out.println("Login failed: " + e.getMessage()); System.exit(1); } ``` A successful request returns the token and its lifetime: ```json Response { "access_token": "", ".issued": "2025-07-31T10:19:40.0690015Z", ".expires": "2025-08-02T10:19:40.0690016Z" } ``` Store the token securely and reuse it for the next 48 hours rather than logging in before every request. Submit text to the [AI Content Detector](/reference/actions/writer-detector/check). The examples below run in **sandbox mode** (`"sandbox": true`), which returns simulated results so you can test your integration for free. Set `sandbox` to `false` for real detection, which consumes credits. Replace `` with the token from the previous step. The text must be at least 255 characters, and each scan requires a unique [scan ID](/concepts/management/choosing-scan-id) (`my-first-scan` below). ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v2/writer-detector/my-first-scan/check Authorization: Bearer Content-Type: application/json { "text": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery.", "sandbox": true } ``` ```bash title="cURL" icon="terminal" curl --request POST \ --url "https://api.copyleaks.com/v2/writer-detector/my-first-scan/check" \ --header "Authorization: Bearer " \ --header "Content-Type: application/json" \ --data '{ "text": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery.", "sandbox": true }' ``` ```python title="Python" icon="python" from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument scan_id = "my-first-scan" sample_text = ( "Artificial intelligence has revolutionized numerous industries by automating " "complex tasks and providing data-driven insights. Machine learning algorithms " "can analyze vast datasets to identify patterns that humans might miss. In " "healthcare, AI assists with diagnosis and drug discovery." ) document = NaturalLanguageDocument(sample_text) document.set_sandbox(True) response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, scan_id, document) print("AI score:", response["summary"]["ai"] * 100, "%") ``` ```javascript title="JavaScript" icon="square-js" const { CopyleaksNaturalLanguageSubmissionModel } = require("plagiarism-checker"); const scanId = "my-first-scan"; const sampleText = "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery."; const submission = new CopyleaksNaturalLanguageSubmissionModel(sampleText); submission.sandbox = true; const response = await copyleaks.aiDetectionClient.submitNaturalTextAsync(auth, scanId, submission); console.log("AI score:", response.summary.ai * 100, "%"); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.models.AiDetectionDocument; import com.copyleaks.sdk.api.models.AiDetectionResponse; String scanId = "my-first-scan"; String sampleText = "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery."; AiDetectionDocument submission = new AiDetectionDocument(sampleText); submission.setSandbox(true); try { AiDetectionResponse response = Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, scanId, submission); System.out.println("AI score: " + response.getSummary().getAi()); } catch (CommandException e) { System.out.println("Error: " + e.getMessage()); } ``` The response classifies the text and reports an overall AI probability: ```json Response { "modelVersion": "v5", "results": [ { "classification": 2, "probability": 0.99 } ], "summary": { "ai": 0.99, "human": 0.01 } } ``` `summary.ai` is the overall probability that the text is AI-generated, from `0` to `1`. Each entry in `results` classifies a section of the text: a `classification` of `2` indicates AI-generated and `1` indicates human-written, with `probability` as the confidence for that section. ## Recap You have completed your first integration. In this guide you: - Authenticated with the Copyleaks API and received a 48-hour access token. - Submitted text to the AI Content Detector in sandbox mode. - Interpreted the classification and AI probability in the response. To run against live detection, set `sandbox` to `false`. Note that production scans consume credits. ## Next steps Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection; see the Authenticity API guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. Get a personalized demo and discover how to process thousands of documents seamlessly, integrate Copyleaks into your existing systems, and achieve enterprise-grade accuracy for your specific use case. --- # Guides → AI Detector ## AI Detector Guides Source: https://docs.copyleaks.com/guides/ai-detector/overview > Step-by-step guides for detecting AI-generated text, images, and videos using the Copyleaks AI Detection APIs. Detect AI-generated content across text, images, and videos with the Copyleaks [AI detector](https://copyleaks.com/ai-detector). Each guide walks through authentication, submission, and parsing results. Submit text and get an AI or human classification back in one synchronous call. Submit an image and detect whether it's AI-generated or partially AI-generated. Extract embedded images from a PDF and run AI detection across each one. Submit a video URL and receive granular audio and visual analysis via webhook. --- ## Detect AI-Generated Text Source: https://docs.copyleaks.com/guides/ai-detector/ai-text-detection > Check whether text is human-written or AI-generated with one synchronous Copyleaks API call - submit text and get a classification instantly. import InstallSDKs from '/snippets/install-sdks.mdx'; import GuideLogin from '/snippets/guide-login.mdx'; The Copyleaks [AI Detector](https://copyleaks.com/ai-detector) API is a powerful tool to determine if a given text was written by a human or generated by an AI. The API is synchronous, meaning you get the results in the same API call. This guide will walk you through the process of submitting text for [AI detection](https://copyleaks.com/ai-detector) and understanding the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for analysis Use the [AI Text Detection Endpoint](/reference/actions/writer-detector/check) to send text for analysis. We suggest you provide a unique `scanId` for each submission. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v2/writer-detector/my-scan-1/check Headers Authorization: Bearer Content-Type: application/json Body { "text": "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.", "sandbox": true } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v2/writer-detector/my-scan-1/check" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "text": "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.", "sandbox": true }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument, SourceCodeDocument scan_id = "my-scan-1" sample_text = "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures." natural_language_submission = NaturalLanguageDocument(sample_text) natural_language_submission.set_sandbox(True) response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, scan_id, natural_language_submission) print(response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksNaturalLanguageSubmissionModel } = require('plagiarism-checker'); async function checkAiText() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `ai-text-scan-${Date.now()}`; // The text to be checked const textToCheck = "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey."; // Create a submission model const submission = new CopyleaksNaturalLanguageSubmissionModel(textToCheck); submission.sandbox = true; // Use sandbox for testing // Submit the text for analysis const response = await copyleaks.aiDetectionClient.submitNaturalTextAsync(loginResult, scanId, submission); console.log("AI detection results:", response); } catch (error) { console.error("An error occurred:", error); } } checkAiText(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksNaturalLanguageSubmissionModel; import models.responses.AIDetectionResponse; String scanId = "my-ai-scan"; String sampleText = "Lions are social animals, living in groups called prides..."; CopyleaksNaturalLanguageSubmissionModel submission = new CopyleaksNaturalLanguageSubmissionModel(sampleText); submission.setSandbox(true); AIDetectionResponse response = Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, scanId, submission); System.out.println("AI Score: " + response.getSummary().getAi()); ``` ### Interpreting the response For a complete breakdown of the response structure, see the [AI Detection Response](/reference/data-types/ai-detector/ai-text-detector-response) documentation. ### Summary You have successfully submitted text for AI detection. You can now use the JSON response in your application to take further action based on the findings. ## Frequently asked questions Yes. You send text to the [check endpoint](/reference/actions/writer-detector/check) and receive the detection results in the same API call, with no webhook required. `POST https://api.copyleaks.com/v2/writer-detector/{scanId}/check`, with the text to analyze in the request body. Yes. Set `"sandbox": true` in the request. Sandbox mode is free and returns mock results so you can build the integration before going live. A per-section classification (human or AI) and an overall human-versus-AI summary. See the [AI Detection Response](/reference/data-types/ai-detector/ai-text-detector-response) reference for the full structure. This endpoint analyzes raw text synchronously. To scan files such as PDF or DOCX, use the asynchronous authenticity flow in [Detect AI-Generated Content in Documents](/guides/authenticity/detect-ai-generated-content). ## Next steps Explore the full API reference for the AI Detection endpoint. Learn how to use AI logic can help you interpret the results of AI text detection. Discover how Copyleaks AI Detector maintains top accuracy in third-party evaluations. --- ## Detect AI-Generated Images Source: https://docs.copyleaks.com/guides/ai-detector/ai-image-detection > Detect AI-generated images with one synchronous Copyleaks API call. Submit via multipart and get an AI-vs-human summary and a pixel-level mask. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; The Copyleaks [AI Image Detection](https://copyleaks.com/ai-detector/ai-image-detector) API is a powerful tool to determine if a given image was generated or partially generated by an AI. The API is synchronous, meaning you get the results in the same API call. This guide will walk you through the process of submitting an image to the Copyleaks [AI Detector](https://copyleaks.com/ai-detector) using multipart/form-data format and understanding the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for analysis Use the [AI Image Detector Endpoint](/reference/actions/ai-image-detector/check) to send an image for analysis. We suggest you provide a unique `scanId` for each submission. This guide uses **multipart/form-data** format, which sends the image file directly without base64 encoding overhead. Use `multipart/form-data` to send a binary image file. Use `application/json` when you need to submit image data as a base64-encoded string. Note that multipart only accepts binary files, base64-encoded images are not supported for multipart requests. #### Image Requirements - **Size:** Minimum 512×512px, maximum 6000×4500px (27 megapixels) - **File size:** Less than 32MB - **Formats:** PNG, JPG, JPEG, BMP, WebP, HEIC/HEIF For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v1/ai-image-detector/my-image-scan-1/check Headers Authorization: Bearer Content-Type: multipart/form-data; boundary=----WebKitFormBoundary Body ------WebKitFormBoundary Content-Disposition: form-data; name="image"; filename="test-image.png" Content-Type: image/png [binary image data] ------WebKitFormBoundary Content-Disposition: form-data; name="filename" test-image.png ------WebKitFormBoundary Content-Disposition: form-data; name="sandbox" true ------WebKitFormBoundary Content-Disposition: form-data; name="model" ai-image-1-ultra ------WebKitFormBoundary-- ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v1/ai-image-detector/my-image-scan-1/check" \ -H "Authorization: Bearer " \ -F "image=@/path/to/test-image.png" \ -F "filename=test-image.png" \ -F "sandbox=true" \ -F "model=ai-image-1-ultra" ``` ```python title="Python" icon="python" import requests # Prepare the request url = 'https://api.copyleaks.com/v1/ai-image-detector/my-image-scan-1/check' headers = { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' } # Prepare multipart form data with open('test-image.png', 'rb') as image_file: files = { 'image': ('test-image.png', image_file, 'image/png') } data = { 'filename': 'test-image.png', 'sandbox': 'true', 'model': 'ai-image-1-ultra' } # Send the request response = requests.post(url, files=files, data=data, headers=headers) result = response.json() print(f"AI Detection Summary: {result['summary']}") ``` ```javascript title="JavaScript" icon="square-js" const imageFile = document.getElementById('fileInput').files[0]; const formData = new FormData(); formData.append('image', imageFile); formData.append('filename', imageFile.name); formData.append('sandbox', 'true'); formData.append('model', 'ai-image-1-ultra'); const response = await fetch('https://api.copyleaks.com/v1/ai-image-detector/my-image-scan-1/check', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' }, body: formData }); const result = await response.json(); console.log('AI Detection Result:', result); ``` ```java title="Java" icon="java" import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; public class AiImageDetectionMultipart { public static void main(String[] args) throws IOException, InterruptedException { String authToken = "YOUR_LOGIN_TOKEN"; String imagePath = "path/to/your/test-image.png"; String scanId = "my-java-scan-1"; String boundary = "----WebKitFormBoundary" + System.currentTimeMillis(); Path path = Paths.get(imagePath); byte[] imageBytes = Files.readAllBytes(path); String filename = "test-image.png"; // Build multipart body List byteArrays = new ArrayList<>(); // Image field String imagePart = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"image\"; filename=\"" + filename + "\"\r\n" + "Content-Type: image/png\r\n\r\n"; byteArrays.add(imagePart.getBytes()); byteArrays.add(imageBytes); byteArrays.add("\r\n".getBytes()); // Other fields String otherFields = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"filename\"\r\n\r\n" + filename + "\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"sandbox\"\r\n\r\n" + "true\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"model\"\r\n\r\n" + "ai-image-1-ultra\r\n" + "--" + boundary + "--\r\n"; byteArrays.add(otherFields.getBytes()); // Combine all parts byte[] multipartBody = combineByteArrays(byteArrays); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.copyleaks.com/v1/ai-image-detector/" + scanId + "/check")) .header("Authorization", "Bearer " + authToken) .header("Content-Type", "multipart/form-data; boundary=" + boundary) .POST(HttpRequest.BodyPublishers.ofByteArray(multipartBody)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println("Status Code: " + response.statusCode()); System.out.println("Response Body: " + response.body()); } private static byte[] combineByteArrays(List arrays) { int totalLength = arrays.stream().mapToInt(a -> a.length).sum(); byte[] result = new byte[totalLength]; int offset = 0; for (byte[] array : arrays) { System.arraycopy(array, 0, result, offset, array.length); offset += array.length; } return result; } } ``` ### Interpreting the response The API response contains: - A `summary` object with the overall percentage of AI vs. human pixels - A `result` object with a Run-Length Encoded (RLE) mask - `imageInfo` with the image dimensions and metadata (when available) - `scannedDocument` with scan details including credits used #### Understanding the RLE Mask Run-Length Encoding (RLE) is a compression method used to represent the AI-detected regions of the image efficiently. It provides an array of `starts` positions and `lengths` for each run of AI-detected pixels in a flattened 1D version of the image. You can decode this RLE data to create a binary mask. Below are implementations in different languages: ```python title="Python" icon="python" def decode_mask(rle_data, image_width, image_height): """ Decode RLE mask data into a binary mask array. Args: rle_data (dict): Dictionary with 'starts' and 'lengths' arrays image_width (int): Width of the image in pixels image_height (int): Height of the image in pixels Returns: list: A 1D array where 1 represents AI-detected pixels """ total_pixels = image_width * image_height mask = [0] * total_pixels starts = rle_data.get('starts', []) lengths = rle_data.get('lengths', []) for i in range(len(starts)): start = starts[i] length = lengths[i] for j in range(length): position = start + j if position < total_pixels: mask[position] = 1 return mask # Example usage: # result = response.json() # binary_mask = decode_mask( # result['result'], # result['imageInfo']['shape']['width'], # result['imageInfo']['shape']['height'] # ) ``` ```javascript title="JavaScript" icon="square-js" function decodeMask(rleData, imageWidth, imageHeight) { const totalPixels = imageWidth * imageHeight; const mask = new Array(totalPixels).fill(0); const starts = rleData.starts || []; const lengths = rleData.lengths || []; for (let i = 0; i < starts.length; i++) { const start = starts[i]; const length = lengths[i]; for (let j = 0; j < length; j++) { const position = start + j; if (position < totalPixels) { mask[position] = 1; } } } return mask; } // Example usage: // const { result, imageInfo } = await response.json(); // const binaryMask = decodeMask(result, imageInfo.shape.width, imageInfo.shape.height); ``` ```java title="Java" icon="java" /** * Decodes RLE mask data into a binary mask array * * @param rleMask The RLE mask with starts and lengths arrays * @param width Image width in pixels * @param height Image height in pixels * @return Binary mask where true represents AI-detected pixels */ public static boolean[] decodeMask(RleMask rleMask, int width, int height) { int totalPixels = width * height; boolean[] mask = new boolean[totalPixels]; if (rleMask == null || rleMask.starts() == null || rleMask.lengths() == null) { return mask; } for (int i = 0; i < rleMask.starts().length; i++) { int start = rleMask.starts()[i]; int length = rleMask.lengths()[i]; for (int j = 0; j < length; j++) { int position = start + j; if (position < totalPixels) { mask[position] = true; } } } return mask; } // Example usage: // Response contains: { "result": { "starts": [0, 512...], "lengths": [256, 512...] }, "imageInfo": {...} } // boolean[] binaryMask = decodeMask( // new RleMask(result.getJSONObject("result").getJSONArray("starts"), result.getJSONObject("result").getJSONArray("lengths")), // result.getJSONObject("imageInfo").getJSONObject("shape").getInt("width"), // result.getJSONObject("imageInfo").getJSONObject("shape").getInt("height") // ); ``` The resulting binary mask is an array where a `1` (or `true` in Java) represents an AI-detected pixel. You can use this mask to create a visual overlay on the original image. #### Creating a Visual Overlay After decoding the RLE data, you can use the resulting mask to draw a semi-transparent overlay on the original image. Here are some examples of how to achieve this: ```python title="Python" icon="python" # Requires: pip install Pillow from PIL import Image import numpy as np def apply_overlay(image_path, mask_array, output_path): """ Apply a red (1) and green (0) overlay to the image and save the result. Args: image_path (str): Path to the original image mask_array (np.ndarray): 2D numpy array with 1 (red) and 0 (green) output_path (str): Path to save the output image """ height, width = mask_array.shape original_img = Image.open(image_path).convert('RGBA') overlay = Image.new('RGBA', (width, height), (0, 0, 0, 0)) overlay_pixels = overlay.load() for y in range(height): for x in range(width): if mask_array[y, x] == 1: overlay_pixels[x, y] = (255, 0, 0, 120) # Red, semi-transparent else: overlay_pixels[x, y] = (0, 255, 0, 120) # Green, semi-transparent result_img = Image.alpha_composite(original_img, overlay) result_img.save(output_path) # Usage example: width = result['imageInfo']['shape']['width'] height = result['imageInfo']['shape']['height'] mask_array = np.array(binary_mask, dtype=np.uint8).reshape((height, width)) apply_overlay('test-image.png', mask_array, 'output-with-overlay.png') ``` ```javascript title="JavaScript" icon="square-js" // Assumes 'decodeMask' function from above is available /** * Creates a canvas with the original image and an overlay showing AI vs human regions * @param {HTMLImageElement} imageElement - The image element to overlay * @param {Object} rleData - The RLE mask data with starts and lengths arrays * @returns {HTMLCanvasElement} Canvas with the original image and overlay */ function createOverlay(imageElement, rleData) { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); const width = imageElement.width; const height = imageElement.height; canvas.width = width; canvas.height = height; // Draw original image ctx.drawImage(imageElement, 0, 0); // Get the binary mask const binaryMask = decodeMask(rleData, width, height); // Create an ImageData object to manipulate pixels directly const imageData = ctx.getImageData(0, 0, width, height); const data = imageData.data; // Apply overlay for each pixel for (let i = 0; i < binaryMask.length; i++) { const pixelIndex = i * 4; // RGBA data has 4 values per pixel if (binaryMask[i] === 1) { // AI-generated area (red overlay) data[pixelIndex] = data[pixelIndex] * 0.7 + 255 * 0.3; // R data[pixelIndex + 1] = data[pixelIndex + 1] * 0.7; // G data[pixelIndex + 2] = data[pixelIndex + 2] * 0.7; // B data[pixelIndex + 3] = 255; // A } else { // Human-generated area (green overlay) data[pixelIndex] = data[pixelIndex] * 0.7; // R data[pixelIndex + 1] = data[pixelIndex + 1] * 0.7 + 255 * 0.3; // G data[pixelIndex + 2] = data[pixelIndex + 2] * 0.7; // B data[pixelIndex + 3] = 255; // A } } // Put the modified image data back on the canvas ctx.putImageData(imageData, 0, 0); return canvas; } // Example usage: function displayImageWithOverlay(imagePath, apiResult) { // Create image element const img = new Image(); img.crossOrigin = "Anonymous"; // When image loads, create and display the overlay img.onload = () => { // Get image dimensions from the API result const width = apiResult.imageInfo.shape.width; const height = apiResult.imageInfo.shape.height; // Create the overlay canvas const canvas = createOverlay(img, apiResult.result); // Add to page and optionally download document.body.appendChild(canvas); // Optionally: convert to a downloadable image canvas.toBlob(blob => { const link = document.createElement('a'); link.download = 'overlay-image.png'; link.href = URL.createObjectURL(blob); link.textContent = 'Download Image with Overlay'; document.body.appendChild(link); }); }; // Set the image source to load it img.src = imagePath; } ``` ```java title="Java" icon="java" import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import javax.imageio.ImageIO; // First, create a record for the RLE data: // For Java 16+: // public record RleMask(int[] starts, int[] lengths) {} // For earlier Java versions: public static class RleMask { private final int[] starts; private final int[] lengths; public RleMask(int[] starts, int[] lengths) { this.starts = starts; this.lengths = lengths; } public int[] starts() { return starts; } public int[] lengths() { return lengths; } } /** * Class to handle applying AI detection overlays to images */ public class ImageOverlay { /** * Applies red (AI) and green (human) overlays to the image based on mask data * * @param imagePath Path to the original image file * @param maskArray 2D boolean array where true represents AI-detected pixels * @param outputPath Path to save the output image * @return The overlaid image as a BufferedImage */ public static BufferedImage applyOverlay(String imagePath, boolean[][] maskArray, String outputPath) throws IOException { // Read the original image BufferedImage original = ImageIO.read(new File(imagePath)); int width = original.getWidth(); int height = original.getHeight(); // Create overlay image with transparent background BufferedImage overlay = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g = overlay.createGraphics(); // Apply overlay for each pixel for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { if (y < maskArray.length && x < maskArray[0].length) { if (maskArray[y][x]) { // AI-detected area - red overlay g.setColor(new Color(255, 0, 0, 120)); // Red with 47% opacity } else { // Human-created area - green overlay g.setColor(new Color(0, 255, 0, 120)); // Green with 47% opacity } g.fillRect(x, y, 1, 1); } } } g.dispose(); // Combine original and overlay BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = result.createGraphics(); g2.drawImage(original, 0, 0, null); g2.drawImage(overlay, 0, 0, null); g2.dispose(); // Save the resulting image ImageIO.write(result, "PNG", new File(outputPath)); return result; } /** * Convert 1D mask array to 2D for easier processing * * @param mask 1D boolean array representing the mask * @param width Image width * @param height Image height * @return 2D boolean array */ public static boolean[][] convertTo2DMask(boolean[] mask, int width, int height) { boolean[][] result = new boolean[height][width]; for (int i = 0; i < mask.length; i++) { int y = i / width; int x = i % width; if (y < height && x < width) { result[y][x] = mask[i]; } } return result; } } // Example usage: public static void main(String[] args) throws IOException { // Step 1: Get the API result with RLE data (simplified example) int[] starts = {0, 512, 1536, 2560}; int[] lengths = {256, 512, 768, 1024}; RleMask rleMask = new RleMask(starts, lengths); // Step 2: Decode the RLE mask int width = 1024; int height = 768; boolean[] binaryMask = decodeMask(rleMask, width, height); // Step 3: Convert to 2D array for easier processing boolean[][] mask2D = ImageOverlay.convertTo2DMask(binaryMask, width, height); // Step 4: Apply overlay and save String imagePath = "path/to/your/image.jpg"; String outputPath = "output-with-overlay.png"; ImageOverlay.applyOverlay(imagePath, mask2D, outputPath); System.out.println("Overlay applied and saved to " + outputPath); } ``` For a complete breakdown of all fields in the response, see the [AI Image Detection Response](/reference/data-types/ai-detector/ai-image-detection-response) documentation. ### Summary You have successfully submitted an image for AI detection. You can now use the JSON response in your application to take further action based on the findings. ## Frequently asked questions Yes. You send the image to the [check endpoint](/reference/actions/ai-image-detector/check) and receive the results in the same API call, with no webhook required. Images must be between 512×512px and 6000×4500px (27 megapixels) and under 32MB. Supported formats are PNG, JPG, JPEG, BMP, WebP, and HEIC/HEIF. Yes. Use `application/json` to send a base64-encoded image. The `multipart/form-data` method shown in this guide accepts only binary files, not base64. A `summary` with the overall percentage of AI vs. human pixels, a `result` object with a Run-Length Encoded (RLE) mask of AI-detected regions, `imageInfo` with dimensions and metadata, and `scannedDocument` with scan details. See the [AI Image Detection Response](/reference/data-types/ai-detector/ai-image-detection-response) reference. Decode the RLE mask into a binary mask (one value per pixel), then draw a semi-transparent overlay on the original image. This guide includes ready-to-use decode and overlay code in Python, JavaScript, and Java. ## Next steps Explore the full API reference for the AI Image Detection endpoint. Explore the full response for the AI Image Detection. Learn optimization strategies for performance and accuracy with image detection. Learn about the accuracy and testing methodology of the AI Image Detection product. --- ## Detect AI-Generated Images in PDFs Source: https://docs.copyleaks.com/guides/ai-detector/ai-pdf-image-detection > Learn how to use the AI Image Detection API to check if images in a pdf file are AI-generated or partially AI-generated. import GuideLogin from '/snippets/guide-login.mdx'; The Copyleaks [AI Image Detection](https://copyleaks.com/ai-detector/ai-image-detector) API is a powerful tool to determine if a given image was generated or partially generated by an AI. As a consumer, you might have a PDF with images. If you want to scan those images separately from the PDF, this guide is for you. This guide will walk you through the process of extracting images from a pdf file and submitting them to the Copyleaks [AI Detector](https://copyleaks.com/ai-detector) and understanding the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation Install the relevant packages using `pip install -U PyMuPDF Pillow copyleaks`. ### Login ### Extracting images from a PDF file Next, we are going to extract all the images from the PDF. The function below will take a pdf file path and extract all its images to a specified directory. The following example takes the input PDF file and outputs all its nested images to the `output_folder` directory ```python import os import fitz # package by the PyMuPDF module from pathlib import Path def extract_images(pdf_path: str, output_folder: str = "Extracted-Images") -> list[str]: """ Extract all images from a PDF file. Args: pdf_path: Path to PDF file output_folder: Output folder for images Returns: List of extracted image paths as strings """ os.makedirs(output_folder, exist_ok=True) extracted = [] pdf_name = Path(pdf_path).stem pdf = None try: pdf = fitz.open(pdf_path) print(f"Processing: {pdf_path}") print(f"Pages: {len(pdf)}") image_count = 0 for page_num in range(len(pdf)): page = pdf[page_num] images = page.get_images(full=True) print(f"Page {page_num + 1}: {len(images)} image(s)") for img_index, img in enumerate(images): xref = img[0] base_image = pdf.extract_image(xref) image_bytes = base_image["image"] ext = base_image["ext"] image_count += 1 filename = f"{pdf_name}_page{ page_num + 1}_img{img_index + 1}.{ext}" path = os.path.join(output_folder, filename) try: with open(path, "wb") as f: f.write(image_bytes) except Exception as e: print(f" Error: {e}") extracted.append(path) print(f" {filename}") except Exception as e: print(f" Error: {e}") return [] finally: if pdf is not None: pdf.close() print(f"\n Extracted {image_count} images") return extracted if __name__ == "__main__": extract_images("my_file.pdf", "output_dir") ``` ### Submit for analysis Once we have the extracted images, you can submit them for analysis. We are going to use the [AI Image Detector Endpoint]( /reference/actions/ai-image-detector/check) to send an image for analysis. #### AI Detection scan This function takes your image, converts it to base64, and submits it via the SDK's `ImageDetectionClient`. The SDK handles authentication and HTTP transport. ```python import os import base64 import uuid from copyleaks.clients.image_detection_client import ImageDetectionClient from copyleaks.models.ai_image_detection import ( CopyleaksAiImageDetectionRequestModel, CopyleaksAiImageDetectionModels, ) def detect(image_path: str, auth_token: str): """Detect AI content in image using the Copyleaks SDK.""" try: with open(image_path, 'rb') as f: image_data = base64.b64encode(f.read()).decode('utf-8') except Exception as e: print(f" Error reading image: {e}") return None scan_id = str(uuid.uuid4()) payload = CopyleaksAiImageDetectionRequestModel( base64=image_data, filename=os.path.basename(image_path), model=CopyleaksAiImageDetectionModels.AI_IMAGE_1_ULTRA, sandbox=False, ) client = ImageDetectionClient() return client.submit(auth_token, scan_id, payload) if __name__ == "__main__": from pathlib import Path path = Path('directory_path') for entry in path.iterdir(): if entry.is_file(): print(detect(str(entry), 'auth_token')) ``` ### Interpreting the response See the [Interpreting The Response]( /guides/ai-detector/ai-image-detection/#interpreting-the-response) page on [Detecting AI-Generated Images](/guides/ai-detector/ai-image-detection/) ## Summary You have successfully submitted images from PDF for AI detection. You are free to adapt this code to your needs. ## Next steps Explore the full API reference for the AI Image Detection endpoint. Explore the full response for the AI Image Detection. Discover how Copyleaks AI Detector maintains top accuracy in third-party evaluations. --- ## Detect AI-Generated Videos Source: https://docs.copyleaks.com/guides/ai-detector/ai-video-detection > Use the AI Video Detection API to check if a video is AI-generated via an async submit-and-webhook flow. import BeforeYouBegin from '/snippets/before-you-begin.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; import HowToLogin from '/snippets/how-to-login.mdx'; The Copyleaks AI Video Detection API, part of the Copyleaks [AI Detector](https://copyleaks.com/ai-detector), analyzes whether a video was generated or partially generated by AI. The API is **asynchronous**, you submit a video URL, and Copyleaks notifies your server via webhook when the results are ready. This guide walks through submitting a [video for AI detection](https://copyleaks.com/ai-video-detector) and interpreting the webhook response. **Just want to try it?** Open the [Video Detection Playground](https://api.copyleaks.com/dashboard/playground/video-detection) to submit a sample video and inspect the webhook response in your browser, no code required. ## Get started ### Before you begin ### Installation ### Login ### Submit a video for analysis Use the [AI Video Detector endpoint](/reference/actions/ai-video-detector/submit) to submit a video URL for analysis. Provide a unique `scanId` for each submission and a webhook URL to receive the results. This API is asynchronous. The submission returns `201 Created` immediately, and the detection results are sent to your webhook URL once processing completes. #### Providing a video URL The API requires a **publicly accessible URL** pointing to your video file - Copyleaks will fetch it directly. The video must be reachable at the time of processing, so avoid URLs that expire before the scan completes. A common approach is to upload the video to cloud storage and generate a pre-signed URL: - **Amazon S3** - Upload the file to an S3 bucket and generate a [pre-signed URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) with a sufficient expiry window (e.g. 1 hour). The bucket does not need to be public. - **Google Cloud Storage** - Upload to a GCS bucket and create a [signed URL](https://cloud.google.com/storage/docs/access-control/signed-urls) using the GCS console or SDK. - **Azure Blob Storage** - Upload to a container and generate a [SAS URL](https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview) with read access. - **Any CDN or file host** - Any URL that returns the raw video file with a `Content-Type` video header works. If your video is hosted behind authentication (e.g. a signed URL that also requires a token header, or an internal storage service), use the top-level `headers` field in the request body to pass the necessary HTTP headers. Copyleaks will include these headers when fetching the video. For example, to pass a bearer token: ```json "headers": [["Authorization", "Bearer YOUR_TOKEN"]] ``` Each entry in the array is a `["Header-Name", "Header-Value"]` pair. You can include multiple headers by adding more pairs to the array. #### Setting up your webhook The `webhooks.url` field is where Copyleaks will `POST` the detection results when processing is done. This must be a publicly reachable HTTPS endpoint on your server. A few tips for getting started: - **During development** - Use a tool like [ngrok](https://ngrok.com/) or [webhook.site](https://webhook.site/) to expose a local server or inspect incoming payloads without writing any backend code. - **In production** - Implement a route in your API (e.g. `POST /webhook/video-results`) that receives the payload, validates it, and stores or acts on the results. - **Security** - Use the optional `webhooks.headers` field to pass a secret token with the webhook request, which your server can verify to ensure the request is coming from Copyleaks. #### Video requirements **Returned as `400 Bad Request` at submit (synchronous):** - Missing or invalid `scanId`, `filename`, `url`, `model`, or `webhooks` - Unsupported file extension (supported: `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.mpg`, `.m4v`, `.3gp`, `.mxf`) - Filename longer than 255 characters - Invalid `verb` value **Delivered to your webhook as an error result (asynchronous):** - Duration outside 2 seconds-1 hour → `video_too_short` (67) / `video_too_long` (68) - File larger than 512 MiB → `file_too_large` (6) - Resolution below 360×360 → `video_resolution_too_low` (65) - Frame rate below 16 FPS → `fps_too_low` (66) - Undecodable codec → `unsupported_video_codec` (71) - Corrupt or truncated file → `video_truncated` (70) - Generic decode failure → `video_load_failed` (72) For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit Headers Authorization: Bearer Content-Type: application/json Body { "url": "https://example.com/my-video.mp4", "filename": "my-video.mp4", "model": "ai-video-1-pro", "sandbox": true, "webhooks": { "url": "https://your-server.com/webhook/receive-results" } } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/my-video.mp4", "filename": "my-video.mp4", "model": "ai-video-1-pro", "sandbox": true, "webhooks": { "url": "https://your-server.com/webhook/receive-results" } }' ``` ```python title="Python" icon="python" import requests url = 'https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit' headers = { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' } payload = { 'url': 'https://example.com/my-video.mp4', 'filename': 'my-video.mp4', 'model': 'ai-video-1-pro', 'sandbox': True, 'webhooks': { 'url': 'https://your-server.com/webhook/receive-results' } } response = requests.post(url, json=payload, headers=headers) print(f"Submission status: {response.status_code}") # Expect 201 Created ``` ```javascript title="JavaScript" icon="square-js" const response = await fetch( 'https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://example.com/my-video.mp4', filename: 'my-video.mp4', model: 'ai-video-1-pro', sandbox: true, webhooks: { url: 'https://your-server.com/webhook/receive-results' } }) } ); console.log('Submission status:', response.status); // Expect 201 Created ``` ### Receive the webhook result Once Copyleaks finishes analyzing the video, it sends a POST request to your webhook URL with the detection results. #### Example webhook payload ```json { "model": "ai-video-1-pro", "audioResult": { "starts": [13000, 45000, 47000], "lengths": [14000, 1000, 8700], "exclude": { "starts": [0, 3250, 5400, 7600, 10500], "lengths": [2950, 1500, 1200, 650, 1050] } }, "visualResult": { "starts": [11566, 29433], "lengths": [6134, 26267], "exclude": { "starts": [], "lengths": [] } }, "summary": { "audioAIRatio": 0.4902, "visualAIRatio": 0.5817, "overallAIRatio": 0.7487 }, "videoInfo": { "metadata": { "issuedTime": "2026-03-17T13:14:57+00:00", "issuedBy": "OpenAI", "appOrDeviceUsed": "Sora", "contentSummary": "Created using generative AI" }, "duration": 55.7 }, "scannedVideo": { "scanId": "my-video-scan-1", "actualCredits": 1, "expectedCredits": 1, "creationTime": "2026-05-05T12:37:50Z" } } ``` #### Understanding the results The webhook response contains three key sections: **`audioResult` and `visualResult`** - Time-based detections for the audio and visual tracks, encoded as arrays of start positions (`starts`) and durations (`lengths`) in milliseconds. The `exclude` object within each result identifies segments that were **not scored**. These ranges are excluded because the content could not be meaningfully analyzed, and they are not counted in the AI ratio calculations. **`summary`** - Overall AI ratios. Segments listed in `exclude` are not counted in any of these calculations: - `audioAIRatio` - Ratio of AI-detected audio duration to total audible duration. Excluded audio ranges are not counted (0.0-1.0). - `visualAIRatio` - Ratio of AI-detected visual duration to total visible duration. Excluded visual ranges are not counted (0.0-1.0). - `overallAIRatio` - Combined AI ratio across both audio and visual tracks, relative to the total video duration (0.0-1.0). **`videoInfo`** - Video duration and optional C2PA/embedded metadata identifying the generating tool. For a complete breakdown of all response fields, see the [AI Video Detection Response](/reference/data-types/ai-detector/ai-video-detection-response) documentation. ### You're done You've successfully submitted a video for AI detection and received the webhook results. You can now use `summary.overallAIRatio` and the time-based `audioResult` / `visualResult` data in your application. ## Next steps The complete reference for the AI Video Detection endpoint. The complete webhook response structure. Detect AI-generated images using the synchronous image detection API. --- # Guides → Authenticity ## Authenticity Guides Source: https://docs.copyleaks.com/guides/authenticity/overview > Step-by-step guides for plagiarism detection, AI content detection, writing quality, template exclusion, and report display. Verify the originality and quality of documents, then surface the results in your app. These guides cover [plagiarism checker](https://copyleaks.com/plagiarism-checker) scans, AI-content checks, writing-quality assessments, template-based exclusions, and the report display options. ## Run a scan Submit text or files and get a plagiarism report with matched sources. Run AI detection on uploaded documents as part of a full authenticity scan. Search the web for unauthorized copies of your images and receive categorized match results in a single API call. Get feedback on grammar, spelling, sentence structure, and word choice. Refine analysis by excluding template sections (headers, instructions) from the scan. ## Display the results Drop in an iframe to display detailed plagiarism and AI detection reports, no rendering work required. Integrate the open-source report module for full control over styling, layout, and theming. --- ## Detect Plagiarism in Text Source: https://docs.copyleaks.com/guides/authenticity/detect-plagiarism-text > A comprehensive guide to using the Copyleaks Plagiarism Checker API for robust originality verification. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; The Copyleaks Authenticity API is the most powerful way to analyze your content for plagiarism. This API is asynchronous - you submit a scan, and Copyleaks notifies your server via webhooks when the results are ready to be retrieved. This guide will walk you through the process of submitting a scan, enabling plagiarism detection, and exporting the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for scanning Use the [Submit File Endpoint](/reference/actions/authenticity/submit-file) to send content for analysis. We suggest you provide a unique `scanId` for each submission. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. **What is Base64 Encoding?** Base64 converts binary files into text strings so they can be sent via JSON. All programming languages have built-in Base64 encoding functions, see the code examples below for your language. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-plagiarism-scan Headers Authorization: Bearer Content-Type: application/json Body { "base64": "SGVsbG8gd29ybGQh", "filename": "file.txt", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "sandbox": true } } ``` ```bash title="cURL" icon="terminal" curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/my-plagiarism-scan" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "SGVsbG8gd29ybGQh", "filename": "file.txt", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "sandbox": true, "scanning": { "internet": true }, "cheatDetection": false } }' ``` ```python title="Python" icon="python" import base64 import random from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks print("Submitting a new file...") BASE64_FILE_CONTENT = base64.b64encode(b'Hello world').decode('utf8') # or read your file and convert it into BASE64 presentation. FILENAME = "hello.txt" scan_id = random.randint(100, 100000) # generate a random scan id file_submission = FileDocument(BASE64_FILE_CONTENT, FILENAME) # Once the scan completes on Copyleaks servers, we will trigger a webhook that notifies you. # Provide your public endpoint server address. If you are testing locally, make sure that this endpoint # is publicly available. webhooks = SubmitWebhooks() webhooks.set_status('https://your.server/webhook/{STATUS}') webhooks.set_new_result('https://your.server/webhook/new-results') # Pass the webhooks to ScanProperties scan_properties = ScanProperties(status_webhook='https://your.server/webhook/{STATUS}') scan_properties.set_webhooks(webhooks) scan_properties.set_sandbox(True) # Turn on sandbox mode. Turn off on production. file_submission.set_properties(scan_properties) Copyleaks.submit_file(auth_token, scan_id, file_submission) # sending the submission to scanning print("Sent to scanning") print("You will be notified, using your webhook, once the scan is completed.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); async function submitTextForPlagiarismCheck() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `text-plagiarism-scan-${Date.now()}`; const WEBHOOK_URL = "https://your-server.com/webhook"; // The text to be checked for plagiarism const textContent = "Hello world, this is a test."; const base64Content = Buffer.from(textContent).toString('base64'); // Create a submission model const submission = new CopyleaksFileSubmissionModel( base64Content, 'sample.txt', { sandbox: true, // Use sandbox for testing webhooks: { // Copyleaks will notify this URL when the scan is complete. status: `${WEBHOOK_URL}/{STATUS}` } } ); // Submit the file for scanning await copyleaks.submitFileAsync(loginResult, scanId, submission); console.log(`Submission successful. Scan ID: ${scanId}`); } catch (error) { console.error("An error occurred:", error); } } submitTextForPlagiarismCheck(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; String scanId = "my-plagiarism-scan"; String base64Content = Base64.getEncoder().encodeToString("Hello world".getBytes(StandardCharsets.UTF_8)); // Configure webhooks SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}"); webhooks.setNewResult("https://your-server.com/webhook/new-results"); // Create submission properties SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); // Configure indexing (this enables plagiarism detection) SubmissionIndexing indexing = new SubmissionIndexing(); indexing.setCopyleaksDb(true); properties.setIndexing(indexing); // Set action to scan (plagiarism is enabled by default) properties.setAction(SubmissionActions.Scan); // Optional: Set sensitivity level for plagiarism detection properties.setSensitivityLevel(3); // 1-5, where 5 is most sensitive // Create and submit the file CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel(base64Content, "file.txt", properties); Copyleaks.submitFile(authToken, scanId, submission); System.out.println("Sent to scanning..."); ``` ### Wait for the completion webhook The scan can take some time. Once it's complete, Copyleaks will send a [completed webhook](/reference/data-types/authenticity/webhooks/scan-completed) to the status URL you provided. This webhook contains a summary of the scan results, including any `result` IDs for found plagiarism matches. ### Export detailed results After the `completed` webhook arrives, use the [export endpoint](/reference/actions/downloads/export) to retrieve the detailed plagiarism [`results`](/reference/data-types/authenticity/results/new-plagiarism-result) using the `result` IDs you received in the completion webhook. We will also export the Crawled Version. The `crawledVersion` webhook contains the text and html version of the document. This can later be used in order to display the report. In addition, you should also specify a `completionWebhook` to receive notifications when the export is ready. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v3/downloads/my-plagiarism-scan/export/ Headers Authorization: Bearer Content-Type: application/json Body {     "completionWebhook":  "https://your.server/export/completed",     "maxRetries": 3,     "developerPayload": "custom_data_identifier",     "crawledVersion": {         "endpoint": "https://your.server/webhook/export/crawled",         "verb": "POST",         "headers": [             [                 "header-key",                 "header-value"             ]         ]     },     "results": [         {             "id": "result-1",             "endpoint": "https://your.server/webhook/export/result/result-1",             "verb": "POST",             "headers": [                 [                     "header-key",                     "header-value"                 ]             ]         }     ] } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v3/downloads/my-plagiarism-scan/export/my-export-1" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "completionWebhook": "https://your-server.com/webhook/export/completion", "maxRetries": 3, "developerPayload": "custom_data_identifier", "crawledVersion": { "endpoint": "https://your-server.com/webhook/export/crawled", "verb": "POST", "headers": { "header-key": "header-value", "header-key-2": "header-value-2" } }, "results": [ { "id": "", "endpoint": "https://your-server.com/webhook/export/result/1", "verb": "POST", "headers": { "header-key": "header-value" } } ] }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.export import Export, ExportResult export_id = "my-export-1" export = Export() export.set_completion_webhook('https://your-server.com/webhook/export/completion') # Export a specific plagiarism result result1 = ExportResult() result1.set_id('') result1.set_endpoint('https://your-server.com/webhook/export/result/1') # Only URL result1.set_verb('POST') # HTTP method separately export.set_results([result1]) Copyleaks.export(auth_token, scan_id, export_id, export) print("Export initiated.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksExportModel } = require('plagiarism-checker'); async function exportPlagiarismResults() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = "YOUR_SCAN_ID"; // The ID of the scan you want to export const exportId = `export-${scanId}-${Date.now()}`; const WEBHOOK_URL = "https://your-server.com/webhook"; // The result IDs to export, obtained from the completion webhook const resultIdsToExport = ["RESULT_ID_1", "RESULT_ID_2"]; const results = resultIdsToExport.map(resultId => ({ id: resultId, endpoint: `${WEBHOOK_URL}/export/${exportId}/result/${resultId}`, verb: "POST" })); // Create an export model const exportModel = new CopyleaksExportModel( `${WEBHOOK_URL}/export/${exportId}/completion`, // Completion webhook URL results, { // Request to export the crawled version of the original document endpoint: `${WEBHOOK_URL}/export/${exportId}/crawled-version`, verb: "POST" } ); // Start the export process await copyleaks.exportAsync(loginResult, scanId, exportId, exportModel); console.log(`Export initiated. Export ID: ${exportId}`); } catch (error) { console.error("An error occurred:", error); } } exportPlagiarismResults(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.exports.*; String scanId = "2a1b402420"; // Your scan ID from submission String exportId = "08338e505d"; // Your chosen export ID // Create headers (optional) String[][] headers = new String[][]{ new String[]{"key", "value"}, new String[]{"key2", "value2"} }; // Export specific plagiarism results ExportResults results = new ExportResults( "2a1b402420", // Result ID from completed webhook "https://your.server/webhook/export/result/2a1b402420", // Endpoint URL "POST", // HTTP method headers // Optional headers ); // Create array of results to export ExportResults[] exportResultsArray = new ExportResults[1]; exportResultsArray[0] = results; // Export crawled version of original document ExportCrawledVersion crawledVersion = new ExportCrawledVersion( "https://your.server/webhook/export/result/08338e505d", "POST", headers ); // Create the export model CopyleaksExportModel exportModel = new CopyleaksExportModel( "https://your.server/webhook/export/result/2b42c39fba", // Completion webhook exportResultsArray, // Results to export crawledVersion // Crawled version ); // Execute the export with comprehensive exception handling try { Copyleaks.export(token, scanId, exportId, exportModel); System.out.println("Export initiated successfully."); } catch (ParseException e) { System.out.println("Parse error: " + e.getMessage()); e.printStackTrace(); } catch (AuthExpiredException e) { System.out.println("Authentication expired: " + e.getMessage()); e.printStackTrace(); } catch (UnderMaintenanceException e) { System.out.println("Service under maintenance: " + e.getMessage()); e.printStackTrace(); } catch (RateLimitException e) { System.out.println("Rate limit exceeded: " + e.getMessage()); e.printStackTrace(); } catch (CommandException e) { System.out.println("Command error: " + e.getMessage()); e.printStackTrace(); } catch (ExecutionException e) { System.out.println("Execution error: " + e.getMessage()); e.printStackTrace(); } catch (InterruptedException e) { System.out.println("Process interrupted: " + e.getMessage()); e.printStackTrace(); } ``` ### Summary You have successfully submitted a scan for plagiarism detection and exported the results. You can now handle the results in your application, display them to users, or take further actions based on the findings. ## Next steps Learn how to securely receive and process notifications from Copyleaks. Understand the scan result format and how to display it to your users. --- ## Detect AI-Generated Content in Documents Source: https://docs.copyleaks.com/guides/authenticity/detect-ai-generated-content > Step-by-step guide to detecting AI-generated text in PDF, DOCX, and TXT documents with the Copyleaks API - submit, scan, and export results. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; import SubmissionMethods from '/snippets/submission-methods.mdx'; The Copyleaks Authenticity API is a powerful way to analyze your content for AI-generated text. It allows you to scan documents like PDF, DOCX, TXT, and other [formats](/reference/actions/miscellaneous/supported-ai-text-detection-file-types) to detect whether content was written by humans or generated by AI. This guide will walk you through the process of submitting a document, enabling AI content detection, and exporting the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for scanning For this guide, we'll demonstrate document submission. Each submission requires a unique `scanId` for proper tracking and identification. - **Filename:** The file extension in the `filename` parameter must match your document type (e.g., `.pdf`, `.docx`, `.txt`). See the full [list of supported ai text detection file types](/reference/actions/miscellaneous/supported-ai-text-detection-file-types). - **Content Encoding:** The file content must be Base64 encoded and sent in the `base64` property. **What is Base64 Encoding?** Base64 converts binary files into text strings so they can be sent via JSON. All programming languages have built-in Base64 encoding functions, see the code examples below for your language. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results.
To enable AI detection, ensure `"aiGeneratedText": {"detect": true}` is set in your properties.
```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-ai-detection-scan Headers Authorization: Bearer Content-Type: application/json Body { "base64": "", "filename": "my-file.pdf", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "sandbox": true, "aiGeneratedText": { "detect": true } } } ``` ```bash title="cURL" icon="terminal" # First, encode your PDF file to base64 base64_content=$(base64 -w 0 my-file.pdf) curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/my-ai-detection-scan" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d "{ \"base64\": \"$base64_content\", \"filename\": \"my-file.pdf\", \"properties\": { \"webhooks\": { \"status\": \"https://your-server.com/webhook/{STATUS}\" }, \"sandbox\": true, \"aiGeneratedText\": { \"detect\": true }, \"scanning\": { \"internet\": false } } }" ``` ```python title="Python" icon="python" import base64 import random from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks from copyleaks.models.submit.properties.ai_generated_text import AIGeneratedText print("Submitting a PDF file for AI detection...") # Read and encode the PDF file with open('my-file.pdf', 'rb') as pdf_file: pdf_content = pdf_file.read() BASE64_FILE_CONTENT = base64.b64encode(pdf_content).decode('utf8') FILENAME = "my-file.pdf" # Important: extension must match file type scan_id = random.randint(100, 100000) # generate a random scan id file_submission = FileDocument(BASE64_FILE_CONTENT, FILENAME) # Configure AI-generated text detection ai_generated_text = AIGeneratedText() ai_generated_text.detect = True # Enable AI detection # Configure webhooks for notifications webhooks = SubmitWebhooks() webhooks.set_status('https://your.server/webhook/{STATUS}') webhooks.set_new_result('https://your.server/webhook/new-results') # Pass the webhooks and AI detection settings to ScanProperties scan_properties = ScanProperties(status_webhook='https://your.server/webhook/{STATUS}') scan_properties.set_webhooks(webhooks) scan_properties.set_ai_generated_text(ai_generated_text) scan_properties.set_sandbox(True) # Turn on sandbox mode. Turn off on production. file_submission.set_properties(scan_properties) Copyleaks.submit_file(auth_token, scan_id, file_submission) print("PDF sent to scanning") print("You will be notified via webhook when the scan completes.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); const fs = require('fs'); async function submitFileForAiDetection() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `ai-scan-${Date.now()}`; const WEBHOOK_URL = "https://your-server.com/webhook"; // Read a file and convert it to base64 const filePath = 'path/to/your/document.pdf'; const fileContent = fs.readFileSync(filePath); const base64Content = fileContent.toString('base64'); // Create a submission model const submission = new CopyleaksFileSubmissionModel( base64Content, 'document.pdf', { sandbox: true, // Use sandbox for testing webhooks: { // Copyleaks will notify this URL when the scan is complete. status: `${WEBHOOK_URL}/{STATUS}` }, aiGeneratedText: { detect: true // Enable AI detection } } ); // Submit the file for scanning await copyleaks.submitFileAsync(loginResult, scanId, submission); console.log(`Submission successful. Scan ID: ${scanId}`); } catch (error) { console.error("An error occurred:", error); } } submitFileForAiDetection(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.file.Files; import java.nio.file.Paths; import java.io.IOException; String scanId = "my-ai-detection-scan"; // Read and encode the PDF file byte[] pdfBytes = Files.readAllBytes(Paths.get("my-file.pdf")); String base64Content = Base64.getEncoder().encodeToString(pdfBytes); // Configure webhooks SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}"); webhooks.setNewResult("https://your-server.com/webhook/new-results"); // Create submission properties SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); // Configure AI-generated text detection SubmissionAIGeneratedText aiGeneratedText = new SubmissionAIGeneratedText(); aiGeneratedText.setDetect(true); properties.setAiGeneratedText(aiGeneratedText); // Set action to scan for AI content properties.setAction(SubmissionActions.Scan); // Create and submit the file - Important: extension must match file type CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel( base64Content, "my-file.pdf", properties ); Copyleaks.submitFile(authToken, scanId, submission); System.out.println("PDF sent to scanning..."); ```
### Wait for the completion webhook The scan times differ depending on document length. Once it's complete, Copyleaks will send a [completed webhook](/reference/data-types/authenticity/webhooks/scan-completed) to the status URL you provided. For complete details on the webhook response structure, see the [Scan Completed Webhook Reference](/reference/data-types/authenticity/webhooks/scan-completed). ### Interpreting AI detection results When the scan is complete, check the `notifications.alerts` array in the webhook payload. - If the array is empty or does not contain an alert with the code `suspected-ai-text`, you can assume no AI-generated content was detected. - If such an alert is present, you can inspect its `additionalData` field for a detailed summary of the [AI Detector](https://copyleaks.com/ai-detector) results. ### Export detailed results Once the scan is complete, you'll receive a `completed` webhook. To get the full analysis needed to display a report, you need to export two key pieces of data using the [export endpoint](/reference/actions/downloads/export): 1. **AI Detection Results**: It provides a detailed breakdown of which parts of the text were identified as potentially AI-generated. You'll receive a result ID for the AI detection in the `completed` webhook, which you'll use for the export. See the [AI Detection Result data type](/reference/data-types/authenticity/results/ai-detection). 2. **Crawled Version**: This is the plain text or HTML representation of the original scanned document. See the [Crawled Version data type](/reference/data-types/authenticity/results/crawled-version). Your export request must specify a `completionWebhook` to be notified when the exported data is ready for download. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v3/downloads/my-ai-detection-scan/export/ Headers Authorization: Bearer Content-Type: application/json Body { "completionWebhook": "https://your.server/export/completed", "maxRetries": 3, "developerPayload": "custom_data_identifier", "crawledVersion": { "endpoint": "https://your.server/webhook/export/crawled", "verb": "POST", "headers": [ [ "header-key", "header-value" ] ] }, "results": [ { "id": "ai-result-1", "endpoint": "https://your.server/webhook/export/ai-result/ai-result-1", "verb": "POST", "headers": [ [ "header-key", "header-value" ] ] } ] } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v3/downloads/my-ai-detection-scan/export/my-export-1" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "completionWebhook": "https://your-server.com/webhook/export/completion", "maxRetries": 3, "developerPayload": "custom_data_identifier", "crawledVersion": { "endpoint": "https://your-server.com/webhook/export/crawled", "verb": "POST", "headers": { "header-key": "header-value", "header-key-2": "header-value-2" } }, "results": [ { "id": "", "endpoint": "https://your-server.com/webhook/export/ai-result/1", "verb": "POST", "headers": { "header-key": "header-value" } } ] }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.export import Export, ExportResult export_id = "my-export-1" export = Export() export.set_completion_webhook('https://your-server.com/webhook/export/completion') # Export a specific AI detection result result1 = ExportResult() result1.set_id('') result1.set_endpoint('https://your-server.com/webhook/export/ai-result/1') # Only URL result1.set_verb('POST') # HTTP method separately export.set_results([result1]) Copyleaks.export(auth_token, scan_id, export_id, export) print("Export initiated.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksExportModel } = require('plagiarism-checker'); async function exportAiDetectionResults() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = "YOUR_SCAN_ID"; // The ID of the scan you want to export const exportId = `export-${scanId}-${Date.now()}`; const WEBHOOK_URL = "https://your-server.com/webhook"; // The AI detection result ID to export, obtained from the completion webhook const aiResultId = "AI_RESULT_ID_FROM_WEBHOOK"; const results = [{ id: aiResultId, endpoint: `${WEBHOOK_URL}/export/${exportId}/result/${aiResultId}`, verb: "POST" }]; // Create an export model const exportModel = new CopyleaksExportModel( `${WEBHOOK_URL}/export/${exportId}/completion`, // Completion webhook URL results, { // Request to export the crawled version of the original document endpoint: `${WEBHOOK_URL}/export/${exportId}/crawled-version`, verb: "POST" } ); // Start the export process await copyleaks.exportAsync(loginResult, scanId, exportId, exportModel); console.log(`Export initiated. Export ID: ${exportId}`); } catch (error) { console.error("An error occurred:", error); } } exportAiDetectionResults(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.exports.*; String scanId = "my-ai-detection-scan"; // Your scan ID from submission String exportId = "my-export-1"; // Your chosen export ID // Create headers (optional) String[][] headers = new String[][]{ new String[]{"header-key", "header-value"}, new String[]{"header-key-2", "header-value-2"} }; // Export a specific AI detection result ExportResults aiResult = new ExportResults( "", // Result ID from completed webhook "https://your.server/webhook/export/ai-result/1", // Endpoint URL "POST", // HTTP method headers // Optional headers ); // Create array of results to export ExportResults[] exportResultsArray = new ExportResults[1]; exportResultsArray[0] = aiResult; // Export crawled version of original document ExportCrawledVersion crawledVersion = new ExportCrawledVersion( "https://your.server/webhook/export/crawled", "POST", headers ); // Create the export model CopyleaksExportModel exportModel = new CopyleaksExportModel( "https://your-server.com/webhook/export/completion", // Completion webhook exportResultsArray, // Results to export crawledVersion // Crawled version ); // Execute the export with comprehensive exception handling try { Copyleaks.export(token, scanId, exportId, exportModel); System.out.println("Export initiated successfully."); } catch (ParseException e) { System.out.println("Parse error: " + e.getMessage()); e.printStackTrace(); } catch (AuthExpiredException e) { System.out.println("Authentication expired: " + e.getMessage()); e.printStackTrace(); } catch (UnderMaintenanceException e) { System.out.println("Service under maintenance: " + e.getMessage()); e.printStackTrace(); } catch (RateLimitException e) { System.out.println("Rate limit exceeded: " + e.getMessage()); e.printStackTrace(); } catch (CommandException e) { System.out.println("Command error: " + e.getMessage()); e.printStackTrace(); } catch (ExecutionException e) { System.out.println("Execution error: " + e.getMessage()); e.printStackTrace(); } catch (InterruptedException e) { System.out.println("Process interrupted: " + e.getMessage()); e.printStackTrace(); } ``` ### Summary You have successfully submitted a scan for AI-generated content detection and exported the results. You can now handle the results in your application, display them to users with confidence scores and highlighted AI-generated sections, or take further actions based on the findings.
## Frequently asked questions Set `"aiGeneratedText": { "detect": true }` inside the submission `properties`. Without it, the scan runs without AI-generated text analysis. Documents such as PDF, DOCX, and TXT are supported. See the full [list of supported AI text detection file types](/reference/actions/miscellaneous/supported-ai-text-detection-file-types). Yes. Set `"sandbox": true` in the submission properties. Sandbox mode is free and returns mock results, so you can wire up the flow before going live. When the scan completes, check the `notifications.alerts` array in the webhook payload. An alert with the code `suspected-ai-text` indicates AI-generated content was detected; its `additionalData` field holds the detailed summary. After the `completed` webhook, call the [export endpoint](/reference/actions/downloads/export) with the AI detection result ID to retrieve the [AI Detection Result](/reference/data-types/authenticity/results/ai-detection) and the [Crawled Version](/reference/data-types/authenticity/results/crawled-version) of the document. ## Next steps Learn how to securely receive and process notifications from Copyleaks. Understand the AI detection result format and how to display confidence scores to your users. --- ## Detect Plagiarism in Images Source: https://docs.copyleaks.com/guides/authenticity/image-plagiarism-detection > Learn how to use the Copyleaks Image Plagiarism Detection API to find unauthorized copies of your images across the web. import GuideLogin from '/snippets/guide-login.mdx'; import GuideInstallation from '/snippets/install-sdks.mdx'; The Copyleaks Image Plagiarism Detection API detects unauthorized copies of your images across the web. Submit an image and receive a categorized list of matches - all in a single synchronous API call. This guide walks you through submitting an image and interpreting the results. ## Get started 1. ### 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. 2. ### Installation 3. ### Login 4. ### Submit image for plagiarism check Use the [Image Plagiarism Detection Endpoint](/reference/actions/image-plagiarism-detector/check) to submit an image using `multipart/form-data`. For testing, set `sandbox: true`. Sandbox mode is free and returns mock results without consuming credits. #### Image Requirements - **File size:** Less than 20MB - **Max resolution:** 75 megapixels (width × height ≤ 75,000,000) - **Formats:** JPG, JPEG, PNG, GIF, BMP, WebP, RAW, ICO ```http POST https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check Headers Authorization: Bearer Content-Type: multipart/form-data; boundary=----WebKitFormBoundary Body ------WebKitFormBoundary Content-Disposition: form-data; name="image"; filename="my-photo.jpg" Content-Type: image/jpeg [binary image data] ------WebKitFormBoundary Content-Disposition: form-data; name="filename" my-photo.jpg ------WebKitFormBoundary Content-Disposition: form-data; name="sandbox" false ------WebKitFormBoundary-- ``` ```bash curl -X POST "https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check" \ -H "Authorization: Bearer " \ -F "image=@/path/to/my-photo.jpg" \ -F "filename=my-photo.jpg" \ -F "sandbox=false" ``` ```python import requests url = 'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check' headers = {'Authorization': 'Bearer YOUR_LOGIN_TOKEN'} with open('my-photo.jpg', 'rb') as image_file: files = {'image': ('my-photo.jpg', image_file, 'image/jpeg')} data = {'filename': 'my-photo.jpg', 'sandbox': 'false'} response = requests.post(url, files=files, data=data, headers=headers) result = response.json() print(f"Total matches: {result['matches']['score']['totalMatches']}") print(f"Full matches: {result['matches']['score']['fullMatches']}") print(f"Partial matches: {result['matches']['score']['partialMatches']}") print(f"All matches: {result['matches']['internet']}") ``` ```javascript const imageFile = document.getElementById('fileInput').files[0]; const formData = new FormData(); formData.append('image', imageFile); formData.append('filename', imageFile.name); formData.append('sandbox', 'false'); const response = await fetch( 'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' }, body: formData } ); const result = await response.json(); console.log('Total matches:', result.matches.score.totalMatches); console.log('Full matches:', result.matches.score.fullMatches); console.log('Partial matches:', result.matches.score.partialMatches); console.log('All matches:', result.matches.internet); ``` ```java import java.io.*; import java.net.*; import java.net.http.*; import java.nio.file.*; import java.util.*; String authToken = "YOUR_LOGIN_TOKEN"; String imagePath = "path/to/my-photo.jpg"; String scanId = "my-scan-1"; String boundary = "----WebKitFormBoundary" + System.currentTimeMillis(); byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath)); String filename = "my-photo.jpg"; List parts = new ArrayList<>(); String imagePart = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"image\"; filename=\"" + filename + "\"\r\n" + "Content-Type: image/jpeg\r\n\r\n"; parts.add(imagePart.getBytes()); parts.add(imageBytes); parts.add("\r\n".getBytes()); String rest = "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"filename\"\r\n\r\n" + filename + "\r\n" + "--" + boundary + "\r\n" + "Content-Disposition: form-data; name=\"sandbox\"\r\n\r\nfalse\r\n" + "--" + boundary + "--\r\n"; parts.add(rest.getBytes()); int total = parts.stream().mapToInt(a -> a.length).sum(); byte[] body = new byte[total]; int offset = 0; for (byte[] part : parts) { System.arraycopy(part, 0, body, offset, part.length); offset += part.length; } HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.copyleaks.com/v1/image-plagiarism-detector/" + scanId + "/check")) .header("Authorization", "Bearer " + authToken) .header("Content-Type", "multipart/form-data; boundary=" + boundary) .POST(HttpRequest.BodyPublishers.ofByteArray(body)) .build(); HttpResponse response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println("Response: " + response.body()); ``` 5. ### Interpreting the response A successful response contains scan metadata and a `matches` object with: - **`matches.internet`** - All matching images found on the web. Each entry has a `url`, a `matchType`, and an optional `webPages` list: - `0` - **Full match**: Exact or near-exact copy of the submitted image. - `1` - **Partial match**: Cropped, resized, recolored, or otherwise modified version. - **`webPages`** - The web pages where the image was found (each with a `url`). Omitted when the image was not located on any page. The same image URL never appears more than once. - **`matches.score`** - A summary with `totalMatches`, `fullMatches`, and `partialMatches` counts. - **`scannedImage`** - Metadata about the submitted image: scan ID, credits charged, dimensions, filename, and creation time. ```json { "developerPayload": null, "scannedImage": { "scanId": "my-scan-1", "expectedCredits": 1, "actualCredits": 1, "creationTime": "2026-05-24T10:00:00Z", "width": 1920, "height": 1080, "filename": "my-photo.jpg" }, "matches": { "internet": [ { "url": "https://example.com/images/photo.jpg", "matchType": 0, "webPages": [ { "url": "https://example.com/blog/my-post" }, { "url": "https://example.org/news/article" } ] }, { "url": "https://example.com/thumbs/photo-thumb.jpg", "matchType": 1, "webPages": [ { "url": "https://example.org/gallery" } ] }, { "url": "https://example.org/gallery/photo-sm.jpg", "matchType": 1 } ], "score": { "totalMatches": 3, "fullMatches": 1, "partialMatches": 2 } } } ``` An empty `matches.internet` array with all-zero scores means no matching content was found on the web. 6. ### Summary You have successfully checked your image for plagiarism. You can now use the match URLs in your application to alert users, file takedown requests, or record provenance data. ## Next steps Full API reference for the Image Plagiarism Detection endpoint. Detailed breakdown of every field in the Image Plagiarism Detection response. --- ## Assess Writing in Documents Source: https://docs.copyleaks.com/guides/authenticity/assess-writing-in-documents > A comprehensive guide to using the Copyleaks Grammar Checker API for assessing writing in documents. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; import SubmissionMethods from '/snippets/submission-methods.mdx'; The Copyleaks Grammar Checker API is a powerful tool to help improve the quality of written content by providing detailed feedback on grammar, spelling, sentence structure, and word choice. This guide will walk you through the process of submitting documents for writing assessment and retrieving the detailed feedback. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for writing assessment For this guide, we'll demonstrate document submission for writing assessment. Each submission requires a unique `scanId` for proper tracking and identification. - **Filename:** The file extension in the `filename` parameter must match your document type (e.g., `.pdf`, `.docx`, `.txt`). See the full [list of supported file types](/reference/actions/miscellaneous/supported-plagiarism-file-types). - **Content Encoding:** The file content must be Base64 encoded and sent in the `base64` property. **What is Base64 Encoding?** Base64 converts binary files into text strings so they can be sent via JSON. All programming languages have built-in Base64 encoding functions, see the code examples below for your language. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results.
To enable writing assessment, ensure `"writingFeedback": {"enable": true}` is set in your properties.
```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-writing-assessment-scan Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "base64": "SGVsbG8gd29ybGQuIFRoaXMgaXMgYW4gZXhhbXBsZSB0ZXh0IHRvIGJlIGNoZWNrZWQgZm9yIGdyYW1tYXIgZXJyb3JzLg==", "filename": "my-document.txt", "properties": { "sandbox": true, "webhooks": { "status": "https://your.server/webhook/{STATUS}" }, "writingFeedback": { "enable": true } } } ``` ```bash title="cURL" icon="terminal" # First, encode your file to base64 base64_content=$(base64 -w 0 my-document.docx) curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/my-writing-assessment-scan" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_LOGIN_TOKEN" \ -d '{ "base64": "'$base64_content'", "filename": "my-document.docx", "properties": { "sandbox": true, "webhooks": { "status": "https://your.server/webhook/{STATUS}" }, "writingFeedback": { "enable": true } } }' ``` ```python title="Python" icon="python" import base64 import random from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks from copyleaks.models.submit.properties.writing_feedback import WritingFeedback print("Submitting a document for writing assessment...") # Read and encode the file with open('my-document.docx', 'rb') as file: file_content = file.read() base64_file_content = base64.b64encode(file_content).decode('utf8') # Generate a random scan ID or use a meaningful identifier scan_id = f"writing-scan-{random.randint(100, 100000)}" # Create a file submission file_submission = FileDocument(base64_file_content, "my-document.docx") # Configure Grammar Checker writing_feedback = WritingFeedback() writing_feedback.enable = True # Configure webhooks for notifications webhooks = SubmitWebhooks() webhooks.set_status('https://your.server/webhook/{STATUS}') # Set up scan properties scan_properties = ScanProperties(status_webhook='https://your.server/webhook/{STATUS}') scan_properties.set_webhooks(webhooks) scan_properties.set_writing_feedback(writing_feedback) scan_properties.set_sandbox(True) # Turn on sandbox mode. Turn off on production. # Add properties to the submission file_submission.set_properties(scan_properties) # Submit the document for assessment Copyleaks.submit_file(auth_token, scan_id, file_submission) print("Document sent for writing assessment") print("You will be notified via webhook when the assessment completes.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); const fs = require('fs'); async function submitForWritingAssessment() { try { // Read the file and encode it as base64 const fileContent = fs.readFileSync('my-document.docx'); const base64Content = fileContent.toString('base64'); // Generate a unique scan ID const scanId = `writing-scan-${Date.now()}`; // Create the submission properties const properties = { sandbox: true, // Set to false in production webhooks: { status: 'https://your.server/webhook/{STATUS}' }, writingFeedback: { enable: true, // Optionally customize scoring weights score: { grammarScoreWeight: 1.0, mechanicsScoreWeight: 1.0, sentenceStructureScoreWeight: 1.0, wordChoiceScoreWeight: 1.0 } } }; // Create the submission model const submission = new CopyleaksFileSubmissionModel( base64Content, 'my-document.docx', properties ); // Get authentication token const loginResult = await Copyleaks.login(EMAIL, API_KEY); const authToken = loginResult.access_token; // Submit the document for assessment await Copyleaks.submitFile(authToken, scanId, submission); console.log(`Document submitted for writing assessment with scan ID: ${scanId}`); console.log('You will be notified via webhook when the assessment completes.'); } catch (error) { console.error('Error submitting document:', error); } } submitForWritingAssessment(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.file.Files; import java.nio.file.Paths; import java.io.IOException; public class WritingAssessmentExample { public static void main(String[] args) { try { // Read the file and encode it as base64 byte[] fileBytes = Files.readAllBytes(Paths.get("my-document.docx")); String base64Content = Base64.getEncoder().encodeToString(fileBytes); // Set scan ID String scanId = "writing-scan-" + System.currentTimeMillis(); // Configure webhooks SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your.server/webhook/{STATUS}"); // Create submission properties SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); // Set to false in production // Enable writing feedback WritingFeedback writingFeedback = new WritingFeedback(); writingFeedback.setEnable(true); properties.setWritingFeedback(writingFeedback); // Create and submit the file CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel( base64Content, "my-document.docx", properties ); // Submit the document Copyleaks.submitFile(authToken, scanId, submission); System.out.println("Document sent for writing assessment with scan ID: " + scanId); System.out.println("You will be notified via webhook when the assessment completes."); } catch (Exception e) { e.printStackTrace(); } } } ```
### Wait for the completion webhook Once the scan is complete, Copyleaks will send a [completed webhook](/reference/data-types/authenticity/webhooks/scan-completed) to the status URL you provided. When Grammar Checker is enabled, the webhook response will include a `writingFeedback` section with detailed information about the writing quality. For complete details on the webhook response structure, see the [Scan Completed Webhook Reference](/reference/data-types/authenticity/webhooks/scan-completed). ### Interpreting writing assessment results The completed webhook contains a `writingFeedback` object with the [Correction Types](/reference/data-types/writing/correction-types): 1. **textStatistics**: Basic metrics about the text, including sentence count, average word and sentence length, and estimated reading time. 2. **score**: Detailed breakdown of writing quality across four categories: - Grammar - Mechanics (spelling, punctuation) - Sentence Structure - Word Choice Each category includes both a count of corrections and a score (0-100). 3. **readability**: An assessment of how easy the text is to read, including: - Overall readability score (0-100) - Readability level (grade level) - Text description of the readability ### Export detailed results To get the specific writing corrections, you need to export the detailed results using the [export endpoint](/reference/actions/downloads/export): ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v3/downloads/my-writing-assessment-scan/export/my-export-1 Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "writingFeedback": { "corrections": true, "verb": "POST", "headers": [ ["Content-Type", "application/json"] ], "endpoint": "https://your.server/export/writing-feedback" }, "completionWebhook": "https://your.server/webhook/export/completion", "maxRetries": 3, "developerPayload": "writing-assessment-export" } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v3/downloads/my-writing-assessment-scan/export/my-export-1" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_LOGIN_TOKEN" \ -d '{ "writingFeedback": { "corrections": true, "verb": "POST", "headers": [ ["Content-Type", "application/json"] ], "endpoint": "https://your.server/export/writing-feedback" }, "completionWebhook": "https://your.server/webhook/export/completion", "maxRetries": 3, "developerPayload": "writing-assessment-export" }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.export import Export, ExportResults, WritingFeedbackExport from copyleaks.models.export.http_method import HttpMethod from copyleaks.models.export.endpoint import Endpoint # Set up the export export_id = "my-export-1" # Configure what to export export = Export() export.set_completion_webhook('https://your.server/webhook/export/completion') # Add optional parameters export.set_max_retries(3) # Default is 3, can be 1-12 export.set_developer_payload("writing-assessment-export") # Custom identifier # Request writing feedback corrections with endpoint writing_feedback = WritingFeedbackExport() writing_feedback.set_corrections(True) writing_feedback.set_endpoint(Endpoint( HttpMethod.POST, "https://your.server/export/writing-feedback", [["Content-Type", "application/json"]] )) export.set_writing_feedback(writing_feedback) # Start the export process Copyleaks.export(auth_token, scan_id, export_id, export) print(f"Export requested with ID: {export_id}") print("You will be notified via webhook when the export is ready.") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksExportModel } = require('plagiarism-checker'); async function exportWritingFeedback() { try { const scanId = 'my-writing-assessment-scan'; const exportId = 'my-export-1'; // Configure the export const exportRequest = { writingFeedback: { corrections: true, verb: "POST", headers: [ ["Content-Type", "application/json"] ], endpoint: "https://your.server/export/writing-feedback" }, completionWebhook: 'https://your.server/webhook/export/completion', maxRetries: 3, // Default is 3, can be 1-12 developerPayload: "writing-assessment-export" // Custom identifier }; // Get authentication token const loginResult = await Copyleaks.login(EMAIL, API_KEY); const authToken = loginResult.access_token; // Request the export await Copyleaks.export(authToken, scanId, exportId, exportRequest); console.log(`Export requested with ID: ${exportId}`); console.log('You will be notified via webhook when the export is ready.'); } catch (error) { console.error('Error exporting results:', error); } } exportWritingFeedback(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.exports.*; import java.util.ArrayList; import java.util.List; public class ExportWritingFeedbackExample { public static void main(String[] args) { try { String scanId = "my-writing-assessment-scan"; String exportId = "my-export-1"; // Create headers for endpoints List headers = new ArrayList<>(); headers.add(new EndpointHeader("Content-Type", "application/json")); // Configure writing feedback export with endpoint WritingFeedbackExport writingFeedback = new WritingFeedbackExport(); writingFeedback.setCorrections(true); writingFeedback.setEndpoint( new ExportEndpoint( HttpMethod.POST, "https://your.server/export/writing-feedback", headers ) ); // Create complete export request CopyleaksExportModel export = new CopyleaksExportModel(); export.setCompletionWebhook("https://your.server/webhook/export/completion"); export.setWritingFeedback(writingFeedback); // Add optional parameters export.setMaxRetries(3); // Default is 3, can be 1-12 export.setDeveloperPayload("writing-assessment-export"); // Custom identifier // Request the export Copyleaks.export(authToken, scanId, exportId, export); System.out.println("Export requested with ID: " + exportId); System.out.println("You will be notified via webhook when the export is ready."); } catch (Exception e) { e.printStackTrace(); } } } ``` ### Summary You have successfully submitted a document for writing assessment and exported the detailed correction recommendations. You can now integrate these corrections into your application, display them to users, or use them to improve the document's quality.
## Next steps View the complete API reference for the Grammar Checker endpoints. Learn about the detailed structure of Grammar Checker data, including corrections and scores. Explore different ways to integrate writing feedback into your applications. Understand how to use webhooks to receive notifications about scan completions and results. --- ## Exclude Template Text Source: https://docs.copyleaks.com/guides/authenticity/exclude-template-text > A guide on how to exclude template text from plagiarism scans using the Copyleaks API. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; The **Exclude Template** feature allows you to refine the analysis of documents by excluding specific sections based on a predefined template. This is particularly useful for scenarios like checking student exams where the questions are the same for everyone, and you only want to scan the student's answers. This guide will walk you through the process of creating a template and then using it to exclude content from your scans. ## How it works To better understand how template exclusion works, consider the following scenario where a teacher wants to scan student exams but exclude the questions. | The Template _(indexed beforehand)_ | Student Submission _(the file you scan)_ | What Copyleaks Scans _(the actual analysis)_ | | :--- | :--- | :--- | | Question 1: Explain the process of photosynthesis. | Question 1: Explain the process of photosynthesis.

Answer: Photosynthesis is the process used by plants... | ~~Question 1: Explain the process of photosynthesis.~~

Answer: Photosynthesis is the process used by plants... | By excluding the template text, the plagiarism scan focuses solely on the student's original answer, preventing false positives from the question text itself. ## Template sourcing Templates for exclusion can be referenced in two ways: - **From a normal submitted scan:** Reference any existing `scanId` from your submissions (saved short-term which is determined by the `expiration` property). - **From your Private Cloud Hub:** Index the template document into your [**Private Cloud Hub**](/concepts/features/data-hubs/) (for recurring or long-term use). This approach is widely used by many institutions to ensure that commonly repeated content, such as exam questions, rubrics, or boilerplate instructions, does not affect results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Create a template (index a document) First, you need to submit the document that contains the text you want to exclude (the template). You will "index" this document into a repository (either in your Private Cloud Hub or Shared Data Hub). In this example, we will submit a file with the ID `my-template-index` to a repository named `my_private_cloud_exam_template`. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-template-index Content-Type: application/json Authorization: Bearer { "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "exam_template.txt", "properties": { "action": 2, "indexing": { "repositories": [ { "id": "6e870e0bb2264", "includeMySubmissions": true, "includeOthersSubmissions": true } ], "copyleaksDb": false }, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" } } } ``` ```bash title="cURL" icon="terminal" curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/my-template-index" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "exam_template.txt", "properties": { "action": 2, "indexing": { "repositories": [ { "id": "6e870e0bb2264", "includeMySubmissions": true, "includeOthersSubmissions": true } ], "copyleaksDb": false }, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "sandbox": true } }' ``` ```python title="Python" icon="python" import requests import base64 # Template content template_content = "This is the exam template text." base64_content = base64.b64encode(template_content.encode()).decode('utf-8') url = "https://api.copyleaks.com/v3/scans/submit/file/my-template-index" payload = { "base64": base64_content, "filename": "exam_template.txt", "properties": { "action": 2, "indexing": { "repositories": [ { "id": "6e870e0bb2264", "includeMySubmissions": True, "includeOthersSubmissions": True } ], "copyleaksDb": False }, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "sandbox": True } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript title="JavaScript" icon="square-js" const axios = require('axios'); const url = 'https://api.copyleaks.com/v3/scans/submit/file/my-template-index'; const headers = { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }; const data = { base64: "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", filename: "exam_template.txt", properties: { action: 2, indexing: { repositories: [ { id: "6e870e0bb2264", includeMySubmissions: true, includeOthersSubmissions: true } ], copyleaksDb: false }, webhooks: { status: "https://your-server.com/webhook/{STATUS}" }, sandbox: true } }; axios.put(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; String scanId = "my-template-index"; String base64Content = Base64.getEncoder().encodeToString("This is the exam template text.".getBytes(StandardCharsets.UTF_8)); // Create submission properties SubmissionProperties properties = new SubmissionProperties(new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}")); properties.setSandbox(true); // Action 2 is 'Index Only' properties.setAction(SubmissionActions.IndexOnly); // Configure indexing to Private Cloud Hub SubmissionIndexingRepository repo = new SubmissionIndexingRepository(); repo.setId("6e870e0bb2264"); SubmissionIndexing indexing = new SubmissionIndexing(); // Requires copyleaks-java-sdk SubmissionIndexing.setRepositories (coming soon) indexing.setRepositories(new SubmissionIndexingRepository[]{ repo }); properties.setIndexing(indexing); // Create and submit the file CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel(base64Content, "exam_template.txt", properties); Copyleaks.submitFile(authToken, scanId, submission); System.out.println("Template indexed successfully."); ``` Make sure to keep track of the `scanId` (in this case `my-template-index`) as you will need it for the next step. ### Scan with template exclusion Now that you have a template indexed, you can submit a new document for scanning and tell Copyleaks to exclude the content of the template. Use the `properties.exclude.documentTemplateIds` field to specify the template ID. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/student-exam-submission Content-Type: application/json Authorization: Bearer { "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "student_submission.txt", "properties": { "action": 0, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "exclude": { "documentTemplateIds": ["my-template-index"] }, "indexing": { "repositories": [ { "id": "your-repo-id", "includeMySubmissions": true, "includeOthersSubmissions": true } ], "copyleaksDb": false }, "aiGeneratedText": { "detect": true }, "sandbox": true } } ``` ```bash title="cURL" icon="terminal" curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/student-exam-submission" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "student_submission.txt", "properties": { "action": 0, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "exclude": { "documentTemplateIds": ["my-template-index"] }, "indexing": { "repositories": [ { "id": "your-repo-id", "includeMySubmissions": true, "includeOthersSubmissions": true } ], "copyleaksDb": false }, "aiGeneratedText": { "detect": true }, "sandbox": true } }' ``` ```python title="Python" icon="python" import requests import base64 # Student submission content student_content = "This is the student's answer mixed with template text." base64_content = base64.b64encode(student_content.encode()).decode('utf-8') url = "https://api.copyleaks.com/v3/scans/submit/file/student-exam-submission" payload = { "base64": base64_content, "filename": "student_submission.txt", "properties": { "action": 0, "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "exclude": { "documentTemplateIds": ["my-template-index"] }, "indexing": { "repositories": [ { "id": "your-repo-id", "includeMySubmissions": True, "includeOthersSubmissions": True } ], "copyleaksDb": False }, "aiGeneratedText": { "detect": True }, "sandbox": True } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript title="JavaScript" icon="square-js" const axios = require('axios'); const url = 'https://api.copyleaks.com/v3/scans/submit/file/student-exam-submission'; const headers = { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }; const data = { base64: "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", filename: "student_template.txt", properties: { action: 0, webhooks: { status: "https://your-server.com/webhook/{STATUS}" }, exclude: { documentTemplateIds: ["my-template-index"] }, indexing: { repositories: [ { id: "your-repo-id", includeMySubmissions: true, includeOthersSubmissions: true } ], copyleaksDb: false }, aiGeneratedText: { detect: true }, sandbox: true } }; axios.put(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; String scanId = "student-exam-submission"; String base64Content = Base64.getEncoder().encodeToString("This is the student's answer mixed with template text.".getBytes(StandardCharsets.UTF_8)); // Create submission properties SubmissionProperties properties = new SubmissionProperties(new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}")); properties.setSandbox(true); // Set document templates to exclude SubmissionExclude exclude = new SubmissionExclude(); exclude.setDocumentTemplateIds(new String[]{"my-template-index"}); properties.setExclude(exclude); // Create and submit the file CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel(base64Content, "student_submission.txt", properties); Copyleaks.submitFile(authToken, scanId, submission); System.out.println("Scan submitted with template exclusion."); ``` You can provide multiple template IDs in the `documentTemplateIds` array if you need to exclude content from multiple templates. ### Summary You have just: - Created a template document and indexed it - Submitted a scan with template exclusion - Excluded template text from your plagiarism analysis ## Next steps Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## Validate References Source: https://docs.copyleaks.com/guides/authenticity/validate-references > A guide on how to validate the references and citations in a document using the Copyleaks API. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; For what References Validation does and when to use it, see the [References Validation](/concepts/features/references-validation) concept page. This guide will walk you through submitting a scan with reference validation turned on, reading the summary from the completed webhook, and fetching the full per-reference results. ## How it works Each detected reference is sorted into one of two categories, and each category is validated differently: | Reference type | How Copyleaks validates it | What you get back | | :--- | :--- | :--- | | **Academic** _(papers, journal articles)_ | Looked up in the Copyleaks academic citation index by title, then corroborated on year and authors. | Parsed fields plus matching source suggestions with per-field signals. | | **Non-academic** _(web pages, docs, blogs, encyclopedias)_ | The cited URL is fetched live and its title, year, and authors are compared to what was cited. | Parsed fields plus the fetched source as a suggestion with per-field signals. | A reference is counted as validated only when the top suggestion matches the title and no checked field contradicts it. Fields that could not be checked are simply ignored - they do not count against the reference. ## Get started Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. Submit a document for scanning and turn reference validation on. Use the top-level `properties.references.validate` field and set it to `true`. If you omit the section entirely, validation defaults to `false`. This example also disables internet plagiarism scanning (`scanning.internet: false`) so the scan runs references-only. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-scan-id Content-Type: application/json Authorization: Bearer { "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "paper_with_references.txt", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "scanning": { "internet": false }, "references": { "validate": true } } } ``` ```bash title="cURL" icon="terminal" curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/my-scan-id" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "paper_with_references.txt", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "scanning": { "internet": false }, "references": { "validate": true } } }' ``` ```python title="Python" icon="python" import requests import base64 # Document content (your text with references) document_content = "This is a test document with references." base64_content = base64.b64encode(document_content.encode()).decode('utf-8') url = "https://api.copyleaks.com/v3/scans/submit/file/my-scan-id" payload = { "base64": base64_content, "filename": "paper_with_references.txt", "properties": { "webhooks": { "status": "https://your-server.com/webhook/{STATUS}" }, "scanning": { "internet": False }, "references": { "validate": True } } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript title="JavaScript" icon="square-js" const axios = require('axios'); const url = 'https://api.copyleaks.com/v3/scans/submit/file/my-scan-id'; const headers = { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }; const data = { base64: "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", filename: "paper_with_references.txt", properties: { webhooks: { status: "https://your-server.com/webhook/{STATUS}" }, scanning: { internet: false }, references: { validate: true } } }; axios.put(url, data, { headers }) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; String scanId = "my-scan-id"; String base64Content = Base64.getEncoder().encodeToString("This is a test document with references.".getBytes(StandardCharsets.UTF_8)); // Create submission properties SubmissionProperties properties = new SubmissionProperties(new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}")); // Disable plagiarism so the scan runs references-only SubmissionScanning scanning = new SubmissionScanning(); scanning.setInternet(false); properties.setScanning(scanning); // Turn reference validation on SubmissionReferences references = new SubmissionReferences(); references.setValidate(true); properties.setReferences(references); // Create and submit the file CopyleaksFileSubmissionModel submission = new CopyleaksFileSubmissionModel(base64Content, "paper_with_references.txt", properties); Copyleaks.submitFile(authToken, scanId, submission); System.out.println("Scan submitted with reference validation."); ``` Keep track of the `scanId` (in this case `my-scan-id`). You will need it to fetch the full per-reference results once the scan completes. When the scan finishes, Copyleaks sends the completed webhook to the `status` URL you provided. The payload reports that validation ran via `scannedDocument.enabled.referencesValidation`, and adds a top-level `referencesValidation.summary` with the counts. ```json title="Completed webhook (excerpt)" { "scannedDocument": { "enabled": { "referencesValidation": true } }, "referencesValidation": { "summary": { "total": 2, "academic": 1, "academicValidated": 1, "nonAcademicValidated": 0 } } } ``` The summary fields are: - `total` - total references detected in the document. - `academic` - how many of those were academic. - `academicValidated` - academic references that were fully corroborated. - `nonAcademicValidated` - non-academic references that were fully corroborated. The completed webhook carries the summary only. To see each individual reference, what was parsed, and which sources corroborated it, fetch the crawled version in the next step. The completed webhook gives you the summary only. The full per-reference results live in the [crawled version](/reference/data-types/authenticity/results/crawled-version) of the scan. Retrieve it with the [Export method](/reference/actions/downloads/export), using the `scanId` from your submission. The exported crawled version contains a top-level `referencesValidation` block: the same `summary` plus a `results` array with one entry per reference. For the full field-by-field response schema, including how a reference counts as validated and the strict `year` matching rule, see the [References Validation results](/reference/data-types/authenticity/results/crawled-version#references-validation) data type. You have just: - Submitted a scan with reference validation turned on via `references.validate` - Read the validation counts from the completed webhook summary - Fetched the crawled version to inspect each parsed reference and its corroborating sources ## Next steps Understand the concepts behind reference detection, parsing, and corroboration before you build. The full field reference for the summary and per-reference results, including signals and suggestions. Run AI detection on uploaded documents as part of a full authenticity scan. Submit text or files and get a plagiarism report with matched sources. --- # Guides → Authenticity → Display ## Display Guides Source: https://docs.copyleaks.com/guides/display/overview > Embed and customize Copyleaks scan reports in your own application. Surface plagiarism, AI detection, and grammar reports inside your app. Choose between the hosted iframe (zero setup) or the open-source module (full theming control). Drop in an iframe to display detailed plagiarism and AI detection reports, no rendering work required. Integrate the open-source report module for full control over styling, layout, and theming. --- ## Embed Hosted Web Report Source: https://docs.copyleaks.com/guides/display/embed-hosted-web-report > Embed the Copyleaks hosted web report in your application to display detailed plagiarism and AI detection results, with no rendering work required. The Copyleaks Hosted Web Report provides a seamless way to display detailed plagiarism and [AI detection](https://copyleaks.com/ai-detector) reports within your application. This guide will walk you through the process of embedding the report. ## Get started ### Before you begin Before you begin, ensure you have the following: - A way to generate the required JSON data for the report. This is usually done by using the [Copyleaks API](/reference/actions/authenticity/submit-url/) to perform a scan and then exporting the results. - A publicly accessible server to host the JSON data file. ### Generate the JSON data The Hosted Web Report requires a JSON file with a specific structure. This file contains all the necessary information to render the report correctly. For a detailed explanation of the JSON data structure, refer to the [JSON Schema reference](/reference/data-types/authenticity/webhooks/overview). Here is an example of the JSON data: ```json { "input": { "requestParams": { "headers": { "Authorization": "***token****", "header_key2": "header_value1", "header_key3": "header_value2" } }, "crawledVersion": "https://example.com/api/scans/scanid/scan-source.json", "completedWebhook": "https://example.com/api/scans/scanid/complete_result.json", "writingFeedback": "https://example.com/api/scans/scanid/writing_feedback.json", "result": "https://example.com/api/scans/scanid/results/{RESULT_ID}.json", "pdf": "https://example.com/api/scans/scanid/report.pdf" }, "customizations": { "companyLogo": "https://example.com/logo.svg", "accessExpired": { "httpResponsesCode": [ 403, 401 ], "customMessage": "*Custom Error Message*", "redirectUrl": "https://example.com/login" } } } ``` ### Host the JSON file The JSON file must be hosted on a publicly accessible server. The URL of this file will be used to load the report. - The URL must be publicly accessible. - Your server must allow Cross-Origin Resource Sharing (CORS) to the `https://report.sand-box.info` domain. ### Embed the report You can embed the Hosted Web Report in your application using an ` ``` ## Next steps Learn how to export the results of a scan to generate the JSON data for the report. Explore the different customization options available for the Hosted Web Report. ## Support If you have any questions or need help, contact our [support team](https://help.copyleaks.com/hc/en-us/requests/new). --- ## Install Open Source Web Report Source: https://docs.copyleaks.com/guides/display/install-open-source-report > Integrate the Copyleaks open-source web report module into your app to display plagiarism, AI detection, and grammar results with full theming control. This guide provides detailed instructions for integrating Copyleaks' web report module into your Angular application to display plagiarism detection, AI content detection, and Grammar Checker reports while maintaining your brand identity. Copyleaks Web Report is an [Angular](https://angular.dev/) module designed to integrate plagiarism and AI detection reporting seamlessly into your application. This module offers a user-friendly, engaging, and flexible interface for presenting plagiarism and AI content reports, showcasing the authenticity and uniqueness of submitted files or text. ### Key features - **Customizable Layouts**: Various layout options for report display - **Responsive Design**: Adapts to different screen sizes for consistent user experience - **API Integration**: Configurable endpoints for efficient data retrieval - **Accessibility Focused**: Inclusive design for a wider range of users - **Error Handling**: Effective management of data retrieval errors ## Get started ### Before you begin Before you begin, ensure you have: - A [Copyleaks account](https://api.copyleaks.com/signup) with the ability to complete successful scans and store results - Server-side application with access to stored Copyleaks reports - Angular application (version compatibility detailed below) - Familiarity with the Copyleaks' Authenticity API. If you haven't tried it yet, get started with the [Detect Plagiarism](/guides/authenticity/detect-plagiarism-text/) guide ### Installation First, select the version corresponding to your Angular version: | Angular Version | Library Version | | ------- | ------------------------ | | Angular 13 | 1.x.x (latest: 1.9.99) | | Angular 19 | 2.x.x (starting at 2.0.0) | Then, install the package: ```bash "Angular 13" npm install @copyleaks/ng-web-report@^1.9.99 --save ``` ```bash "Angular 19" npm install @copyleaks/ng-web-report@^2.0.0 --save ``` Finally, ensure the following peer dependencies are installed: **For Angular 13 (v1.x.x)** | Dependency | Version | | -------------------------- | --------------- | | @angular/common | ^13.1.1 | | @angular/core | ^13.1.1 | | @angular/localize | ^13.1.1 | | @angular/material | ^13.1.1 | | @angular/flex-layout | ^13.0.0-beta.36 | | scroll-into-view-if-needed | ^2.2.28 | | ngx-skeleton-loader | ^5.0.0 | ```bash npm install @angular/localize@^13.1.1 @angular/material@^13.1.1 @angular/flex-layout@^13.0.0-beta.36 scroll-into-view-if-needed@^2.2.28 ngx-skeleton-loader@^5.0.0 --save ``` **For Angular 19 (v2.x.x)** | Dependency | Version | | -------------------------- | --------------- | | @angular/common | ^19.2.14 | | @angular/core | ^19.2.14 | | @angular/localize | ^19.2.14 | | @angular/material | ^19.2.19 | | ngx-flexible-layout | ^19.0.0 | | scroll-into-view-if-needed | ^2.2.28 | | ngx-skeleton-loader | ^6.0.0 | | @swimlane/ngx-charts | ^22.0.0 | ```bash npm install @angular/localize@^19.2.14 @angular/material@^19.2.19 ngx-flexible-layout@^19.0.0 scroll-into-view-if-needed@^2.2.28 ngx-skeleton-loader@^6.0.0 @swimlane/ngx-charts@^22.0.0 --save ``` ### Integration The general integration process follows these steps: 1. Create a Copyleaks account 2. Use Copyleaks API to scan for plagiarism 3. Use the [Export Methods](/reference/actions/downloads/export/) to extract data and save it on your server/cloud 4. Create HTTP endpoints to access the stored data 5. Present the data in your website via the Copyleaks web report module ### Implementation Add `CopyleaksWebReportModule` and `HttpClientModule` to your module's imports: ```typescript // app.module.ts import { CopyleaksWebReportModule } from '@copyleaks/ng-web-report'; import { HttpClientModule } from '@angular/common/http'; @NgModule({ declarations: [AppComponent], imports: [ // ... CopyleaksWebReportModule, HttpClientModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule {} ``` Create an endpoint configuration object that tells the report component where to fetch data, and then add the component to your template. ```typescript your.component.ts // your.component.ts import { IClsReportEndpointConfigModel, IEndpointDetails } from '@copyleaks/ng-web-report'; @Component({ // ... }) export class YourComponent { public endpointConfig: IClsReportEndpointConfigModel; constructor() { // Define your endpoint configuration this.endpointConfig = { crawledVersion: { url: 'https://your-api.com/copyleaks/{scanId}/source', headers: { 'Authorization': 'Bearer your-token', 'Content-Type': 'application/json' } }, completeResults: { url: 'https://your-api.com/copyleaks/{scanId}/completed', headers: { 'Authorization': 'Bearer your-token', 'Content-Type': 'application/json' } }, result: { url: 'https://your-api.com/copyleaks/{scanId}/results/{RESULT_ID}', headers: { 'Authorization': 'Bearer your-token', 'Content-Type': 'application/json' } } // Optional: progress endpoint for real-time results // progress: { ... } }; } // Event handlers handleError(error: ReportHttpRequestErrorModel): void { // Your error handling logic here console.error('Report request error:', error); } handleUpdate(results: ICompleteResults): void { // Your logic for processing report updates here console.log('Complete results updated:', results); } } ``` ```html your.component.html ``` ### Advanced customization You can add custom actions, tabs, and more to the report interface. Here are a few examples: **Custom Actions** ```html ``` **Custom Tabs** ```html Custom Analysis

Additional Analysis

Your custom analysis content here...

```
### Summary You have successfully integrated the Copyleaks Web Report into your Angular application. You can now display detailed plagiarism and AI detection reports to your users.
## Query parameters The report component interprets several query parameters: | Parameter | Type | Description | | ----------- | ------ | --------------------------------------------------- | | contentMode | string | Determines content view type ('text' or 'html') | | sourcePage | number | Page number in text view pagination (starts from 1) | | suspectPage | number | Page number in text view pagination (starts from 1) | | suspectId | string | Identifier of the selected matching result | | alertCode | string | Code of the selected alert | ## Next steps Access the source code and contribute to the development of the Copyleaks Web Report. Review the Voluntary Product Accessibility Template (VPAT) report for accessibility compliance. ## Support Should you require any assistance or have inquiries, contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. --- # Guides → Moderation ## Moderate Text Source: https://docs.copyleaks.com/guides/moderation/moderate-text > Scan and moderate text for unsafe or policy-relevant material across 10+ categories with the Text Moderation API. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; The Copyleaks [Text Moderation](https://copyleaks.com/text-moderation) API empowers you to build safer online environments by proactively identifying and flagging harmful or risky content in real-time. With support for a broad range of categories-including hate speech, toxic language, and more-our API provides the tools you need to enforce your community standards effectively. This guide will walk you through submitting text for moderation and building a robust workflow based on the results. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Submit for moderation Use the [Text Moderation Endpoint](/reference/actions/text-moderation/check). Provide a unique `scanId` for each request. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v1/text-moderation/my-scan-1/check Authorization: Bearer Content-Type: application/json { "text": "Your text content to be moderated goes here.", "sandbox": true, "language": "en", "labels": [ { "id": "toxic-v1" }, { "id": "profanity-v1" }, { "id": "hate-speech-v1" } ] } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v1/text-moderation/my-scan-1/check" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "text": "Your text content to be moderated goes here.", "sandbox": true, "language": "en", "labels": [ { "id": "toxic-v1" }, { "id": "profanity-v1" }, { "id": "hate-speech-v1" } ] }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.TextModeration.Requests.CopyleaksTextModerationRequestModel import CopyleaksTextModerationRequestModel scan_id = "my-moderation-scan" model = CopyleaksTextModerationRequestModel( text="This is some text to scan.", sandbox=True, language="en", labels=[ {"id": "other-v1"}, {"id": "adult-v1"}, {"id": "toxic-v1"}, {"id": "violent-v1"}, {"id": "profanity-v1"}, {"id": "self-harm-v1"}, {"id": "harassment-v1"}, {"id": "hate-speech-v1"}, {"id": "drugs-v1"}, {"id": "firearms-v1"}, {"id": "cybersecurity-v1"}, ] ) textModerationResponse = Copyleaks.TextModerationClient.submit_text(auth_token, scan_id, model) print("Text Moderation"+ "\n") print(textModerationResponse.model_dump_json()) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksTextModerationRequestModel } = require('plagiarism-checker'); async function moderateText() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `moderation-scan-${Date.now()}`; // The text to be moderated const textToModerate = "This is some text to scan for harmful content."; // Create a moderation request model const submission = new CopyleaksTextModerationRequestModel({ text: textToModerate, sandbox: true, // Use sandbox for testing language: 'en', labels: [ { id: "toxic-v1" }, { id: "profanity-v1" }, { id: "hate-speech-v1" } ] }); // Submit the text for moderation const response = await copyleaks.textModerationClient.submitTextAsync(loginResult, scanId, submission); console.log("Moderation results:", response); } catch (error) { console.error("An error occurred:", error); } } moderateText(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksTextModerationModel; import models.submissions.properties.ModerationLabel; import models.responses.ModerationResponse; import java.util.Arrays; String scanId = "my-moderation-scan"; String sampleText = "Your text content to be moderated goes here."; CopyleaksTextModerationModel submission = new CopyleaksTextModerationModel( sampleText, Arrays.asList(new ModerationLabel("toxic-v1"), new ModerationLabel("profanity-v1")), "en", true // sandbox ); ModerationResponse response = Copyleaks.moderateText(authToken, scanId, submission); System.out.println(response); ``` ### Interpreting the response The API returns a `legend` array that maps [labels](/reference/data-types/moderation/text-moderation-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 each `id` (e.g., "toxic-v1") corresponds to an `index`. - **`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 the `legend`. ```json title="Example Response" { "moderations": { "text": { "chars": { "labels": [ 2, 4 ], "starts": [ 27, 100 ], "lengths": [ 2, 8 ] } } }, "legend": [ { "index": 2, "id": "toxic-v1" }, { "index": 4, "id": "profanity-v1" } ], "modelVersion": "v1", "scannedDocument": { "scanId": "test", "totalWords": 479, "totalExcluded": 0, "actualCredits": 2, "expectedCredits": 2, "creationTime": "2025-08-13T06:51:29.4899318Z" } } ``` In this example, the content is flagged for "toxic-v1" starting at character 27 and for "profanity-v1" starting at character 100. ### 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 See a complete list of all supported content moderation labels and their descriptions. Explore the complete documentation for the Text Moderation endpoint and response object. See how Copyleaks text moderation flags unsafe content with your own examples. --- # Guides → Writing ## Assess Grammar & Writing Quality Source: https://docs.copyleaks.com/guides/writing/check-grammar > This document outlines the essential steps for using the Grammar Checker API, covering scan execution and result management. import GuideLogin from '/snippets/guide-login.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; Get started with Copyleaks' [Grammar Checker](https://copyleaks.com/grammar-checker) API to detect and correct over 30 types of writing issues across grammar, mechanics, sentence structure, and word choice. The API is available in two ways: 1. **Sync:** Submit text via an HTTP request and receive the analysis in the response. 2. **Async:** Use the [Authenticity API](/guides/authenticity/detect-plagiarism-text) to submit larger documents and receive results via webhook. This guide focuses on the **synchronous** option. For asynchronous submissions, see the **[Authenticity API Guide](/guides/authenticity/detect-plagiarism-text)**. ## 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](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ### Installation ### Login ### Send request Use the [Writing Feedback Endpoint](/reference/actions/writing-assistant/check). Provide a unique `scanId` for each request. For testing, set `"sandbox": true` in the request body. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v1/writing-feedback/my-scan-1/check Headers Authorization: Bearer Content-Type: application/json Body { "text": "Copyleaks is a online plagarism detector that helps schools, business and content creators to make sure thier work is orginal. It scans textes from internet and databasis to find similerities. The tool is fast, accurate and supports multipal languages. However, some times it gives false possitives, so users should double check results. Overall, its a usefull platform for mantaining content integrity.", "sandbox": true } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v1/writing-feedback/my-scan-1/check" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "text": "Copyleaks is a online plagarism detector that helps schools, business and content creators to make sure thier work is orginal. It scans textes from internet and databasis to find similerities. The tool is fast, accurate and supports multipal languages. However, some times it gives false possitives, so users should double check results. Overall, its a usefull platform for mantaining content integrity.", "sandbox": true }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.writing_assistant_document import WritingAssistantDocument scan_id = "my-python-scan" sample_text = "Hello world, this is a test." submission = WritingAssistantDocument(sample_text) submission.set_sandbox(True) response = Copyleaks.WritingAssistantClient.submit_text(auth_token, scan_id, submission) print(response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksWritingAssistantSubmissionModel } = require('plagiarism-checker'); async function checkWriting() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token. // Replace with your email and API key. const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `writing-scan-${Date.now()}`; // The text to be checked const textToCheck = "This is a sample text to check for grammar and writing quality."; // Create a submission model const submission = new CopyleaksWritingAssistantSubmissionModel(textToCheck); submission.sandbox = true; // Use sandbox for testing // Submit the text for analysis const response = await copyleaks.writingAssistantClient.submitTextAsync(loginResult, scanId, submission); console.log("Writing analysis results:", response); } catch (error) { console.error("An error occurred:", error); } } checkWriting(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksWritingAssistantSubmissionModel; import models.responses.WritingAssistantResponse; String scanId = "my-java-scan"; String sampleText = "Hello world, this is a test."; CopyleaksWritingAssistantSubmissionModel submission = new CopyleaksWritingAssistantSubmissionModel(sampleText); submission.setSandbox(true); WritingAssistantResponse response = Copyleaks.writingAssistantClient.submitText(authToken, scanId, submission); System.out.println(response); ``` ### Interpreting the response The [Grammar Checker Response](/reference/data-types/writing/writing-assistant) contains detailed feedback under the `corrections` and `score` properties. The `score` provides an overall quality metric and a breakdown by category, while `corrections` pinpoints the exact location and suggested changes for each issue. ```json title="Example Response Snippet" { "score": { "corrections": { "overallScore": 93, "grammarCorrectionsScore": 100 }, "readability": { "readabilityLevelText": "College Student" } }, "corrections": { "text": { "chars": { "types": [18], "starts": [28], "lengths": [9], "operationTexts": ["stretches "] } } } } ``` ## Next steps Explore the complete documentation for the Grammar Checker response object. See a detailed list of all supported correction types and languages. Test the Copyleaks grammar checker with your own text and see suggestions in seconds. --- # Using the APIs ## Copyleaks API Overview Source: https://docs.copyleaks.com/using-the-apis/overview > How the Copyleaks REST API works - JSON requests, API key authentication, content submission, rate limits, and free sandbox testing. The [Copyleaks API](https://copyleaks.com/api) is a [RESTful web service](https://en.wikipedia.org/wiki/REST) that uses [HTTPS](https://en.wikipedia.org/wiki/HTTPS) for secure communication. This guide provides a high-level overview of the core concepts you'll need to understand to use the API effectively. ## Generating Your API Key Your API Key is the first step to authenticating with the Copyleaks API. The authentication process involves exchanging this key for a temporary Access Token, which is then used to make API requests. For detailed instructions on how to generate your API key and authenticate, please see our complete [Authentication Guide](/using-the-apis/authentication). ## Content Types The Copyleaks API uses the JSON format for both requests and responses. You must send the `Content-Type: application/json` header in your requests. Our official SDKs handle this for you automatically. ## Submitting Content Copyleaks can process content in several formats, depending on the endpoint you are using: - **Raw Text**: Submit plain text directly in the request body. - **Base64 Encoded File**: Submit a file by encoding its content into a Base64 string. The `filename` parameter, including the file extension, is used to determine the document type. - **URL**: Provide a public URL to a document, and Copyleaks will crawl and process its content. ## Request Size Limits While there is no single global request size limit, specific endpoints have their own constraints. For text submissions, such as those to the [AI Detector](/reference/actions/writer-detector/check) or [Grammar Checker](/reference/actions/writing-assistant/check), there are character limits detailed on their respective pages. For file submissions, please refer to the [Technical Specifications](/reference/data-types/authenticity/technical-specifications/) for detailed file size limits. ## Rate Limiting The Copyleaks API enforces [rate limits](/using-the-apis/rate-limits) to ensure fair usage and stability. The default rate limit is 10 requests per second per account. However, specific endpoints may have different rate limits, which are detailed on their respective pages in the API reference. The API is set to handle up to 300 scans per minute (600 API calls). During high-traffic periods, we recommend building a simple queue on your side. This allows your system to send scan requests at a steady pace and ensures every scan is processed reliably. This capacity allows for processing over 1.2 million credits per day. If you send too many requests in a short period, you will receive a `429 Too Many Requests` HTTP response. See [Rate Limits](/using-the-apis/rate-limits) for best practices on handling rate limit errors and [Error Codes](/using-the-apis/api-errors) for complete error reference. If you require a higher rate limit, please [contact our support team](https://copyleaks.com/contact-us). ## Sandbox Mode For development and testing, we provide a sandbox mode that allows you to make API calls without consuming credits or affecting your production data. To use it, include the `"sandbox": true` parameter in your request. The exact location of this parameter may vary by endpoint, so please refer to the specific endpoint documentation in the [API Reference](/reference/actions/overview/) or our guides for implementation details. When in sandbox mode, the API will not perform a real scan, but will instead return mock data that simulates a real response. This allows you to test your integration and workflows without consuming credits. ## Frequently asked questions ### What kind of API is the Copyleaks API? It is a RESTful web service over HTTPS that uses JSON for both requests and responses. Send the `Content-Type: application/json` header, or let an official SDK handle it for you. ### How do I authenticate? Exchange your API key for a temporary access token, then send that token with each request. See the [Authentication Guide](/using-the-apis/authentication) for the full flow. ### What is the default rate limit? 10 requests per second per account, with capacity for up to 300 scans per minute (600 API calls). Exceeding it returns a `429 Too Many Requests` response. See [Rate Limits](/using-the-apis/rate-limits) for details and how to request a higher limit. ### Can I test without consuming credits? Yes. Include `"sandbox": true` in your request. Sandbox mode returns mock data that simulates a real response without consuming credits or affecting production data. ### What content can I submit? Raw text in the request body, a Base64-encoded file (the `filename` extension sets the document type), or a public URL that Copyleaks crawls and processes. Learn how to exchange your API key for an access token to make API calls. Understand API rate limits and best practices for handling 429 errors. Complete reference of API error codes and how to resolve them. --- ## Authentication Source: https://docs.copyleaks.com/using-the-apis/authentication > Learn how to authenticate with the Copyleaks API to start making requests. To ensure secure communication, the Copyleaks API uses a two-part authentication model. Your permanent **API Key** is used to generate a temporary **Access Token**. This temporary token is then used to make all subsequent API requests, providing a robust layer of security. ## The Authentication Process The process involves exchanging your long-term key for a short-term token. ### Your API Key Your primary credential is your API Key. This key is unique to your account and, when paired with your account email address, is used to verify your identity. You can generate and manage your API keys at any time from the **[API Dashboard](https://api.copyleaks.com/dashboard)**. If you don't have an account, you can [create one for free](https://api.copyleaks.com/signup). As this key is confidential, be sure to store it in a secure and private location. ### Generating an Access Token To make API calls, you must first exchange your API Key for an `access_token`. This is a security best practice that prevents your permanent key from being exposed with every request. This exchange is done by making a single `POST` request to the [login endpoint](/reference/actions/account/login). This is the only time you need to use your API key directly. The [/login endpoint](/reference/actions/account/login) has a stricter rate limit (**12 requests per 15 minutes**) than other API endpoints. Reusing your access token is essential for efficiency and to prevent being rate-limited. The following examples show how to provide your email and API key to receive an access token. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Headers Content-Type: application/json Body { "email": "your@email.address", "key": "00000000-0000-0000-0000-000000000000" } ``` ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" # Login to Copyleaks auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Logged successfully!\nToken:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); // Login function function loginToCopyleaks() { return copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then( (loginResult) => { console.log("Login successful!"); console.log("Access Token:", loginResult.access_token); return loginResult; }, (err) => { console.error('Login failed:', err); throw err; } ); } loginToCopyleaks(); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; // Login to Copyleaks try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); } catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1); } ``` ### Using the Access Token Once the login request is successful, the API will return an `access_token`. This token must be sent with every subsequent API request in the `Authorization` header. **Header for API Requests:** `Authorization: Bearer ` ## Token Lifetime and Caching The `access_token` is valid for **48 hours**. To optimize performance and avoid unnecessary login requests, you should cache this token in your application and reuse it until it expires. ## Security Your API Key and Access Token are confidential and should be treated as passwords. Attackers who gain access to them can access your private information and perform actions on your behalf. --- ## Rate Limits Source: https://docs.copyleaks.com/using-the-apis/rate-limits > Learn about Copyleaks API rate limits to ensure system stability and avoid interruptions in service. To ensure reliable service for all users, **Copyleaks enforces rate limits**. Each rate limit has two components - request count and time period. Exceeding these limits will result in an `HTTP 429 Too Many Requests` error response. ## About Our Limits Our API has a **system-wide default rate limit of 10 requests per second** per account. However, certain endpoints have unique, stricter limits to ensure fair usage and optimal performance. Any endpoint not explicitly listed below adheres to the default limit. ### Endpoint-Specific Limits | Product | Endpoint | Rate Limit | | ------------------------ | --------------------------------------------- | ------------------------- | | **[Login](/reference/actions/account/login)** | `https://id.copyleaks.com/v3/account/login/api ` | 12 requests per 15 minutes | | **[Authenticity Scan Export](/reference/actions/downloads/export)** | `https://api.copyleaks.com/v3/downloads/{SCAN_ID}/export/{EXPORT_ID}` | 10 requests per minute | | **[AI Image Detector](/reference/actions/ai-image-detector/check)** | `https://api.copyleaks.com/v1/ai-image-detector/{SCAN_ID}/check` | 900 requests per 15 minutes | ## Handling Rate Limit Blocks When an application receives a `429 Too Many Requests` error, simply ignoring it or immediately retrying the same request will only make the problem worse. Exceeding the maximum calls repeatedly will lead to temporary or permanent blocks. ### Implement Exponential Backoff Your code must **gracefully handle 429 errors**. The recommended approach is **exponential backoff**. When you receive a 429 error, wait for a short interval before retrying. If the request fails again, double the waiting period (e.g., 1s, 2s, 4s, and so on) up to a reasonable maximum. This gives the rate limit window time to reset and allows your application to recover smoothly. ## Best Practices To ensure your integration is robust and efficient, it's crucial to avoid common mistakes that can lead to being rate-limited. Understanding the correct workflow will save development time and prevent interruptions in service. ### Re-authenticating for Every Request A common issue is calling the [login](/reference/actions/account/login) endpoint to get a new token before making every API call. This is inefficient and will quickly lead to being rate-limited due to the endpoint's strict limit of **12 requests per 15 minutes**. #### Authenticate Once, Reuse the Token You should design your application to call the login endpoint **once** to start a session. The generated JWT access token is **valid for 48 hours**. Securely store the token and include it in the `Authorization: Bearer ` header for all subsequent API calls. Only request a new token when the old one is about to expire. ### Re-triggering Export for Scans Another frequent mistake is calling the [Authenticity Scan Export](/reference/actions/downloads/export) endpoint multiple times for the same scan. #### Trigger Once, Wait for the Webhook When a scan is completed, you will receive a **completion webhook**. We recommend using this as a queue to trigger the export call. The correct workflow is to call the export endpoint a **single time** for each completed scan. Your system should then wait for Copyleaks to send the **`export-completed` webhook**, which signals that the assets have been successfully delivered. --- ## Webhooks Source: https://docs.copyleaks.com/using-the-apis/webhooks > Learn how Copyleaks notifies your server the moment a job finishes, so you never have to poll for results. A **webhook** is a push notification for your server. Jobs run **asynchronously** and can take a while to finish, so instead of polling (asking *"is it done yet?"* in a loop), you give us a URL when you submit a job. The moment it finishes, we send an HTTP `POST` to that URL with the result. It's faster, real-time, and scales without wasting requests. How you configure the URL depends on the job. ## One URL, several events Some jobs move through multiple events - a cost check, indexing, completion, an error - and you may want to react to each one separately. For these you give a single URL with a `{STATUS}` token, for example: `https://yoursite.com/copyleaks/{STATUS}/SCAN_ID` We replace `{STATUS}` with the event name before calling, so each event lands on its own path and your server handles them separately. Putting the job ID in the path is optional but recommended; it lets you match the call to the right record at a glance. Some jobs can also stream partial results as they're found, before the job completes - handy for time-sensitive integrations. The exact field and the full list of events depend on the product - see each product's reference for specifics. ## Identifying and trusting the call Your endpoint is a public door on the internet, so treat every call as untrusted until verified. Pass a `developerPayload` at submission and we echo it back in every webhook - use it to match a call to your own record. To confirm a call really came from us, attach custom **headers** to every webhook carrying a secret such as a bearer token, then validate it on receipt and pass the call through your existing auth middleware. For stronger guarantees we also support HTTPS client certificates and, on Enterprise, delivery from a fixed set of static IPs you can allowlist. Never act on a webhook before confirming it came from us. Validate a shared secret in your headers (or a client certificate) on every request, and reject anything that doesn't match. ## Choosing the HTTP verb By default we send each webhook as a `POST`. Where a webhook uploads a file for you to store, you can choose the HTTP method instead (for example `PUT`) to match whatever your endpoint or storage target expects. ## Export straight to a storage bucket A webhook target doesn't have to be your own server. When you only want to **store** an asset and there's no logic to run, point the webhook at a storage service like **Amazon S3**, **Google Cloud Storage**, or **Azure Blob Storage** and we'll upload the file directly into your bucket. This is a clean, serverless option: no endpoint to host, scale, or keep online. Use a signed/authorized upload URL, set the HTTP verb your provider expects (often `PUT`), and add any required auth via custom headers - the asset lands in your bucket with no code in between. ## Designing for reliable delivery Your endpoint must be **publicly reachable over HTTPS** and respond within **70 seconds** with a `2xx`. Return success as soon as you've accepted the payload, then do the heavy work afterward. On a timeout or `5xx`, we retry automatically - up to **17 attempts** on an exponential backoff (1, 2, 4, 8 seconds, and so on). Because of retries, delivery is **at-least-once**: the same webhook can occasionally arrive twice. Make your handlers **idempotent**. Key off a stable identifier like the scan ID or your `developerPayload` so receiving a webhook twice does no harm - no duplicate charges, no double-processing. For scans, if you miss a webhook you can re-trigger it with the [resend webhook](/reference/actions/authenticity/resend-webhook) endpoint. ## Testing without spending credits Set `sandbox: true` on any submission to receive **real webhooks with mock results**, free. It's the fastest way to build and verify your receiver before going live. Point your sandbox webhook at a temporary public URL (for example, a local tunneling tool) so you can inspect exactly what we send before wiring up production. ## Next steps The full reference for authenticity scan webhooks and their configuration. Submit an image and receive the detection result via webhook. Submit a video and receive the detection result via webhook. Secure your endpoints with secrets, certificates, and IP allowlisting. --- ## Handling Errors Source: https://docs.copyleaks.com/using-the-apis/api-errors > Reference for Copyleaks API error codes and how to handle them. The Copyleaks API uses standard HTTP response codes to indicate success or failure. Understanding these codes helps you build robust integrations. ## HTTP Errors Our API returns structured error responses with the following error types: - `invalid_request_error`: Invalid request format, missing parameters, or malformed data. - `authentication_error`: Authentication failed due to invalid credentials, disabled account, or too many failed login attempts. - `payment_error`: Payment-related issues including insufficient credits, expired subscriptions, or team billing errors. - `api_error`: Internal server errors, service overload, timeouts, or temporary unavailability. ## Error Response Format All errors return a consistent JSON structure: ```json { "error": { "type": "invalid_request_error", "id": "missing_parameter", "code": 1, "message": "Bad request. One or several required parameters are missing or incorrect.", "url": "https://docs.copyleaks.com/using-the-apis/api-errors/#error-reference", "details": [ { "param": "labels", "message": "Id Label EXAMPLE-v1 is not supported" } ] } } ``` The `url` and `details` fields are optional and may not be present in all error responses. The `details` field, when present, contains an array of objects with `param` and `message` properties that provide additional context about specific parameters that caused the error. ## Error Reference | Code | Type | Error | Message | | ---- | ---- | ----- | ------- | | 1 | `invalid_request_error` | `missing_parameter` | Bad request. One or several required parameters are missing or incorrect. | | 2 | `authentication_error` | `invalid_credentials` | Invalid login credentials. | | 3 | `authentication_error` | `email_confirmation_required` | To use your account, you need to confirm the email address. | | 4 | `authentication_error` | `user_disabled` | This user is disabled. Contact support for help. | | 5 | `api_error` | `download_failed` | Failed to download the requested URL. | | 6 | `invalid_request_error` | `file_too_large` | Cannot complete the scan request because the file is too large. | | 7 | `invalid_request_error` | `text_read_failed` | Failed reading the submitted text. | | 8 | `invalid_request_error` | `image_quality_too_low` | The image quality is too low to scan. | | 9 | `api_error` | `temporarily_unavailable` | Temporarily unavailable. Please try again later. | | 10 | `invalid_request_error` | `unsupported_file_type` | This file type is not supported. | | 11 | `invalid_request_error` | `not_enough_text` | Not enough text to scan. The minimum text length is 30 characters and at least 6 words. | | 12 | `invalid_request_error` | `document_too_long` | This document is too long (The maximum number of pages allowed is <max-allowed>, while this document contains <number> pages). | | 13 | `payment_error` | `insufficient_credits` | You don't have enough credits to complete the request (required <number> credits)! | | 14 | `invalid_request_error` | `invalid_file` | The submitted file is invalid. | | 15 | `invalid_request_error` | `invalid_url` | The submitted URL is invalid! | | 16 | `api_error` | `internal_server_error` | The server encountered an internal error or misconfiguration and was unable to complete your request. We are investigating the problem. Ticket ID <00000000-0000-0000-0000-000000000000>. | | 17 | `payment_error` | `no_credits` | You have no credits. You need to purchase credits in order to complete the request. | | 18 | `invalid_request_error` | `copyshield_widget_missing` | Copyshield widget is not showing on your webpage. | | 19 | `invalid_request_error` | `headers_too_long` | '<headers>*' headers are too long (limited to <max-size> characters together)! | | 20 | `invalid_request_error` | `only_multipart_allowed` | Only MIME multipart content type is allowed! | | 21 | `invalid_request_error` | `single_file_upload_only` | You can upload one file at a time! | | 22 | `invalid_request_error` | `file_size_unknown` | Unable to determine file size. | | 24 | `invalid_request_error` | `bad_filename` | Bad filename! | | 25 | `invalid_request_error` | `undefined_language` | Undefined language! | | 26 | `api_error` | `process_still_running` | The request cannot be completed because the process is still running. | | 27 | `invalid_request_error` | `unknown_process_id` | Unknown process id! | | 30 | `invalid_request_error` | `missing_header` | Missing '<name>' header value! | | 31 | `invalid_request_error` | `bad_parameter` | Bad parameter '<param-name>'! | | 32 | `authentication_error` | `too_many_failed_logins` | Too many failed login attempts. Please try again in <number> hours. | | 33 | `invalid_request_error` | `header_key_too_long` | Http header '<headers>' key is too long (max length is <max-size> characters)! | | 37 | `authentication_error` | `authorization_denied` | Authorization has been denied for this request. | | 38 | `invalid_request_error` | `order_already_activated` | Order has already been activated. | | 39 | `invalid_request_error` | `unsupported_method` | Unsupported method. | | 40 | `payment_error` | `institution_subscription_expired` | Institution subscription has expired. | | 41 | `invalid_request_error` | `file_password_protected` | The submitted file is password protected. | | 42 | `payment_error` | `msg_team_error` | Scan failed due to team error. Please contact your team administrator to solve this issue. | | 43 | `invalid_request_error` | `all_document_excluded` | As a result of your scan settings, this scan failed since the entire document was excluded. | | 44 | `invalid_request_error` | `bad_url` | The submitted url is not valid | | 45 | `api_error` | `failed_to_index` | We were unable to index your file. | | 46 | `invalid_request_error` | `no_repos_or_db_to_index` | As a result of your scan settings, we failed to index your file since copyleaksDb was set to false and the array of repositories was empty. | | 47 | `invalid_request_error` | `unsupported_language` | Language not supported | | 48 | `invalid_request_error` | `image_too_bright` | Image is too bright. Please try another image with less exposure. | | 49 | `invalid_request_error` | `low_dynamic_range` | Image has poor dynamic range. Please try another image with more contrast. | | 50 | `invalid_request_error` | `image_textureless` | Image appears blank or textureless. Please upload a different image. | | 51 | `invalid_request_error` | `image_blurry` | Image is too blurry. Please upload a sharper image. | | 52 | `invalid_request_error` | `insufficient_colors` | Image has too few colors. Please upload a more detailed image. | | 53 | `invalid_request_error` | `image_truncated` | Image file is incomplete or corrupted. Please upload a complete image file. | | 54 | `api_error` | `rate_limit_exceeded` | Too many requests have been received from your IP address recently. Please wait a moment and then try your request again. | | 55 | `api_error` | `site_is_overloaded` | Site is overloaded. | | 56 | `invalid_request_error` | `unsupported_lang` | Language not supported. | | 57 | `api_error` | `request_timed_out` | The request has timed out. | | 58 | `invalid_request_error` | `empty_text` | Text is empty. | | 59 | `invalid_request_error` | `unsupported_image_format` | Image format not supported. Please upload a <supported_formats> image. | | 60 | `invalid_request_error` | `image_load_failed` | Unable to process the image. Please try uploading again. | | 61 | `invalid_request_error` | `image_too_small` | Image is too small. Please upload an image at least <min_width>x<min_height> pixels. | | 62 | `invalid_request_error` | `image_too_large` | Image is too large. Please upload an image up to <max_megapixels> megapixels (e.g., <example_dimensions>). | | 63 | `invalid_request_error` | `unsupported_aspect_ratio` | Image aspect ratio <aspect_ratio> not supported. Please upload an image with a standard aspect ratio. | | 64 | `invalid_request_error` | `image_too_dark` | Image is too dark. Please try another image with better lighting. | --- # Concepts → Products ## Products Source: https://docs.copyleaks.com/concepts/products/overview > The Copyleaks API product line, plagiarism, AI text/image/video detection, grammar checking, and text moderation. The Copyleaks API spans content authenticity, AI detection, writing quality, and moderation - from the [plagiarism checker](https://copyleaks.com/plagiarism-checker) and [AI detector](https://copyleaks.com/ai-detector) to the [grammar checker](https://copyleaks.com/grammar-checker) and [text moderation](https://copyleaks.com/text-moderation). Pick the product that matches what you need to verify. Detect plagiarism and verify content originality with text comparison against billions of sources. Identify AI-generated text with classification scores and explanations. Detect AI-generated images and gain insights into their origin. Detect AI-generated videos with audio and visual track analysis. Grammar, spelling, and writing-quality feedback designed to be safe from AI detection. Scan text for unsafe or policy-relevant material across 10+ categories. Search the web for unauthorized copies and usages of your images. --- ## Plagiarism Checker API Source: https://docs.copyleaks.com/concepts/products/plagiarism-checker-api > Detect plagiarism and paraphrased content across billions of web pages and academic sources via REST API. Scan PDF, Word, text, and source code. The Copyleaks [Plagiarism Checker API](https://copyleaks.com/plagiarism-checker) checks text, documents, and source code for plagiarism by comparing them against billions of web pages, academic journals, and your own document libraries. It detects both identical and paraphrased matches, handles popular formats like PDF and Word, and can flag attempts to manipulate text to evade detection. ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) ## Core Capabilities Leverage the most comprehensive database, including billions of web pages and academic journals, to ensure unmatched accuracy in plagiarism detection. Go beyond simple text matching to identify rewritten content that maintains the original meaning, ensuring a deeper level of originality verification. Upload and scan any popular document type, including PDFs, Word files, plain text and more. The Plagiarism Checker API can handle it all and maintain the original format of the document. Uphold software integrity by detecting plagiarized code. This helps maintain academic integrity as well as compliance with licensing agreements. ## Features Our plagiarism checker is an API-first solution with unmatched flexibility and customization. This can help you build a tailored integration for your specific use case. ### Data Hubs Copyleaks Data Hubs allows you to detect plagiarism against internal documents. - **Shared Data Hub**: Compare your documents against millions of documents shared by other institutions. - **Private Cloud Hub**: Have your own private data hub which you can use in order to compare your files against each other. [**Learn more**](/concepts/features/data-hubs) ### Text Omission When scanning documents for plagiarism, there are text segments which you may want to exclude from the scan. With Copyleaks you have the ability to choose specifically what you want to omit from the scan, including references, citations, quotes and more. Copyleaks will include in the plagiarism scan only the sections that you wish to scan. [**Learn more**](/concepts/features/exclude-content) ### Detecting Text Manipulation In some cases, writers will try to avoid plagiarism detection. There are techniques that are designed to obfuscate the submitted content while keeping the document look regular. With Copyleaks you have the ability to detect text manipulation attempts as part of the authenticity API scans. [**Learn more**](/concepts/features/text-manipulation) ### Display the Plagiarism Report Once a plagiarism scan is complete, you can display the results in a ready-to-use web report. The web report supports all the features and allows customization to fit your brand needs. [**Learn more**](/concepts/features/how-to-display) ## Use Cases Scan student work for plagiarism and AI content right in your platform. Compare against millions of global submissions as well as billions of online materials to prevent recycled assignments and maintain academic integrity. [**Learn more**](/concepts/use-cases/academic-integrity) Check articles and blogs for originality before publishing. Scan billions of sources to protect your IP, avoid SEO penalties, and keep your brand trusted. [**Learn more**](/concepts/use-cases/publishers) Automatically moderate comments, reviews, and posts for plagiarism, AI text, and harmful content. Keep your community safe and authentic with real-time detection. [**Learn more**](/concepts/use-cases/user-generated-content-platforms) ## Complete Content Authenticity Platform Our [Plagiarism Checker](https://copyleaks.com/plagiarism-checker) is even better when paired. Combine our services to build a robust solution for authenticity, safety, and quality, establishing a holistic framework for digital trust. Enterprise-level offering designed to identify if content is human-written or AI-generated with superior accuracy. Empower your users with an AI-powered assistant that corrects grammar, mechanics, and sentence structure. ## Next Steps Ready to elevate your originality with the market's leading Plagiarism Checker? Follow our step-by-step guide to implement plagiarism detection in your application. Try the Copyleaks plagiarism checker with your content and see results in seconds. Dive into the complete technical documentation for all endpoints, parameters, and responses. Learn about the different options for displaying plagiarism detection reports to end users. ## Frequently asked questions ### What is the Copyleaks Plagiarism Checker API? It is a REST API that scans text, documents, and source code for plagiarism, comparing the content against billions of web pages, academic journals, and your own document libraries to find copied and paraphrased material. ### What sources does it check against? The web (billions of pages), academic journals, and your own collections via [Data Hubs](/concepts/features/data-hubs) - the Shared Data Hub (documents shared across institutions) and the Private Cloud Hub (your own private repository). ### Can it detect paraphrased or reworded plagiarism? Yes. Beyond identical text matching, it identifies rewritten content that keeps the original meaning, and it can also detect [text-manipulation attempts](/concepts/features/text-manipulation) used to evade detection. ### Which file types can it scan? Popular document types including PDF, Word, and plain text, as well as source code for detecting plagiarized code. ### Can I compare documents against my own private library? Yes, using the [Private Cloud Hub](/concepts/features/data-hubs), which lets you scan your files against each other in a private data hub. Get a personalized demo and discover how to process thousands of documents seamlessly, integrate Copyleaks into your existing systems, and achieve enterprise-grade accuracy for your specific use case. --- ## AI Text Detection API Source: https://docs.copyleaks.com/concepts/products/ai-text-detection-api > Detect AI-generated text from ChatGPT, Gemini, Claude and more via REST API. Independently tested accuracy, 30+ languages, and explainable AI Logic. The Copyleaks AI Text Detection API tells you whether text was written by a human or generated by an AI model such as ChatGPT, Gemini, or Claude. For each section of text it returns a classification (human or AI), plus an overall human-versus-AI summary, and it explains results with AI Logic - so you can spot AI-generated content across 30+ languages with independently tested accuracy and very few false positives. ![Detect AI-generated Content](/assets/mainpage/AI-Detector-AI-Insights-1.svg) ## Why Detecting AI Content Matters Generative AI tools have completely changed how we create content. They're amazing tools, but sometimes you really need to know that content is authentic: - **Academic Honesty**: We want to empower students to develop their own writing skills and critical thinking - **Content Quality**: Your readers trust that content comes from real human experience and expertise, while content generated by LLMs often contains inaccuracies or lacks depth - **Brand Trust**: Your audience expects you to be upfront about how your content is created - **Legal Requirements**: Some fields actually require proof that humans wrote the content AI-generated text can look exactly like something a person wrote. Our detection API helps you tell the difference, so you can keep things authentic and trustworthy in a world where AI is everywhere. ## Core Capabilities Our detector has been tested by independent researchers and catches AI-generated text with excellent accuracy and very few false alarms. Detects text from ChatGPT, Gemini, Claude, DeepSeek, and new AI models as they come out. Find AI content in English, Spanish, French, German, Chinese, Arabic, and [many other languages](/reference/actions/miscellaneous/ai-detection-supported-languages). Spots AI text even when it's mixed with human writing, showing you exactly which parts are AI-generated. ## Features Since the inception of LLMs we have been rigorously testing and improving our detection tools. The result is a powerful and flexible API which can be used with confidence. Our AI detection gives you all the details you need to make confident decisions about content authenticity. ![AI Detection Logic](/assets/mainpage/AI-Logic-1024x670.webp) ### Exceptional Accuracy Our [AI Detector](https://copyleaks.com/ai-detector) has been independently tested, both internally as well as by 3rd party researchers, and shown to have exceptional accuracy in identifying AI-generated text, with very low false positive rates. In addition, we are constantly updating our detection algorithms making sure we are up-to-date with the latest generative AI models. [**Learn more**](https://copyleaks.com/ai-detector/testing-methodology) ### AI Logic - See Why Content Was Flagged Instead of just saying "this looks like AI," we show you exactly why. You get clear explanations that help you make confident decisions. - **Find AI Sources**: See when copied content comes from AI-generated websites - **Highlight AI Phrases**: Points to specific sentences that sound like AI writing - **Compare Patterns**: Shows how the text compares to known human vs AI writing styles - **Get Clear Reasons**: Understand exactly why something was flagged as AI [**Learn more**](/concepts/features/ai-logic) ### Detecting Text Manipulation Attempts People try to trick AI detectors by changing the text. We can spot these tricks. - **Changed Characters**: Finds when people replace letters with similar-looking symbols - **Text Spinners**: Catches content that's been run through text-changing tools - **Hidden Text**: Spots invisible characters that people add to fool detectors - **Heavy Edits**: Finds heavily modified AI text that's meant to look human [**Learn more**](/concepts/features/text-manipulation) ### Choose Your Detection Level Pick how sensitive you want the detection to be: - **Level 1**: Catches text copied straight from AI tools like ChatGPT - **Level 2**: Finds AI text with small changes like different tenses - **Level 3**: Spots heavily edited AI content that's been changed a lot [**Learn more**](/reference/actions/writer-detector/check) ### Enterprise-level Trust Safe and secure for companies and schools: - **Security**: Your data is protected with military-grade encryption - **Privacy**: Meets GDPR and other privacy regulations - **Certifications**: SOC 2 & SOC 3 certified for enterprise use [**Learn more**](/concepts/security/overview/) ## Use Cases Check if students used AI to write their essays and assignments. Combine with plagiarism checking to make sure work is both original and human-written. [**Learn more**](/concepts/use-cases/academic-integrity) Make sure articles and posts are written by real people before you publish them. Keep your readers' trust by avoiding AI-generated content. [**Learn more**](/concepts/use-cases/publishers) Spot fake AI reviews, comments, and posts. Keep your community real and trustworthy by catching artificial content. [**Learn more**](/concepts/use-cases/user-generated-content-platforms) ## Works Better Together Our AI detector works great with our other tools to give you complete content checking. Find copied content from billions of online sources and make sure everything is original. Help improve writing without triggering AI detectors - safe grammar and style suggestions. ## Next Steps Ready to add reliable AI detection to your app? Follow our simple guide to add AI detection to your application. Test our AI detector with your own text and see how it works. See all the technical details for our AI detection API. Learn how AI Logic shows you why content was flagged as AI. ## Frequently asked questions ### What is the Copyleaks AI Text Detection API? It is a REST API that classifies text as human-written or AI-generated. You submit text, and the API returns a per-section classification (human or AI), an overall human-versus-AI summary, and AI Logic explanations of why content was flagged. ### Which AI models can it detect? The detector identifies text from ChatGPT, GPT-4, Gemini, Claude, DeepSeek, Llama, and other large language models, and is continuously updated as new models are released. ### How accurate is Copyleaks AI detection? Accuracy has been verified both internally and by independent third-party researchers, showing high detection rates with very low false-positive rates. See the [testing methodology](https://copyleaks.com/ai-detector/testing-methodology) for details. ### Which languages does it support? AI text detection works in 30+ languages, including English, Spanish, French, German, Chinese, and Arabic. See the [full list of supported languages](/reference/actions/miscellaneous/ai-detection-supported-languages). ### Can it detect AI text that was edited or paraphrased? Yes. Configurable [detection levels](/reference/actions/writer-detector/check) catch everything from text copied straight from an AI tool to heavily edited or paraphrased AI content, and the API also flags [text-manipulation attempts](/concepts/features/text-manipulation) like character swaps and hidden characters. ### How do I start using the API? Follow the [AI text detection guide](/guides/ai-detector/ai-text-detection) to authenticate, submit text, and read results, or see the [API reference](/reference/actions/writer-detector/check) for endpoint details. Get a personalized demo and see how easy it is to add AI detection to your app. We'll show you AI Logic and help you pick the right settings for your needs. --- ## AI Image Detection API Source: https://docs.copyleaks.com/concepts/products/ai-image-detection-api > Detect AI-generated and deepfake images from ChatGPT, Midjourney, Gemini and more. Pixel-level overlay, C2PA metadata, and JPEG, PNG, and HEIC support. Protect your organization from AI-generated visual fraud. Our [AI Image Detection](https://copyleaks.com/ai-detector/ai-image-detector) API, part of the Copyleaks [AI Detector](https://copyleaks.com/ai-detector), is built to meet the evolving challenges of enterprise security. From insurance fraud to digital forensics, our solution provides clear answers and detailed analysis you can trust. ## The Risks of Synthetic Images AI image generation has evolved from a creative tool to a potential security threat. In seconds, anyone can create photorealistic images of people, places, and events that never existed. For enterprise organizations, this represents unprecedented risk: - **Insurance Fraud**: Synthetic accident scenes, fake property damage, and AI-generated evidence threaten claim integrity - **Financial Crime**: Deepfake identity documents and AI-generated proof of assets enable sophisticated fraud schemes - **Corporate Espionage**: Fake executive photos and synthetic company imagery undermine brand trust and security - **Legal Evidence**: Courts need verification that visual evidence hasn't been artificially manufactured - **Regulatory Compliance**: Industries face increasing requirements to verify media authenticity and detect manipulation - **Reputation Protection**: Synthetic media targeting executives or brands can cause irreversible damage The sophistication of AI-generated imagery now rivals professional photography. Traditional detection methods fail against modern AI generators. Our enterprise-grade detection API provides the exceptional accuracy your organization needs to stay protected. ## Enterprise-Grade Capabilities Detects content from all major AI generators including ChatGPT, Gemini, Midjourney, Stable Diffusion and emerging deepfake technologies. The API provides an overlay on the pixel level of where AI-generated content is detected within the image. This allows you to clearly see which parts of the image are synthetic and which are real. Process images at scale with enterprise SLAs, designed for high-volume fraud detection and compliance workflows. Built with enterprise security and compliance in mind, ensuring that all image processing meets the highest standards for data protection and privacy. Process `JPEG`, `PNG`, `WebP`, `TIFF`, `BMP` and `HEIC/HEIF` formats. Handle files up to 32MB and up to 27 megapixels in resolution. Our API can also extract image metadata using the [C2PA](https://c2pa.org/) standard, which can help you infer the origin of the image. ## Comprehensive AI Model Support Our detection technology identifies content from all major AI image generators including: ## Use Cases Detect synthetic accident scenes, AI-generated property damage, and fake evidence in insurance claims. Protect against increasingly sophisticated visual fraud that costs the industry billions annually. Verify authenticity of identity documents, property photos, and financial statements. Protect against deepfake identity fraud and AI-generated proof of assets in loan applications and account verification. Verify image authenticity using Copyleaks' AI. Ensure that visual evidence hasn't been manipulated or artificially generated in legal proceedings, investigations, and forensic analysis. Verify authenticity of news photos, source imagery, and user-submitted content. Protect editorial integrity and maintain public trust by ensuring visual evidence hasn't been artificially generated. Protect against synthetic media targeting executives, fake product imagery, and AI-generated corporate communications. Safeguard brand reputation and prevent sophisticated social engineering attacks. ## Integrated Security Ecosystem Deploy AI image detection as part of a comprehensive content security strategy: Detect AI-generated text content to complement visual verification for complete document authenticity. Verify that content hasn't been copied from other sources while checking for AI generation. Complete content governance with text moderation capabilities. ## Frequently asked questions ### Can it detect deepfakes? Yes. The API detects deepfakes and other synthetic or AI-generated images, helping with fraud prevention, digital forensics, and media verification. ### Which AI image generators does it detect? Content from all major generators, including OpenAI ChatGPT, Google Gemini, Midjourney, Stable Diffusion, xAI Grok, Microsoft Copilot, and Adobe Firefly. ### Which image formats and sizes are supported? JPEG, PNG, WebP, TIFF, BMP, and HEIC/HEIF, with files up to 32MB and up to 27 megapixels in resolution. ### Can it show which part of an image is AI-generated? Yes. The API returns a pixel-level overlay marking where AI-generated content is detected, so you can see which regions are synthetic and which are real. ### Can it tell me where an image came from? It can extract image metadata using the [C2PA](https://c2pa.org/) standard, which helps you infer the origin of an image. ## Next Steps Enterprise-grade support for mission-critical deployments: Get started with our API and integrate AI image detection into your workflows. Complete technical specifications, error handling, and integration patterns for enterprise systems. Schedule a personalized demonstration with our enterprise security team. We'll analyze your specific risk scenarios and show you how our detection technology prevents fraud in your industry. --- ## AI Video Detection API Source: https://docs.copyleaks.com/concepts/products/ai-video-detection-api > Detect AI-generated and deepfake videos with the Copyleaks API. Independent audio and visual analysis, time-based detection, and C2PA provenance. Protect your organization from AI-generated video fraud. The [AI Detector](https://copyleaks.com/ai-detector) video API analyzes both the audio and visual tracks independently, providing granular time-based detection across the full video timeline - from deepfake evidence to synthetic media campaigns. Submit a video and see the audio + visual breakdown live, no integration required. Opens in a new tab. ![AI-generated deepfake example showing a synthetic face swap](/images/ai-generated-deepfake-feature-v2-1024x509.webp) ## The risks of synthetic videos AI video generation went from creative tool to security threat in a year. Anyone can produce photorealistic videos of people, places, and events that never happened. For enterprises that creates real exposure: - **Legal evidence** - courts need verification that video evidence isn't artificially manufactured or edited - **Insurance fraud** - synthetic accident scenes and AI-generated footage threaten claim integrity - **Financial crime** - deepfake executive videos enable sophisticated social engineering - **Disinformation** - AI-generated news footage undermines public trust - **Regulatory compliance** - industries face growing requirements to verify media authenticity - **Reputation protection** - synthetic video targeting executives or brands can cause irreversible damage ## Capabilities Independently analyzes both the audio and visual tracks, returning separate AI ratios and time-based detection data for each. Returns start positions and durations (in milliseconds) for each AI-detected segment, enabling frame-accurate analysis across the full timeline. Provides a single `overallAIRatio` score representing the proportion of the video (union of audio and visual AI detections) that is AI-generated. Extracts embedded provenance metadata (C2PA standard) to identify the generating tool, issuing organization, and creation timestamp when available. `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.mpg`, `.m4v`, `.3gp`, `.mxf` - up to 512 MB and 1 hour in duration. Designed for large files: submit a video URL and receive results via webhook when processing completes, no polling required. ## Use cases Verify authenticity of video evidence in legal proceedings and investigations. Ensure that footage submitted to courts or regulatory bodies hasn't been artificially generated or manipulated. Detect synthetic accident footage, AI-generated property damage videos, and fake evidence in insurance claims. Verify authenticity of news footage, user-submitted videos, and source material. Protect editorial integrity by ensuring video content hasn't been artificially generated. Detect deepfake executive videos used for social engineering, synthetic identity verification footage, and AI-generated proof-of-life recordings. Monitor for synthetic media targeting your brand, executives, or communications channels. Safeguard reputation and prevent disinformation campaigns. Deepfakes are a direct threat to identity verification workflows. AI-generated videos can convincingly impersonate real individuals - enabling attackers to bypass video KYC, spoof liveness detection, and fabricate proof-of-identity recordings. Use the AI Video Detection API to verify that submitted identity videos are genuine before approving onboarding, access requests, or high-value transactions. Detect synthetic faces, AI-cloned voices, and manipulated footage across the full video timeline. ## Pair with other detection APIs Detect AI-generated images to complement video verification for complete media authenticity. Detect AI-generated text content for complete document and media authenticity. Verify that content hasn't been copied from other sources alongside AI generation checks. ## Frequently asked questions ### Can it detect deepfakes? Yes. The API detects AI-generated and deepfake video, analyzing the full timeline to flag synthetic faces, AI-cloned voices, and manipulated footage - useful for fraud prevention, forensics, and identity verification. ### Does it analyze audio and video separately? Yes. It independently analyzes the audio and visual tracks, returning separate AI ratios and time-based detection data for each, plus a single `overallAIRatio` for the whole video. ### Which video formats and sizes are supported? `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.mpg`, `.m4v`, `.3gp`, and `.mxf`, up to 512 MB and 1 hour in duration. ### Is video detection synchronous? No. It is designed for large files: you submit a video URL and receive results via webhook when processing completes, with no polling required. ### Can it identify which tool generated a video? When embedded provenance metadata is present, it extracts C2PA data to identify the generating tool, issuing organization, and creation timestamp. ## Next steps Get started with the API and integrate AI video detection into your workflows. Technical specifications, request parameters, and webhook payload reference. Schedule a personalized demonstration with our enterprise security team. We'll analyze your specific risk scenarios and show you how detection prevents fraud in your industry. --- ## Grammar Checker API Source: https://docs.copyleaks.com/concepts/products/writing-assistant-api > Grammar Checker API for grammar, spelling, sentence structure, tone, and mechanics suggestions that improve writing without triggering AI detection. Empower error-free writing with our [grammar checker](https://copyleaks.com/grammar-checker), offering suggestions on grammar, sentence structure, tone, overall mechanics, and more. ![Grammar Checker API](/assets/mainpage/Absolute-Confidence.png) ## Why Grammar Checker Matters Good writing is essential for communication, but even the best writers make mistakes. With deadlines and pressure, catching every error becomes nearly impossible: - **Professional Credibility**: Grammar mistakes can undermine your expertise and damage your reputation - **Clear Communication**: Poor sentence structure confuses readers and weakens your message - **Time Pressure**: Manual proofreading takes time you don't have, especially with large volumes of content - **Consistency Issues**: Different writers have different styles, making content feel disjointed - **Language Barriers**: Non-native speakers need extra support to write confidently in other languages - **Writing Development**: It's not just about fixing mistakes - it's about learning and growing. Our assistant helps writers develop their skills over time with constructive feedback that teaches better writing habits Traditional grammar checkers miss context and nuance, leading to suggestions that don't fit your writing style or audience. You need assistance that actually understands what you're trying to say and helps you grow as a writer. ## Core Capabilities Catch spelling mistakes, comma errors, subject-verb disagreements, and everything in between with comprehensive grammar checking. Get suggestions to prevent run-ons, fragments, and awkward phrasing that make your writing hard to follow. Receive vocabulary suggestions that match your audience and catch potentially misused words and homophones. Get Grammar Checker in English, German, Spanish, French, Italian and Portuguese. ## Features Our Grammar Checker goes beyond basic spell-check to help you communicate clearly and confidently. ### Grammar Score - Complete Writing Assessment Get a comprehensive evaluation of your writing with our Grammar Score, which breaks down your content into four key areas: - **Corrections**: Grammar, mechanics, sentence structure, and word choice suggestions - **Insights**: Analysis of word length, sentence length, reading time, and writing patterns - **Readability**: How easy your content is to read, with historical data for comparison - **Progress Tracking**: See how your writing improves over time [**Learn more**](/reference/data-types/writing/writing-assistant) ### Assess Writing Quality in Multiple Languages Break down language barriers with Grammar Checker that actually understands different languages. We provide native-level support for English, German, Spanish, French, Italian, and Portuguese - each with its own specialized grammar engine, not just English rules translated. This means more accurate suggestions that sound natural to native speakers. [**Learn more**](/reference/actions/writing-assistant/check) ### Comprehensive Error Detection Our Grammar Checker detects more than 30 different types of writing issues, each with a specific correction suggestion to help you improve. Every detected error comes with its type and a tailored fix: - **Grammar Issues** - Subject-verb disagreements, verb forms, articles, prepositions, pronouns, conjunctions, and more - **Sentence Structure** - Run-on sentences, fragments, comma splices, missing or extra words, and clarity improvements - **Word Choice** - Misused words, homophones (like "their" vs "there"), and vocabulary suggestions - **Mechanics** - Spelling, punctuation, capitalization, hyphen usage, spacing, and accent marks Each correction is categorized so you understand what type of issue was found and why the suggestion helps. This isn't just about catching mistakes - it's about learning patterns that make you a better writer over time. [**Learn more**](/reference/data-types/writing/correction-types) ![Grammar Checker API](/assets/mainpage/PersonalProofreader.png) ### Work With Any Document Type Don't worry about file formats - our Grammar Checker works with virtually any document type. We support Office documents (Word, PowerPoint, Excel), PDFs with OCR processing, text files, HTML content, and academic formats like LaTeX. Simply upload your document and get comprehensive writing feedback while preserving the original structure. [**Learn more**](/reference/actions/authenticity/submit-file) ## Use Cases Help students improve their writing skills without triggering [AI detection](https://copyleaks.com/ai-detector). Perfect for essays, research papers, and assignments. [**Learn more**](/concepts/use-cases/academic-integrity) Ensure articles and content are error-free before publication. Maintain consistent quality across multiple writers and editors. [**Learn more**](/concepts/use-cases/publishers) ## Works Better Together Our Grammar Checker works great with our other tools to give you complete content confidence. Make sure your improved writing still reads as human-written, not AI-generated Ensure your polished writing is also completely original and properly cited ![Proofreader](/assets/mainpage/Fully-Transparent.png) ## Next Steps Ready to empower error-free writing in your application? Follow our simple guide to add Grammar Checker to your application See all the technical details for our Grammar Checker API Learn about all available correction types and writing suggestions Get a personalized demo and see how easy it is to add intelligent Grammar Checker to your platform. We'll show you the Grammar Score and help you choose the right language support for your needs. --- ## Text Moderation API Source: https://docs.copyleaks.com/concepts/products/text-moderation-api > Context-aware content moderation API that flags toxic, hate, harassment, and 7 more categories of harmful text, and pinpoints the matched content. The Copyleaks Text Moderation API is a content moderation API that identifies harmful [text](https://copyleaks.com/text-moderation) while understanding context, so you can protect your community without over-filtering legitimate conversations. It flags content across 10 categories and pinpoints exactly which words or sentences triggered each flag. ![Text Moderation API](/assets/mainpage/textModeration_ContextualAwareness.webp) ## Why Content Moderation Matters User-generated content is the heart of online communities, but with millions of posts, comments, and messages, keeping things safe and positive can feel overwhelming: - **Protect Your Reputation**: One harmful post can damage years of building trust with your audience - **Legal Protection**: Platforms can face liability for hosting certain types of harmful content - **User Safety**: Your community deserves protection from harassment, hate speech, and toxic behavior - **Scale Challenge**: Manual moderation doesn't work when you're handling thousands of posts every day - **Consistency Issues**: Human moderators might handle similar content differently, creating unfair experiences - **Cost Control**: Hiring enough human moderators to handle large volumes gets expensive fast Traditional content filters miss nuance and context, leading to false positives that frustrate users and false negatives that let harmful content slip through. You need moderation that actually understands what people are saying. ## Core Capabilities Our context-aware AI understands when language is actually harmful versus just colorful, reducing false positives that can frustrate human moderators. Pinpoint exactly which words or sentences triggered the flag, so you can review efficiently and take targeted action. Pick which types of content to monitor from 10 categories - toxic content, profanity, hate speech, harassment, violence, self-harm, drug usage, firearms, and more - based on your community's needs. Get clear explanations for why content was flagged, not just vague category labels. Make confident moderation decisions. ## Features We're taking text understanding to a new level. Our moderation API doesn't just scan for keywords - it actually comprehends meaning and context to make smarter decisions about what's truly harmful. ### Context-Aware Detection Unlike basic keyword filters, our AI understands when potentially sensitive language is being used appropriately versus when it's meant to harm. - **Reduces False Positives**: Discussions about medical topics, news events, or educational content won't get wrongly flagged - **Catches Subtle Harassment**: Identifies harmful intent even when no explicit words are used - **Understands Nuance**: Recognizes the difference between reporting violence and promoting it - **Protects Legitimate Content**: Academic papers, news articles, and educational content stay safe ### Varied Moderation Categories Choose exactly what types of content you want to monitor. Our system identifies harmful content across 10 different categories: - **Toxic Content**: Harmful language that insults, demeans, or degrades to cause emotional harm - **Profanity**: Explicit language, profanity, or vulgar expressions - **Hate Speech**: Content promoting hatred, discrimination, or prejudice against groups - **Harassment**: Bullying, intimidation, or targeted harassment content - **Self-Harm**: Content promoting self-injury, suicide, or other forms of self-harm - **Adult Content**: Sexually explicit or suggestive material inappropriate for minors - **Violence**: Content depicting, promoting, or threatening violence or dangerous activities - **Drugs**: Content related to illegal drug use, drug trafficking, or substance abuse - **Firearms**: Content related to weapons, firearms, or other dangerous implements - **Cybersecurity**: Potential security threats, malicious content, or cyber attack material [**Learn more**](/reference/data-types/moderation/text-moderation-labels) ![Text Moderation Categories](/assets/mainpage/textModeration_Categories-1.webp) {/* ### Explain Why Content Was Flagged Soon, Text Moderation will go beyond simple category labels to provide clear explanations for why content was flagged. Instead of only seeing "Violent" or "Hate Speech," you'll understand the exact context and reasoning behind each flag. - **Clear Reasoning**: Understand why specific content triggered moderation - **Context Explanations**: See how the AI interpreted meaning and intent - **Better Decisions**: Make informed choices about what to allow or remove - **Faster Review**: Spend less time analyzing flagged content */} ## Use Cases Keep conversations healthy while preserving free expression. Perfect for comments sections, user posts, and direct messages to catch harassment and hate speech. [**Learn more**](/concepts/use-cases/user-generated-content-platforms) Screen articles, comments, and user submissions before publishing. Protect your brand reputation by catching harmful content early. [**Learn more**](/concepts/use-cases/publishers) ## Works Better Together Our text moderation works great with our other tools to give you complete content protection. Catch AI-generated fake reviews and comments alongside harmful content detection Find copied content and spam posts to keep your platform authentic and safe ![Text Moderation with Plagiarism and AI Detection](/assets/mainpage/textModeration_with_productSuite.webp) ## Next Steps Ready to protect your platform with intelligent text moderation? Follow our simple guide to add text moderation to your application Test our moderation API with your content and see how it works See all the technical details for our text moderation API Learn about all 10 moderation categories and their specific labels ## Frequently asked questions ### Is this a content moderation API? Yes. The Text Moderation API moderates user-generated text - comments, posts, reviews, and messages - flagging harmful content across 10 categories so you can keep your platform safe at scale. ### Which categories of harmful content does it detect? Ten categories: toxic content, profanity, hate speech, harassment, self-harm, adult content, violence, drugs, firearms, and cybersecurity. See the [moderation labels reference](/reference/data-types/moderation/text-moderation-labels) for the full definitions. ### How is it different from a keyword filter? It is context-aware. Instead of matching keywords, it interprets meaning and intent, which reduces false positives on medical, news, and educational discussions while still catching subtle harassment that uses no explicit words. ### Does it tell me which part of the text was flagged? Yes. The response pinpoints the specific words or sentences that triggered each flag, along with the category, so you can review and act efficiently. ### Which endpoint runs text moderation? `POST https://api.copyleaks.com/.../text-moderation/check`. See the [text moderation API reference](/reference/actions/text-moderation/check) for the full request and response. Get a personalized demo and see how easy it is to add smart text moderation to your platform. We'll show you context-aware detection and help you pick the right categories for your needs --- ## Image Plagiarism Detection API Source: https://docs.copyleaks.com/concepts/products/image-plagiarism-detection-api > Detect unauthorized copies and usages of your images across the web with the Copyleaks Image Plagiarism Detection API. Protect your visual content from unauthorized use. The Copyleaks Image Plagiarism Detection API performs a deep reverse image search across the public web, returning a categorized list of exact copies and modified versions of your image - along with the web pages they appear on - all in a single synchronous API call. ## How It Works Submit any image and the API returns two categories of matches: - **Full matches** - Exact or near-exact copies of your image hosted anywhere on the web. - **Partial matches** - Cropped, resized, recolored, or otherwise modified versions of your image. Each match includes the source image URL, a `matchType` value, and the list of web pages where the image was found, so you can act on results programmatically. ## Key Capabilities No webhooks needed. Submit an image and receive all matches in the same API response. Distinguish between exact copies and modified versions of your image - each with its own match type, count, and the web pages where it was found. Supports JPG, JPEG, PNG, GIF, BMP, WebP, RAW, and ICO files up to 20MB. The response includes the submitted image's dimensions (width × height) so you can enrich your own records without re-reading the file. ## Use Cases Detect unauthorized use of your photography, artwork, or branded imagery across the web. Track where your images appear and take action against infringement. Ensure your official brand assets - logos, product photos, campaign images - are not being misused, modified, or reposted without permission. Verify whether a submitted image is genuinely original or has been copied from another source. Useful for stock photo platforms, news agencies, and UGC moderation. Detect whether images submitted in academic work have been copied from public sources, complementing text plagiarism detection in a complete integrity workflow. ## Related Products Detect whether an image was generated by AI tools like DALL-E, Midjourney, or Stable Diffusion. Detect text plagiarism and verify content originality across billions of sources. Detect AI-generated video content with audio and visual track analysis. Scan text for unsafe or policy-relevant material across 10+ categories. ## Next Steps Step-by-step guide to submitting images and interpreting results. Full API reference including all request parameters and response fields. --- # Concepts → Use cases ## Use Cases Source: https://docs.copyleaks.com/concepts/use-cases/overview > Real-world scenarios where the Copyleaks API is deployed, education, publishing, UGC platforms, and enterprise governance. How customers apply the Copyleaks API. Each use case below covers the typical scan flow, the products involved, and what to surface to end users. Detect plagiarism and AI-generated content in student submissions. Apply content policies and AI governance across organizational documents. Verify originality and prevent copyright infringement before publishing. Moderate and verify content submitted by users on social, marketplace, or review platforms. --- ## Maintaining Academic Integrity with the Copyleaks API Source: https://docs.copyleaks.com/concepts/use-cases/academic-integrity > Build plagiarism and AI detection into your LMS with the Copyleaks API. Scan against the Shared Data Hub and the internet, and check student writing. In today's evolving academic landscape, upholding integrity and originality is fundamental. Copyleaks is dedicated to empowering instructors and academic institutions with the tools to champion authentic student work and maintain the highest academic standards. Our mission is to provide comprehensive solutions that address the core challenges of modern education, from traditional plagiarism to the nuances of AI-generated content. For developers, the [Copyleaks API](https://copyleaks.com/api) is the key to seamlessly integrating these critical capabilities directly into your institution's unique ecosystem, such as a Learning Management System (LMS) or other academic platforms. By leveraging the API, you can empower instructors with a robust [plagiarism checker](https://copyleaks.com/plagiarism-checker), award-winning [AI detection](https://copyleaks.com/ai-detector), and a secure Shared Data Hub for assignments - all within the native workflows they use every day. ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) This guide will walk you through the essential API steps, from indexing documents to configuring advanced scanning options, enabling you to build a powerful, integrated solution that supports your institution's commitment to academic integrity. ## Before You Begin To get the most out of this document, you should first be familiar with how to submit a basic scan. If you're new to the process, we recommend starting with the guide below. **[Detect Plagiarism in Text](/guides/authenticity/detect-plagiarism-text)**: This guide walks you through the fundamentals of customizing your API request to scan for plagiarism, AI-generated text and grammar correction. ## Submitting Your Documents The Copyleaks API allows you to submit a variety of document types for analysis. You can [upload files](/reference/actions/authenticity/submit-file/) in formats such as PDF and DOCX. Additionally, you can submit documents by providing a [URL](/reference/actions/authenticity/submit-url/). Copyleaks also offers advanced capabilities, allowing you to [upload images](/reference/actions/authenticity/submit-ocr/) of text. This is made possible using Optical Character Recognition (OCR) technology. ## Scanning with the Shared Data Hub ### What is the Shared Data Hub? The Shared Data Hub is a comprehensive database containing millions of user-submitted documents from institutions worldwide. This powerful resource significantly enhances academic integrity by expanding the scope of plagiarism detection beyond traditional sources. ### How It Improves Academic Integrity The Shared Data Hub is particularly effective at detecting instances where students submit work that isn't their own. For example, it can detect when: - A student submits an assignment previously written by a friend - The same paper is submitted to different institutions - Work is recycled from previous semesters or academic years This detection capability helps maintain academic standards across educational institutions globally. ### Contributing to the Community When you choose to scan against the Shared Data Hub, you're not just benefiting from the collective database - you're also contributing to it. Each document you submit helps strengthen the system for all users, creating a more robust detection network that benefits the entire academic community. This contribution also benefits your own institution directly. Once your students' assignments are added to the database, they cannot be recycled or reused by other students at your institution in future semesters. ### Customizing Your Scan Settings You have full control over how your documents are compared within the Shared Data Hub: - **Compare against your institution's submissions**: Use the `properties.scanning.copyleaksDb.includeMySubmissions` parameter to scan against documents from your own institution - **Compare against other institutions' submissions**: Use the `properties.scanning.copyleaksDb.includeOthersSubmissions` parameter to scan against submissions of other users in the network - **Use both options**: Enable both parameters for the most comprehensive plagiarism detection ### Automatic Indexing and Management After completing a scan, your document is automatically indexed and stored within the Shared Data Hub. This makes it available for future comparisons against new submissions at your institution. If you need to remove a document from the database, you can use our [delete request](/reference/actions/authenticity/delete/) and set the `purge` parameter to `true`. This will completely remove the document from the Shared Data Hub. ### Benefits of Using the Shared Data Hub - **Broader Detection**: Access to millions of documents increases the likelihood of identifying plagiarism - **Cross-Institutional Protection**: Detect submissions that may have originated from other schools - **Internal Protection**: Prevent students from reusing assignments within your own institution - **Community Collaboration**: Help build a stronger academic integrity ecosystem for everyone By leveraging the Shared Data Hub, you're taking advantage of one of the most comprehensive plagiarism detection resources available while contributing to the fight against academic dishonesty. ## Scanning Against the Internet To scan against a vast range of online sources, including many academic journals, set the `properties.scanning.internet` parameter to `true`. Internet results will be included in the [Scan Completion Webhook](/reference/data-types/authenticity/webhooks/scan-completed). ## Detecting AI-Generated Content * To check for AI-written text, set the `properties.aiGeneratedText.detect` parameter to `true`. * Your AI detection results are delivered to a dedicated export webhook. For an example of how the data will be structured, see the [Export AI Detection Response documentation](/reference/data-types/authenticity/results/ai-detection/). ![Detect AI-generated Content](/assets/mainpage/AI-Detector-AI-Insights-1.svg) ## Enhancing Student Writing with Grammar Checker Beyond detecting problematic content, Copyleaks also helps students improve their writing skills through our integrated Grammar Checker capabilities. By enabling Grammar Checker within your authenticity scan, you can provide constructive feedback that enhances human writing without triggering AI detection systems. ### Supporting Academic Development The Grammar Checker is designed to help students learn and grow as writers rather than simply correcting their work: * **Grammar and Mechanics**: Catch spelling mistakes, comma errors, subject-verb disagreements, and comprehensive grammar issues * **Sentence Structure**: Identify run-on sentences, fragments, and awkward phrasing to improve clarity * **Word Choice**: Suggest better vocabulary and catch misused words or homophones * **Multi-Language Support**: Provide assistance in English, German, Spanish, French, Italian, and Portuguese ### Grammar Score Assessment The Grammar Checker provides a comprehensive Grammar Score that breaks down writing quality into two key areas: * **Corrections**: Detailed grammar, mechanics, and style suggestions * **Insights**: Analysis of writing patterns, sentence length, and readability To enable Grammar Checker alongside your plagiarism and AI detection scan, set the `properties.writingFeedback.detect` parameter to `true` in your authenticity scan request. The Grammar Checker results will be included in your scan completion webhook. ## Frequently asked questions ### How do I detect students reusing each other's work? Scan against the Shared Data Hub using `properties.scanning.copyleaksDb.includeMySubmissions` (your own institution's submissions) and `properties.scanning.copyleaksDb.includeOthersSubmissions` (submissions from other institutions). Enable both for the broadest coverage. ### Can I remove a student's document from the Shared Data Hub? Yes. Send a [delete request](/reference/actions/authenticity/delete/) with the `purge` parameter set to `true` to completely remove the document from the database. ### How do I check for AI-generated text in the same scan? Set `properties.aiGeneratedText.detect` to `true`. AI detection results are delivered to a dedicated export webhook, structured as shown in the [Export AI Detection Response](/reference/data-types/authenticity/results/ai-detection/). ### Can I scan against the internet and academic journals? Yes. Set `properties.scanning.internet` to `true`. Internet matches are included in the [Scan Completion Webhook](/reference/data-types/authenticity/webhooks/scan-completed). ### Can I give students grammar feedback too? Yes. Set `properties.writingFeedback.detect` to `true` in the same authenticity scan to return a Grammar Score with corrections and writing insights in the completion webhook. ## Support Need help implementing these solutions? Our team is here to assist you every step of the way. Whether you have technical questions or need guidance on best practices, don't hesitate to reach out through [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or engage with our developer community on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) using the `copyleaks-api` tag. ## Next Steps Enhance your academic integrity solution with grammar and writing quality assessment. Learn how to automatically identify text manipulation techniques being used to bypass detection. To get scan results, you must set up webhooks. These automated messages will notify your system as scans are completed. Learn how to present the scan data to your users with our customizable interactive report, a downloadable PDF, or by integrating the results directly into your own UI. Want to see how Copyleaks can enhance your academic integrity solutions? Our technical team can walk you through live examples of scanning against the Shared Data Hub, AI detection, and more. --- ## Enterprise Content Governance Source: https://docs.copyleaks.com/concepts/use-cases/enterprise-content-governance > Build enterprise AI content governance with the Copyleaks API: protect IP, detect AI-generated content, ensure compliance, and verify code integrity. In recent years, the adoption of GenAI technologies has surged across all sectors. While this technology offers significant advantages, it also presents prominent risks. As companies race to adopt generative AI, they face critical challenges: protecting intellectual property, ensuring code integrity, maintaining brand authenticity, moderating content at scale, and establishing responsible AI adoption policies. Enterprise AI governance has become essential for organizations seeking to harness artificial intelligence while maintaining security, compliance, and operational integrity. A comprehensive AI governance framework helps companies balance innovation with risk management, ensuring that AI technologies enhance rather than compromise business objectives. A single incident of leaked proprietary information or compromised code integrity can result in millions in losses, regulatory penalties, and irreparable damage to brand trust. That's why forward-thinking enterprises are implementing comprehensive AI governance frameworks that protect their most valuable assets while enabling safe AI adoption. For developers building [enterprise content governance](https://copyleaks.com/enterprise) solutions, the Copyleaks API provides the essential building blocks for robust AI risk management. From detecting unauthorized use of proprietary information to ensuring code authenticity and managing AI-generated content policies, our APIs help you build systems that protect what matters most while empowering responsible innovation. ![Enterprise AI Governance](/assets/mainpage/AI-Detector-AI-Insights-1.svg) ## Why Enterprise AI Governance Matters Enterprises are working to adopt AI safely while protecting their intellectual property, reputation, and compliance standing. An effective AI governance framework provides the structure and policies needed for responsible AI adoption across the organization. The risks are significant, and a single misstep can be costly. Whether it's sensitive data being exposed or AI-generated content being presented as authentic human work, the stakes are high. That's why leading enterprises are not just adopting AI-they're governing it with comprehensive AI risk management strategies. ### Protect Intellectual Property and Enforce Policies A company's proprietary content and code are key competitive differentiators. However, when employees use AI tools, this intellectual property can be inadvertently exposed. Our API allows you to scan internal documents against billions of online sources and data hubs to detect and prevent leaks of proprietary information. This acts as an early warning system, identifying when sensitive data like emails, phone numbers, or other confidential information is at risk of exposure. For development teams, we help prevent proprietary code from being used and alert you to potential licensing conflicts, helping you avoid legal complications. [**Plagiarism Detection**](/concepts/products/plagiarism-checker-api) ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) ### Distinguish Between Human and AI-Generated Content As AI-generated text becomes more sophisticated, telling the difference between human and artificial content is a growing challenge, especially when brand authenticity is critical. Our [AI Detector](https://copyleaks.com/ai-detector) solution identifies AI-generated text with exceptional accuracy and a very low rate of false positives. To ensure full transparency, our AI Logic feature provides supportive statistics for each detection, showing which phrases are most indicative of AI generation. [**AI Content Detection**](/concepts/products/ai-text-detection-api) ### Verify Visual Media Authenticity The rise of AI-generated images introduces new risks, from deepfake fraud to synthetic brand imagery that can damage your reputation. Verifying the authenticity of visual media is now a critical component of enterprise governance. Our [AI Image Detector](https://copyleaks.com/ai-detector/ai-image-detector) API identifies synthetic images from all major AI generators, helping you prevent insurance fraud, secure financial transactions, and protect your brand from visual disinformation. [**AI Image Detection**](/concepts/products/ai-image-detection-api) ### Prevent Harmful Content Regulatory missteps and brand-damaging incidents can have serious consequences. Proactive prevention is far more effective than reactive damage control. Our Text Moderation API can help you automatically scan textual content for more than 10 categories including toxic, hate-speech, self-harm and more. Unlike simple keyword filters, our AI understands context, leading to more accurate detection and fewer false alarms. [**Content Moderation**](/concepts/products/text-moderation-api) ![Text Moderation](/assets/mainpage/textModeration_ContextualAwareness.webp) ### Improve Writing Our Grammar Checker helps your teams enhance their writing while maintaining authenticity. It offers grammar, spelling, sentence structure, and clarity that can help writers write better. The tool supports multiple languages, including English, German, Spanish, French, Italian, and Portuguese. You gain detailed insights into writing quality and readability, allowing you to track improvements over time and align the written content to its readers' needs. [**Grammar Checker**](/concepts/products/writing-assistant-api) ![Grammar Checker API](/assets/mainpage/Absolute-Confidence.png) ## Implementing AI Governance Controls ### Scan Documents Set up comprehensive, regular audits of your organization's content to monitor for AI use, IP leakage, and unauthorized sharing. - **[Get Started with Plagiarism Detection](/guides/authenticity/detect-plagiarism-text)** - Learn how to scan documents against billions of web pages and your private repositories. - **[Get Started with AI Content Detection](/guides/ai-detector/ai-text-detection)** - Identify AI-generated text within your organization. This approach helps you detect AI-generated content in internal documents, verify that proprietary information has not been exposed online, and monitor for data leaks. ### Monitor Code Repositories Protect your source code with specialized scanning for programming languages. - **Continuous Integration**: Integrate code scanning into your CI/CD pipeline. - **Pull Request Reviews**: Automatically check for plagiarized code in contributions. - **License Compliance**: Identify potential copyright issues before they enter the main branch. ## Advanced Detection Capabilities ### AI Logic for Explainable Results When content is flagged as AI-generated, our AI Logic feature provides clear, transparent explanations. Within the flagged text we highlight specific phrases. For each phrase we provide a purely statistical analysis of how prevalant is this phrase in AI-generated texts versus human-written texts. Generative AI tend to use the same generic phrases again and again so usually you would see many of those phrases in an AI written article. This transparency is crucial for enterprise environments where decisions must be defensible and actionable. [**AI Logic**](/concepts/features/ai-logic/) ### Detect Text Manipulation Sophisticated users may try to disguise AI-generated or plagiarized content. Our detection identifies common manipulation techniques, including: - **Character Substitution**: Finds when letters are replaced with similar-looking symbols. - **Hidden Characters**: Detects invisible text inserted to the document. - **Paraphrasing and Spinning**: Identifies content that has been run through paraphrasing tools. [**Text Manipulation**](/concepts/features/text-manipulation/) ## Enhancing Content Quality ### Writing Enhancement The Grammar Checker helps employees improve their writing: - **Grammar and Style**: Correct errors and improve clarity while maintaining authenticity. - **Multilingual Support**: Provide assistance in English, German, Spanish, French, Italian, and Portuguese to assist global teams. ### Grammar Score Assessment Get detailed insights into content quality with specific grammar, mechanics, and style suggestions, along with analysis of writing patterns and readability metrics. To enable the Grammar Checker alongside your governance scanning, refer to our **[Grammar Checker integration guide](/guides/writing/check-grammar)** for implementation details. [**Grammar Checker API**](/concepts/products/writing-assistant-api/) ## Industry-Specific AI Governance Applications Financial institutions must adhere to strict regulatory requirements. Our APIs help detect plagiarism and unauthorized AI use in financial reports, protect proprietary algorithms, and maintain audit trails for compliance with SEC, FINRA, and SOX regulations. Healthcare organizations need to protect patient data while empowering innovation. Our platform helps detect the use of AI with sensitive patient data, ensures the authenticity of research content, and maintains the integrity of clinical documentation, in compliance with HIPAA. Law firms and professional services companies handle highly confidential client information. Our solutions help maintain document authenticity, protect client information from unauthorized AI processing, and ensure compliance with professional legal standards. Technology companies wish to protect source code and prevent IP theft. Our governance tools help detect when proprietary code is exposed to external AI models, identify plagiarized code contributions, and maintain the integrity of the development process. ## Security and Compliance Enterprise AI governance demands the highest security standards. Our platform is built to provide robust protection and compliance: - **SOC 2 and SOC 3 Certified**: Your data is protected by enterprise-grade security controls. - **GDPR Compliant**: We ensure full compliance with international privacy regulations. - **Military-Grade Encryption**: We use 256-bit encryption with SSL and 100% HTTPS data transfer. - **Audit Trails**: We provide complete logging of all scanning and detection activities for oversight. [**Learn more about our security standards**](/concepts/security/overview/) ## Support Implementing enterprise AI governance is a complex undertaking. Our team provides dedicated support for enterprise customers, including technical consultation, custom integration assistance, and ongoing policy optimization. Contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or engage with our developer community on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) using the `copyleaks-api` tag. ## Next Steps Explore our award-winning AI detection capabilities with exceptional accuracy and very low false positive rates. Learn about our comprehensive plagiarism detection that protects your intellectual property across billions of sources. Discover intelligent content moderation that understands context and ensures compliance across 10+ categories. Enhance content quality with AI-safe Grammar Checker that won't trigger detection systems. Our enterprise team can help you design and implement a comprehensive AI governance strategy tailored to your organization's specific needs and risk profile. --- ## Content Integrity for Publishers Source: https://docs.copyleaks.com/concepts/use-cases/publishers > Detect plagiarism before publishing by comparing content against billions of web pages and academic journals with the Copyleaks API. In the digital age, ensuring the originality of your content is more crucial than ever. With the vast amount of information available online, it is easy for content to be copied or plagiarized without proper attribution. This can lead to significant issues for publishers, including legal challenges, loss of credibility, and damage to brand reputation. ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) ## The Power of Internet-Wide Scanning The Copyleaks [Plagiarism Checker](https://copyleaks.com/plagiarism-checker) API provides a powerful solution for detecting internet plagiarism, allowing you to compare your content against billions of online sources, including websites, articles, and academic journals. When you enable internet scanning, you are tapping into a vast and ever-growing database of online content. This allows you to: - **Verify Originality**: Ensure that your content is original before publishing. - **Protect Your IP**: Discover if your content has been plagiarized and published elsewhere without your permission. - **Maintain SEO Rankings**: Avoid penalties from search engines for duplicate content. ## Text Moderation for Safe Content The Copyleaks Text Moderation API is designed to detect harmful content, including hate speech, adult content, and other forms of inappropriate material. This is particularly useful for publishers who want to ensure that their content adheres to community guidelines and standards. ## Before You Begin Make sure you are familiar with Copyleaks scans by completing the [Check for Plagiarism](/guides/authenticity/detect-plagiarism-text) guide. ## Verify Content Originality Against Online Sources ### Enabling Internet Scanning To scan your document against internet sources, set the `properties.scanning.internet` parameter to `true`. This enables scanning against all non-paywalled online sources, including a variety of academic journals. For more information check out our documentation for [URL scans](/reference/actions/authenticity/submit-url/), [OCR scans](/reference/actions/authenticity/submit-ocr/), and [File scans](/reference/actions/authenticity/submit-file/). ```json title="Enable Internet Scanning" { "properties": { "scanning": { "internet": true } } } ``` ### Receiving Results Once your scan is completed, you'll receive the results through the [completed webhook](/reference/data-types/authenticity/webhooks/scan-completed) event. This webhook is triggered when the scan process finishes successfully and contains the output information from the scan. The internet plagiarism results will be located in the `results.internet` array within the webhook payload. Each internet match includes: - `id` - Unique identifier for the match - `title` - Title of the matched content - `url` - Source URL where the match was found - `matchedWords` - Number of words that matched - `metadata` - Additional information about the source (author, organization, publish date, etc.) ### Example payload structure ```json { "status": 0, "scannedDocument": { "scanId": "your-scan-id", "totalWords": 1250, "credits": 1 }, "results": { "internet": [ { "id": "match-id", "title": "Source Title", "url": "https://example.com/source", "matchedWords": 45, "metadata": { "author": "Author Name", "organization": "Publisher", "publishDate": "2023-01-01" } } ] } } ``` ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) ## Moderating Content for Safety To ensure that your published content is safe and adheres to your community standards, you can use the Copyleaks Text Moderation API. This API allows you to scan text for harmful content across more than 10 categories, including hate speech, adult content, and other inappropriate material. ### Submitting Content for Moderation To moderate a piece of content, send a POST request to the `/v1/text-moderation/{scanId}/check` endpoint. In the request body, you will provide the text to be analyzed and specify which content moderation labels you want to check for. For example, a publisher might want to check for toxicity, profanity, and hate speech: ```json title="Example Moderation Request" { "text": "Your text content to be moderated goes here.", "labels": [ { "id": "toxic-v1" }, { "id": "profanity-v1" }, { "id": "hate-speech-v1" } ] } ``` ### Understanding the Results The API will respond with a detailed analysis, pinpointing the exact segments of text that were flagged and for which categories. This allows you to build a workflow to automatically handle or review content that violates your policies. For a complete list of supported categories, see the [Content Moderation Labels](/reference/data-types/moderation/text-moderation-labels/) documentation. To get started with your integration, follow the [Moderate Text Content](/guides/moderation/moderate-text/) guide. ![Text Moderation](/assets/mainpage/textModeration_ContextualAwareness.webp) ## Detecting AI-Generated Content You may also want to detect when content is generated by AI models. This can help you ensure that your published material meets your authenticity standards. * To check for AI-written text, set the `properties.aiGeneratedText.detect` parameter to `true`. * Your [AI detection](https://copyleaks.com/ai-detector) results are delivered to a dedicated export webhook. For an example of how the data will be structured, see the [Export AI Detection Response documentation](/reference/data-types/authenticity/results/ai-detection/). ![Detect AI-generated Content](/assets/mainpage/AI-Detector-AI-Insights-1.svg) ### Verifying Image Authenticity In an era of visual misinformation, verifying the authenticity of images is essential for maintaining reader trust and editorial integrity. AI-generated images can be used to create fake news, doctored evidence, or misleading content that can damage a publisher's reputation. Our [AI Image Detection](https://copyleaks.com/ai-detector/ai-image-detector) API helps publishers identify synthetic images from all major AI generators, ensuring that all visual content meets your authenticity standards before publication. [**AI Image Detection**](/concepts/products/ai-image-detection-api) ## Enhancing Content Quality with Grammar Checker Beyond detecting problematic content, publishers can also leverage Copyleaks to improve the quality and professionalism of their written material. By enabling Grammar Checker within your authenticity scan, you can ensure that your content meets the highest editorial standards before publication. ### Supporting Editorial Excellence Grammar Checker is designed to help publishers maintain consistent, high-quality content across all publications: * **Grammar and Mechanics**: Catch spelling mistakes, comma errors, subject-verb disagreements, and comprehensive grammar issues * **Sentence Structure**: Identify run-on sentences, fragments, and awkward phrasing to improve readability * **Word Choice**: Suggest better vocabulary and catch misused words or homophones * **Multi-Language Support**: Provide assistance in English, German, Spanish, French, Italian, and Portuguese ### Grammar Score Assessment The Grammar Checker provides a comprehensive Grammar Score that breaks down writing quality into two key areas: * **Corrections**: Detailed grammar, mechanics, and style suggestions * **Insights**: Analysis of writing patterns, sentence length, and readability This helps publishers maintain consistent editorial standards across all content, whether it's news articles, blog posts, or marketing materials. ### Integration Options You have two ways to integrate Grammar Checker capabilities: 1. **Integrated with Authenticity Scanning**: Enable Grammar Checker alongside your plagiarism and AI detection scan by setting the `properties.writingFeedback.detect` parameter to `true` in your authenticity scan request. The Grammar Checker results will be included in your scan completion webhook. 2. **Dedicated Grammar Checker API**: For standalone grammar and writing quality checks, use the dedicated [Grammar Checker API](/reference/actions/writing-assistant/check/) endpoint. This is ideal when you only need writing feedback without plagiarism or AI detection. ## Support Should you require any assistance or have inquiries, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. ## Next Steps Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. Want to see how internet plagiarism detection works with your specific content? Our technical team can walk you through live examples of scanning against billions of online sources, including academic journals and websites. --- ## User-Generated Content Platforms Source: https://docs.copyleaks.com/concepts/use-cases/user-generated-content-platforms > Learn how to maintain a safe online environment by integrating Copyleaks' context-aware AI for moderating user-generated content (UGC) at scale. In today's digital landscape, user-generated content (UGC) platforms face a multi-faceted challenge: fostering a vibrant community while protecting it from harmful, inauthentic, or unoriginal content. From blog comments and product reviews to social media posts and forum discussions, maintaining content integrity is crucial for brand reputation and user trust. Copyleaks provides a comprehensive suite of tools to address these challenges, including real-time [Text Moderation](https://copyleaks.com/text-moderation), precise [AI Detection](https://copyleaks.com/ai-detector), and robust [Plagiarism Checker](https://copyleaks.com/plagiarism-checker). ![Text Moderation](/assets/mainpage/textModeration_ContextualAwareness.webp) ## Moderate User-Generated Content User-generated content is the lifeblood of many platforms, but it also opens the door to significant risks. Harmful content-such as hate speech, harassment, and explicit material-can poison your community, drive away users, and damage your brand's reputation. Manually reviewing every piece of content is often impossible at scale. This is where automated text moderation becomes essential for creating a safe and welcoming online environment. ### Understanding the Challenge User-generated content platforms across various industries face common moderation challenges. Comment sections with hate speech, user-submitted articles with inappropriate content, and forums requiring real-time moderation. Fake or spam reviews, personal attacks between users, and content that violates platform policies. User-generated ad content with policy violations, harmful campaign descriptions, and community content needing compliance checks. High-volume content requiring instant, context-aware moderation decisions in real-time. ### Why Choose Copyleaks Text Moderation Our text moderation AI goes beyond simple keyword matching. It understands context, nuance, and intent, providing highly accurate detection of harmful content while minimizing false positives. - **Superior Accuracy:** Exceptional detection rates with minimal false positives. - **Context Understanding:** Words are evaluated based on their context, not just their presence. - **Precise Location Detection:** Pinpoint exactly where in the text harmful content appears. - **Explanation-Driven:** Get clear reasoning for each moderation decision. - **Comprehensive Coverage:** Detect content across 10+ categories, including adult content, hate speech, harassment, self-harm, and more. ### Implementation Benefits Maintain community standards with context-aware decisions, protecting users and your brand reputation while reducing legal and regulatory risks. Reduce manual moderation workload through precise automated flagging and scale your moderation efforts seamlessly as your platform grows. Minimize false positives and provide clear explanations for moderation decisions, maintaining authentic user interactions while ensuring safety. ### Integration Made Simple Our Text Moderation API integrates seamlessly into existing content workflows. Send user-generated text through our API for analysis. Get character-level flagging information with explanations for each detected violation. Implement automated or manual review based on precise, explained results. Track moderation effectiveness and adjust thresholds based on clear metrics. ## Detect AI-Generated Content The rise of generative AI has introduced a new layer of complexity for UGC platforms. Inauthentic content, such as AI-generated fake reviews, spammy comments, or low-quality articles, can mislead users, manipulate ratings, and erode the trust you've built with your community. The Copyleaks AI Detector helps you maintain authenticity by identifying text produced by models like ChatGPT, Gemini, and others, allowing you to flag and manage potentially deceptive submissions. ### Submitting Content for AI Detection To check for AI-generated content, send a POST request to the `/v2/writer-detector/{scanId}/check` endpoint. ```json title="Example AI Detection Request" { "text": "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures." } ``` ### Understanding the Results The API returns a summary indicating the likelihood of AI-generated content, along with a detailed breakdown of the text. This allows you to flag potentially inauthentic user submissions, such as AI-written reviews or comments. For more details, follow the [Detect AI-Generated Text](/guides/ai-detector/ai-text-detection/) guide. ![AI Logic](/assets/mainpage/AI-Logic-1024x670.webp) ## Detect Plagiarism For platforms that rely on original user submissions-such as publishing platforms, educational forums, or creative communities-plagiarism poses a significant threat. Submitting copied content can lead to copyright infringement issues, damage your platform's credibility, and devalue the contributions of your authentic users. The Copyleaks Plagiarism Checker empowers you to verify the originality of every submission, protecting your platform and upholding your content standards. ### Submitting Content for Plagiarism Detection To check for plagiarism, send a POST request to the `/v3/scans/submit/file/{scanId}` endpoint. ```json title="Example Plagiarism Detection Request" { "base64": "SGVsbG8gd29ybGQh", "filename": "file.txt", "properties": { "webhooks": { "status": "https://yoursite.com/webhook/{STATUS}/my-custom-id" }, "sandbox": true } } ``` ### Understanding the Results The API will notify you via webhooks when the scan is complete. You can then export the results to see if any plagiarism was detected. For more details, follow the [Detect Plagiarism in Text](/guides/authenticity/detect-plagiarism-text/) guide. ![Plagiarism Checker](/assets/mainpage/SampleReport-2.svg) ## Support Need help implementing content moderation for your platform? Our team understands the unique challenges of UGC platforms and can provide tailored guidance. Contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or engage with our developer community on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) using the `copyleaks-api` tag. ## Next Steps Ready to implement effective content moderation for your platform? Step-by-step guide to integrating Copyleaks Text Moderation API into your platform. Detailed information about all supported content categories. Identify AI-generated content in user submissions. Get personalized guidance on implementing content moderation. Want to see how Copyleaks can enhance your user-generated content moderation? Our technical team can walk you through live examples of real-time moderation and AI detection. --- # Concepts → Features ## Features Source: https://docs.copyleaks.com/concepts/features/overview > Configurable features across the Copyleaks API, detection levels, exclusions, AI logic, data hubs, and more. Tune how scans behave. These pages cover the configurable features available across the Copyleaks APIs, from detection sensitivity to data scoping. How the AI detection model reasons about text, with explanations and confidence scoring. Flag plagiarism sources, online or internal, that are themselves suspected of being AI-generated. Detect plagiarism across languages - content translated then submitted as original. Compare against private and shared databases beyond the public internet index. Tune sensitivity across identical, minor-change, and paraphrased matches. Strip headers, references, quotes, or template text from the scan. Generate a PDF version of the scan report for archival or sharing. The combined plagiarism + AI detection scan flow. Surface scan results in your own UI via iframe or open-source module. Configure detection to flag only verbatim copies, skipping paraphrased matches. Index a writer's own past work and flag overlap on new submissions. Catch character substitution and formatting tricks used to bypass detection. --- ## AI Logic Source: https://docs.copyleaks.com/concepts/features/ai-logic > A guide to using Copyleaks AI Logic to understand the reasoning behind AI detection results, providing transparency and enabling more confident decision-making. In a world where the line between human and AI-generated content is increasingly blurred, transparency is paramount. Copyleaks AI Logic is a groundbreaking feature that provides unprecedented insight into the "why" behind our AI detection results. It moves beyond a simple score to reveal the specific patterns and characteristics that indicate the presence of AI-generated content. ## The Power of Explainability AI Logic is designed to address the "black box" problem in [AI detection](https://copyleaks.com/ai-detector). By providing a clear, data-driven explanation for each result, we empower you to: - **Make Confident Decisions**: Understand the specific signals that led to a piece of content being flagged, allowing you to make more informed and defensible decisions. - **Build Trust with Users**: Provide your users with a transparent explanation of why their content was flagged, fostering a sense of fairness and trust. - **Facilitate Constructive Dialogue**: Use the detailed insights from AI Logic to have more productive conversations about the appropriate use of AI tools. ### How to Use AI Logic AI Logic is available as an optional parameter in your AI detection API requests. When enabled, the API response will include an additional `patterns` object that contains a detailed breakdown of the AI and human-like patterns found in the text. This object includes: - **Statistics**: A comparison of the statistical properties of the text against known AI and human writing patterns. - **Textual Analysis**: The specific segments of the text that exhibit AI-like characteristics, including their exact location and length. By analyzing this data, you can gain a deeper understanding of the AI's assessment and build more sophisticated and transparent content integrity workflows. ### A New Level of Transparency AI Logic represents a significant step forward in the field of AI detection. By providing a clear and understandable explanation for our results, we are empowering developers, educators, and content creators to navigate the evolving landscape of AI-generated content with confidence and integrity. ## Usage Explanation Upon successful completion of the request, the API will return a response containing various logics related to AI and human-written texts. **Example JSON Response** ```json { "patterns": { "statistics": { "aiCount": [ 15.9636, 39.5495, 84.7079, 119.8710, 9.9233, 185.6670, 14.4536, 19.1995 ], "humanCount": [ 0.8076, 1.5076, 3.8228, 8.5071, 0.3769, 4.2536, 0.3231, 1.1845 ] }, "text": { "chars": { "starts": [31, 55, 303, 909, 961, 987, 1129, 1775], "lengths": [23, 32, 23, 33, 25, 30, 30, 19] }, "words": { "starts": [5, 9, 45, 135, 144, 148, 169, 257], "lengths": [4, 6, 3, 6, 4, 5, 5, 3] } } } } ``` ## Understanding the Response The response provides data that helps understand why certain text patterns have been flagged as likely AI-generated. This information enables: - Clear documentation explaining AI detection results - Facilitation of dialogue that leads to mutual understanding and trust - Easy interpretation of detection results for quick action - Collaboration and data-driven conclusions. ## Next Steps Explore the full API reference for the AI Detection endpoint. --- ## AI Source Match Source: https://docs.copyleaks.com/concepts/features/ai-source-match > Identify online and internal sources suspected of containing AI-generated content with Copyleaks AI Source Match, strengthening plagiarism detection. In today's digital landscape, the challenge of academic integrity has evolved beyond traditional plagiarism. AI Source Match represents a revolutionary advancement in plagiarism detection, specifically designed to identify sources, both online and from the Copyleaks internal AI database, that may contain AI-generated content. This dual-layer detection system not only finds potential plagiarism but also reveals whether the matched source content itself might have been created by artificial intelligence. ## The Evolution of Plagiarism Detection AI Source Match addresses a critical gap in modern content verification. As AI-generated content becomes more prevalent across the internet, traditional plagiarism detection tools may flag content against sources that are themselves artificially created. This creates a complex scenario where understanding the nature of the source material is as important as identifying the match itself. By scanning internet sources (`aiSourceMatch`) and the Copyleaks internal AI database (`internalAiSourceMatch`), these features provide: - **Comprehensive Source Analysis**: Identify not just plagiarism, but the AI likelihood of the source material itself. - **Enhanced Academic Integrity**: Make more informed decisions about content originality by understanding the nature of matched sources. - **Improved Context**: Distinguish between copying from human-authored sources versus AI-generated content. - **Advanced Reporting**: Provide detailed insights into both plagiarism patterns and source authenticity. **Configuration Parameters:** ```json { "aiSourceMatch": { "enable": true }, "internalAiSourceMatch": { "enable": true } } ``` ### How It Works Both features operate through the same multi-step process, differing only in where they look for matches: 1. **Source Scanning**: `aiSourceMatch` performs comprehensive internet searches; `internalAiSourceMatch` queries the Copyleaks internal AI database. 2. **Source Analysis**: Each identified source is analyzed using advanced [AI detection](https://copyleaks.com/ai-detector) algorithms to determine the likelihood that the source content was AI-generated. 3. **Dual Reporting**: Results provide both traditional plagiarism metrics and the AI likelihood of the matched sources. 4. **Enhanced Insights**: Users receive detailed information about both the plagiarism match and the authenticity nature of the source material. ## Understanding AI Source Match Results The AI Source Match feature enhances standard plagiarism reports by adding an additional layer of source authenticity analysis. This enables educators, publishers, and content managers to: **Identify Complex Plagiarism Scenarios:** - Detect when students copy from AI-generated sources - Understand if matched content originates from authentic human sources - Distinguish between different types of content integrity issues **Make Informed Decisions:** - Assess the severity of plagiarism based on source authenticity - Develop appropriate responses based on the nature of the matched content - Build comprehensive content integrity policies ### Best Practices for Implementation To maximize the effectiveness of AI Source Match: **For Educators:** - Use results to facilitate discussions about AI usage and academic integrity - Consider source authenticity when determining appropriate responses to plagiarism - Develop clear policies that address both traditional plagiarism and AI-source copying **For Publishers:** - Implement AI Source Match as part of content verification workflows - Use insights to understand content originality in submissions - Maintain transparency about detection methods with contributors **For Content Managers:** - Integrate AI Source Match into content quality assurance processes - Use results to assess content authenticity across digital platforms - Develop comprehensive content integrity standards ## Technical Implementation AI Source Match integrates seamlessly with existing Copyleaks API implementations. When enabled, the feature automatically enhances plagiarism detection results without requiring additional API calls or modifications to your existing workflow. **Key Implementation Notes:** - Both `aiSourceMatch` and `internalAiSourceMatch` default to `false` and must be explicitly enabled - Results are included in standard plagiarism detection response objects - No additional authentication or setup required beyond existing API access ## Benefits and Use Cases AI Source Match provides value across multiple scenarios: **Academic Institutions:** - Enhanced student submission evaluation - Improved academic integrity enforcement - Better understanding of content originality issues **Publishing Industry:** - Comprehensive manuscript authenticity verification - Source material quality assessment - Content originality validation **Content Platforms:** - User-generated content quality control - Authenticity verification for submissions - Platform integrity maintenance --- ## Cross-Language Detection Source: https://docs.copyleaks.com/concepts/features/cross-language-detection > Detect translated plagiarism with the Copyleaks API - find content copied from another language across 9 source and 30+ target languages. import SubmissionMethods from '/snippets/submission-methods.mdx'; import InstallSDKs from '/snippets/install-sdks.mdx'; The Copyleaks Cross-Language Detection is a powerful feature that enables you to identify plagiarism across different languages. It can detect content that has been translated from one language to another, helping catch sophisticated plagiarism attempts where text is copied, translated, and presented as original work. This guide will walk you through the process of using Cross-Language Detection and understanding its capabilities. ## Overview Cross-Language Detection identifies content that has been translated from one language to another. For example, if someone takes content written in English, translates it to Spanish, and presents it as original work, Cross-Language Detection can identify this plagiarism attempt. View the complete list of supported source and result languages for cross-language detection. Learn how to submit content for plagiarism detection including cross-language detection. ## How It Works Cross-Language Detection uses advanced translation and semantic matching technology to: 1. **Analyze Source Document**: The system processes your submitted document in its original language. 2. **Translation Analysis**: The content is analyzed across different language databases. 3. **Semantic Matching**: Beyond direct translation, the system looks for semantic similarities that might indicate translated plagiarism. 4. **Results Compilation**: Findings are compiled into a comprehensive report that identifies potential matches across languages. ## Key Benefits - **Catch Sophisticated Plagiarism**: Identify plagiarism attempts that involve translation, which traditional [plagiarism checkers](https://copyleaks.com/plagiarism-checker) would miss. - **Multi-Language Support**: Support for multiple source languages and an even wider range of result languages. - **Seamless Integration**: Use the same API workflow as regular plagiarism checks with additional parameters. - **Detailed Reporting**: Get precise information about cross-language matches with the same detailed reporting as standard plagiarism detection. ## Get Started Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. To perform a scan, we first need to generate an access token. For that, we will use the [**login**](/reference/actions/account/login) endpoint. The API key can be found on the [**Copyleaks API Dashboard**](https://api.copyleaks.com/dashboard). Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the `Authorization: Bearer ` header. This token remains valid for 48 hours. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Headers Content-Type: application/json Body { "email": "your@email.address", "key": "00000000-0000-0000-0000-000000000000" } ``` ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" # Login to Copyleaks auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Logged successfully!\nToken:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); // Login function function loginToCopyleaks() { return copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then( (loginResult) => { console.log("Login successful!"); console.log("Access Token:", loginResult.access_token); return loginResult; }, (err) => { console.error('Login failed:', err); throw err; } ); } loginToCopyleaks(); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; // Login to Copyleaks try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); } catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1); } ``` **Response** ```json { "access_token": "", ".issued": "2025-07-31T10:19:40.0690015Z", ".expires": "2025-08-02T10:19:40.0690016Z" } ``` Save this token! It's valid for 48 hours and can be reused for subsequent API calls. For this guide, we'll demonstrate document submission for cross-language detection. Each submission requires a unique `scanId` for proper tracking and identification. For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v3/scans/submit/file/{scanId} Content-type: multipart/form-data Authorization: Bearer YOUR_LOGIN_TOKEN Request Body: { "base64": "", "filename": "my-document.pdf", "properties": { "sandbox": true, "scanning": { "crossLanguages": { "languages": [ { "code": "es" }, { "code": "fr" } ] } } } } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v3/scans/submit/file/my-scan-123" \ -H "Authorization: Bearer " \ -H "Content-Type: multipart/form-data" \ -F "file=@my-document.pdf" \ -F 'properties={ "sandbox": true, "scanning": { "crossLanguages": { "languages": [ { "code": "es" }, { "code": "fr" } ] } } }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties scan_id = "my-scan-123" file_path = "my-document.pdf" # Create document to scan file_submission = FileDocument(file_path) file_submission.set_sandbox(True) # Configure cross-language detection properties = ScanProperties() properties.set_scanning_cross_languages(["es", "fr"]) # Spanish and French file_submission.set_properties(properties) # Submit for scanning response = Copyleaks.submit_file(auth_token, scan_id, file_submission) print(response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); async function submitWithCrossLanguage() { try { // Initialize Copyleaks const copyleaks = new Copyleaks(); // Login to get the authentication token const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY'); const scanId = `cross-lang-scan-${Date.now()}`; // Create a file submission model const fileToSubmit = './my-document.pdf'; const submission = new CopyleaksFileSubmissionModel(fileToSubmit); submission.sandbox = true; // Set cross language properties submission.properties = { scanning: { crossLanguages: { languages: [ { code: "es" }, { code: "fr" } ] } } }; // Submit the file for scanning const response = await copyleaks.submitFileAsync(loginResult, scanId, submission); console.log("Submission successful:", response); } catch (error) { console.error("An error occurred:", error); } } submitWithCrossLanguage(); ``` ## Supported Languages Cross-Language Detection supports a wide range of languages: - **Source Languages**: The document you upload can be in one of the supported source languages (Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish). - **Result Languages**: Copyleaks can detect plagiarism in over 30 target languages, including Albanian, Bulgarian, Chinese, Czech, German, Greek, Hindi, Japanese, Korean, and many more. The list of supported languages is continually expanding. For the most up-to-date list, use the [Supported Cross-Languages API](/reference/actions/miscellaneous/supported-cross-languages). ## Pricing Cross-Language Detection uses additional credits based on the following model: 1. **Base Scan**: The base scan in the document's original language counts as normal (1 credit per 250 words). 2. **Additional Languages**: Each additional language selected for cross-language detection will incur the same credit cost as the base scan. For example, if your document is 1,000 words (4 credits) and you select two additional languages for cross-language detection (Spanish and French), the total cost would be: - Base scan: 4 credits - Spanish: 4 credits - French: 4 credits - Total: 12 credits For precise credit calculation, use the [Price Check Before Scan](/concepts/management/manage-your-credits#price-check-before-scan) feature to get an exact quote before proceeding with the scan. ## Use Cases Cross-Language Detection is particularly valuable in several scenarios: - **Academic Institutions**: Universities with international student bodies can detect plagiarism regardless of the original content's language. - **Global Publishing**: Publishers that operate in multiple regions can ensure content originality across language barriers. - **Research Verification**: Researchers can verify the originality of work when citing sources from different languages. - **Content Licensing**: Media companies can protect their intellectual property from unauthorized translations. ## Best Practices To maximize the effectiveness of Cross-Language Detection: 1. **Select Relevant Languages**: Choose only the languages that are relevant to your use case to optimize credit usage. 2. **Use with Regular Plagiarism Detection**: Cross-Language Detection works best as a complement to standard plagiarism detection. 3. **Review Results Carefully**: Because translation can alter sentence structure and word choice, review cross-language matches with special attention to semantic similarity rather than exact matches. ## Frequently asked questions ### What is cross-language plagiarism detection? It identifies content that was copied from one language, translated into another, and presented as original - for example English text translated to Spanish. Standard same-language plagiarism checks miss this; cross-language detection catches it using translation and semantic matching. ### Which source languages are supported? You can upload documents in Danish, Dutch, English, French, German, Italian, Portuguese, Russian, and Spanish. The list keeps expanding - see the [Supported Cross-Languages API](/reference/actions/miscellaneous/supported-cross-languages) for the current list. ### How many target languages can it match against? Copyleaks can detect translated plagiarism in over 30 target languages, including Albanian, Bulgarian, Chinese, Czech, Greek, Hindi, Japanese, and Korean. ### How do I enable cross-language detection? Add a `scanning.crossLanguages.languages` array of language codes to the submission `properties` (for example `[{ "code": "es" }, { "code": "fr" }]`). It uses the same submission workflow as a standard plagiarism scan. ### Does cross-language detection cost extra credits? Yes. The base scan costs the normal 1 credit per 250 words, and each additional language you select costs the same as the base scan. Use [Price Check Before Scan](/concepts/management/manage-your-credits#price-check-before-scan) for an exact quote. --- ## Data Hubs Source: https://docs.copyleaks.com/concepts/features/data-hubs > Learn how to compare multiple documents against each other using Copyleaks' private and shared databases to find similarities and prevent plagiarism. import InstallSDKs from '/snippets/install-sdks.mdx'; Copyleaks' Data Hubs provide a powerful way to compare multiple documents against each other, allowing you to detect similarities and prevent plagiarism within a large batch of content. This is particularly useful for educators who want to check if students have shared work or submitted identical content across a batch of assignments, or companies with large amounts of documents in order to find duplication. ## How It Works Copyleaks provides two types of databases for storing and comparing documents: - **Shared Data Hub**: Global database that contains millions of documents from institutions worldwide. - **Private Cloud Hub**: Private database that is exclusive to your organization, ensuring that your documents remain confidential and secure. You can contribute documents to those databases and compare your documents against them. You can use both databases simultaneously to maximize detection coverage while keeping sensitive documents private. ## Understanding Your Database Options You have two database options for storing and comparing your documents: ### Shared Data Hub (Free) - Contains millions of documents from institutions worldwide - When you index a document, it becomes available for **everyone** to compare against - Contributes to the global academic integrity community - Your documents will be matched against submissions from other institutions ### Private Cloud Hub (Paid) - Creates a completely **private database** for your organization only - Your documents stay within your private environment - Perfect for sensitive or confidential documents - Only you and your organization can access and compare against these documents - Built for large organizations looking to securely store and manage documents - Enables team collaboration with controlled access and user management You can use both databases simultaneously. Your documents can be stored in your Private Cloud Hub while also being compared against the Shared Data Hub for maximum detection coverage. ## How Cross-Comparison Works The process involves two main steps: 1. ** Index your documents**: Upload documents to your chosen database using `IndexOnly` mode. 2. ** Start the comparison**: Run a scan that compares all indexed documents against each other and your selected databases. This two-step approach ensures all documents are properly stored before the comparison begins. ## Get Started Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. To perform a scan, we first need to generate an access token. For that, we will use the [**login**](/reference/actions/account/login) endpoint. The API key can be found on the [**Copyleaks API Dashboard**](https://api.copyleaks.com/dashboard). Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the `Authorization: Bearer ` header. This token remains valid for 48 hours. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Headers Content-Type: application/json Body { "email": "your@email.address", "key": "00000000-0000-0000-0000-000000000000" } ``` ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" # Login to Copyleaks auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Logged successfully!\nToken:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); // Login function function loginToCopyleaks() { return copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then( (loginResult) => { console.log("Login successful!"); console.log("Access Token:", loginResult.access_token); return loginResult; }, (err) => { console.error('Login failed:', err); throw err; } ); } loginToCopyleaks(); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; // Login to Copyleaks try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); } catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1); } ``` **Response** ```json { "access_token": "", ".issued": "2025-07-31T10:19:40.0690015Z", ".expires": "2025-08-02T10:19:40.0690016Z" } ``` Save this token! It's valid for 48 hours and can be reused for subsequent API calls. For each document you want to include in the comparison, submit it for indexing using one of the submit endpoints (`submit-file`, `submit-url`, or `submit-ocr`). Set `properties.action` to `2` (`IndexOnly`) to store the document without scanning it immediately. This avoids consuming scan credits during the indexing phase. You also need to specify which repository to index the document into. **Important**: Any other scanning options (like `internet` or `aiDetection`) must be configured during this indexing step. They cannot be changed later when you start the comparison scan. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-index-scan-1 Content-Type: application/json Authorization: Bearer { "base64": "SGVsbG8gd29ybGQh", "filename": "document1.txt", "properties": { "action": 2, "indexing": { "repositories": ["my-repo-id"] }, "sandbox": true } } ``` ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/file/my-index-scan-1 \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "SGVsbG8gd29ybGQh", "filename": "document1.txt", "properties": { "action": 2, "indexing": { "repositories": ["my-repo-id"] }, "sandbox": true } }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.indexing_properties import IndexingProperties scan_id = "my-index-scan-1" properties = ScanProperties() properties.set_action(2) # IndexOnly properties.set_sandbox(True) indexing = IndexingProperties() indexing.add_repository("my-repo-id") properties.set_indexing(indexing) file_submission = FileDocument( base64="SGVsbG8gd29ybGQh", filename="document1.txt", properties=properties ) response = Copyleaks.Scans.submit_file(auth_token, scan_id, file_submission) print("Document indexed successfully!") print("Scan ID:", scan_id) print("Response:", response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require('plagiarism-checker'); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; async function indexDocumentToRepository() { const copyleaks = new Copyleaks(); // Login first const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); console.log('Logged successfully!\nToken:', authToken); // Document to index const base64Content = "SGVsbG8gd29ybGQh"; // "Hello world!" in base64 // Submit file for indexing only const scanId = "my-index-scan-1"; const fileSubmission = { base64: base64Content, filename: "document1.txt", properties: { action: 2, // IndexOnly indexing: { repositories: ["my-repo-id"], copyleaksDb: true // Also index to shared database }, scanning: { internet: true, repositories: ["my-repo-id"] }, sandbox: true } }; try { const result = await copyleaks.submitFileAsync(authToken, scanId, fileSubmission); console.log('Document indexed successfully!'); console.log('Scan ID:', scanId); console.log('Repository ID: my-repo-id'); console.log('Status: Indexed - waiting for IndexOnly webhook'); return result; } catch (error) { console.error('Failed to index document:', error); } } indexDocumentToRepository(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.response.CopyleaksAuthToken; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; public class DataHubIndexingExample { private static final String EMAIL_ADDRESS = "your@email.address"; private static final String API_KEY = "00000000-0000-0000-0000-000000000000"; public static void main(String[] args) { try { // Login to Copyleaks CopyleaksAuthToken authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged in successfully!"); // Document content to index String base64Content = "SGVsbG8gd29ybGQh"; // "Hello world!" in base64 // Configure submission properties for indexing SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}"); SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); properties.setAction(SubmissionActions.IndexOnly); // Action 2 = IndexOnly // Configure indexing to repositories SubmissionIndexingRepository indexRepo = new SubmissionIndexingRepository(); indexRepo.setId("my-repo-id"); SubmissionIndexing indexing = new SubmissionIndexing(); // Requires copyleaks-java-sdk SubmissionIndexing.setRepositories (coming soon) indexing.setRepositories(new SubmissionIndexingRepository[]{ indexRepo }); indexing.setCopyleaksDb(true); // Also index to shared database properties.setIndexing(indexing); // Configure scanning settings (applied during indexing) SubmissionScanningRepository scanRepo = new SubmissionScanningRepository(); scanRepo.setId("my-repo-id"); SubmissionScanning scanning = new SubmissionScanning(); scanning.setInternet(true); scanning.setRepositories(new SubmissionScanningRepository[]{ scanRepo }); properties.setScanning(scanning); // Create file submission for indexing String scanId = "my-index-scan-1"; CopyleaksFileSubmissionModel fileSubmission = new CopyleaksFileSubmissionModel( base64Content, "document1.txt", properties ); // Submit file for indexing Copyleaks.submitFile(authToken, scanId, fileSubmission); System.out.println("Document indexed successfully!"); System.out.println("Scan ID: " + scanId); System.out.println("Repository ID: my-repo-id"); System.out.println("Status: Indexed - waiting for IndexOnly webhook"); System.out.println("Next step: Wait for all documents to be indexed, then call /v3/scans/start"); } catch (Exception e) { System.out.println("Failed to index document: " + e.getMessage()); e.printStackTrace(); } } } ``` You will need to wait for the `IndexOnly` webhook for each document to confirm it has been successfully indexed before proceeding to the next step. Once all your documents are indexed, make a `PATCH` request to the [`/v3/scans/start`](/reference/actions/authenticity/start/) endpoint. This will begin the comparison scan for all the documents you indexed. Provide the list of `scanId`s from the previous step in the `trigger` array. ```http title="HTTP" icon="globe" PATCH https://api.copyleaks.com/v3/scans/start Content-Type: application/json Authorization: Bearer { "trigger": [ "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" ], "errorHandling": 0 } ``` ```bash title="cURL" icon="terminal" curl --request PATCH \ --url https://api.copyleaks.com/v3/scans/start \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "trigger": [ "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" ], "errorHandling": 0 }' ``` ```python title="Python" icon="python" import requests url = "https://api.copyleaks.com/v3/scans/start" payload = { "trigger": [ "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" ], "errorHandling": 0 } headers = { "Authorization": "Bearer ", "Content-Type": "application/json", "Accept": "application/json" } response = requests.patch(url, json=payload, headers=headers) result = response.json() print("Cross-comparison started!") print("Success:", result.get("success", [])) print("Failed:", result.get("failed", [])) if result.get("success"): print(f"Successfully started {len(result['success'])} scans") print("Watch for Completed webhooks for each scan") ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require('plagiarism-checker'); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; async function startCrossComparison() { const copyleaks = new Copyleaks(); // Login first const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); console.log('Logged successfully!\nToken:', authToken); // Start cross-comparison for indexed documents const scanIds = [ "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" ]; const startRequest = { trigger: scanIds, errorHandling: 0 }; try { const result = await copyleaks.startScansAsync(authToken, startRequest); console.log('Cross-comparison started successfully!'); console.log('Success:', result.success || []); console.log('Failed:', result.failed || []); if (result.success && result.success.length > 0) { console.log(`Successfully started ${result.success.length} scans`); console.log('Watch for Completed webhooks for each scan'); } return result; } catch (error) { console.error('Failed to start cross-comparison:', error); } } startCrossComparison(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.StartScanRequest; public class DataHubStartScanExample { private static final String EMAIL_ADDRESS = "your@email.address"; private static final String API_KEY = "00000000-0000-0000-0000-000000000000"; public static void main(String[] args) { try { // Login to Copyleaks String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); // Prepare list of scan IDs to start String[] scanIds = { "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" }; // Create start scan request StartScanRequest startRequest = new StartScanRequest(); startRequest.setTrigger(scanIds); startRequest.setErrorHandling(0); // Start cross-comparison var result = Copyleaks.startScans(authToken, startRequest); System.out.println("Cross-comparison started successfully!"); System.out.println("Success: " + String.join(", ", result.getSuccess())); System.out.println("Failed: " + String.join(", ", result.getFailed())); if (result.getSuccess().length > 0) { System.out.println("Successfully started " + result.getSuccess().length + " scans"); System.out.println("Watch for Completed webhooks for each scan"); } } catch (Exception e) { System.out.println("Failed to start cross-comparison: " + e.getMessage()); e.printStackTrace(); } } } ``` A successful `200 OK` response from the `start` endpoint will confirm which scans were started. The actual scan results for each document will be delivered asynchronously via the `Completed` webhook, just like a regular scan. **Example Success Response from `/v3/scans/start`:** ```json { "success": [ "my-index-scan-1", "my-index-scan-2", "my-index-scan-3" ], "failed": [] } ``` You have successfully started a cross-comparison scan between multiple documents in your Data Hub. ## Team Collaboration with Private Cloud Hub Multiple users can access, scan against, and index to your Private Cloud Hub. Manage permissions and data masking settings through the [admin dashboard](https://admin.copyleaks.com/repositories). ## Best Practices - **Plan your scanning options**: Configure settings during indexing. - **Monitor indexing progress**: Wait for all `IndexOnly` webhooks before starting the comparison. - **Choose your database strategy**: Decide whether to use Private, Shared, or both. - **Batch efficiently**: Group related documents together. - **Respect API limits**: Monitor your [API dashboard](https://api.copyleaks.com/dashboard). ## Next Steps Set up your own private database for document storage. ## Support Should you require any assistance, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag.
Want to see how Data Hubs can help you manage and compare your documents? Our technical team can walk you through live examples of setting up a Private Cloud Hub, indexing large batches of content, and running cross-comparisons in a secure environment. --- ## Plagiarism Detection Levels Source: https://docs.copyleaks.com/concepts/features/detection-levels > The three levels of plagiarism matching in Copyleaks, Identical Matches, Minor Changes, and Paraphrased Content, plus cross-language detection. The Copyleaks plagiarism API matches content at three levels: Identical Matches, Minor Changes, and Paraphrased Content (Related Meaning). Each can be enabled or disabled per scan to tune accuracy and noise. ## Introduction Copyleaks matches content beyond simple word-for-word comparison. The three levels together cover everything from exact duplication to paraphrasing and cross-language translation. Each detection level serves a specific purpose and can be enabled or disabled according to your specific needs: 1. **Identical Matches**: Exact word-for-word matches 2. **Minor Changes**: Content with slight variations 3. **Paraphrased Content**: Rewritten text that conveys the same meaning ## Detection Levels Explained ### Identical Matches Identical matches represent the most straightforward type of content matching, focusing on exact, word-for-word duplication. - **Description**: Detects content that has been copied verbatim from another source without any alterations. - **Use Case**: Ideal for finding direct plagiarism where content has been copied and pasted without modification. - **Configuration**: Set `properties.filters.identicalEnabled` to `true` (enabled by default). - **Example**: - **Original**: "The quick brown fox jumps over the lazy dog." - **Matched**: "The quick brown fox jumps over the lazy dog." For cases where you only want to detect identical matches, you can disable the other detection levels. See our [Identical Matches Detection](/concepts/features/identical-matches) guide for details. ### Minor Changes The minor changes detection level identifies content that has been slightly modified but remains fundamentally the same as the original source. - **Description**: Detects content where small changes have been made, such as altering word forms, switching tenses, or making minimal substitutions. - **Use Case**: Helpful for identifying cases where someone has made superficial changes to disguise copied content. - **Configuration**: Set `properties.filters.minorChangesEnabled` to `true` (enabled by default). - **Examples**: - **Original**: "The quick brown fox jumps over the lazy dog." - **Matched**: "A quick brown fox jumps over the lazy dog." ### Paraphrased Content (Related Meaning) The paraphrased content detection level identifies substantial rewrites that maintain the same core meaning as the original source. - **Description**: Detects content that has been significantly rewritten while preserving the original meaning or ideas. - **Use Case**: Essential for identifying sophisticated plagiarism where content has been carefully reworded to avoid detection. - **Configuration**: Set `properties.filters.relatedMeaningEnabled` to `true` (enabled by default). - **Examples**: - **Original**: "The quick brown fox jumps over the lazy dog." - **Matched**: "That speedy brown fox just jumped right over a sleeping dog" (same meaning, different words) The paraphrased content detection uses advanced natural language processing to understand semantic meaning beyond simple word matching. ### Cross-Language Detection A particularly powerful feature of Copyleaks' paraphrased content detection is its ability to identify content that has been translated from one language to another. - **Description**: Detects content that has been translated from the original source into a different language. - **Use Case**: Critical for organizations working in multilingual environments or checking content across language boundaries. - **Configuration**: Configure through the `properties.scanning.crossLanguages` property. - **Example**: - **Original (English)**: "The quick brown fox jumps over the lazy dog." - **Matched (Spanish)**: "El rápido zorro marrón salta sobre el perro perezoso." - **Matched (French)**: "Le renard brun rapide saute par-dessus le chien paresseux." Cross-language detection requires additional processing and may consume additional credits. Only languages listed in the [supported cross-languages](/reference/actions/miscellaneous/supported-cross-languages) documentation can be used. ## Configuration All three detection levels are enabled by default. You can customize which levels to include in your scan by modifying the `properties.filters` object in your API request: ```json title="Detection Levels Configuration" { "properties": { "filters": { "identicalEnabled": true, // Enable/disable identical matches "minorChangesEnabled": true, // Enable/disable minor changes detection "relatedMeaningEnabled": true // Enable/disable paraphrased content detection } } } ``` ### Recommended Configurations Depending on your use case, you might want to adjust which detection levels are enabled: #### High Precision (Fewer False Positives) ```json { "properties": { "filters": { "identicalEnabled": true, "minorChangesEnabled": true, "relatedMeaningEnabled": false } } } ``` #### High Recall (Catch All Potential Matches) ```json { "properties": { "filters": { "identicalEnabled": true, "minorChangesEnabled": true, "relatedMeaningEnabled": true } } } ``` #### Identical Only (Exact Matches Only) ```json { "properties": { "filters": { "identicalEnabled": true, "minorChangesEnabled": false, "relatedMeaningEnabled": false } } } ``` ## Next Steps After understanding the different detection levels: ## Support If you need assistance with configuring detection levels or have questions about which settings are best for your use case, please [contact our support team](mailto:support@copyleaks.com). --- ## Excluding and Preventing Indexing of Content Source: https://docs.copyleaks.com/concepts/features/exclude-content > Learn how to exclude parts of a document from a scan and how to prevent documents from being added to the Copyleaks Internal Database. import InstallSDKs from '/snippets/install-sdks.mdx'; You have granular control over what content is scanned and what data is stored when you submit a document to Copyleaks. This guide covers two distinct types of exclusion: 1. **Excluding Parts of a Document from Scan Analysis**: This allows you to refine the plagiarism scan by ignoring specific elements like quotes or code blocks. 2. **Preventing a Document from Being Indexed**: This allows you to control whether the entire document is added to the Copyleaks Internal Database for future comparisons. ## Exclude Options The `exclude` object can contain the following boolean properties: - `quotes`: If set to `true`, all text within quotation marks will be ignored. - `citations`: If set to `true`, citations and references will be ignored. - `references`: If set to `true`, the bibliography or reference list will be ignored. - `tableOfContents`: If set to `true`, the table of contents will be ignored. - `titles`: If set to `true`, titles and headings will be ignored. - `code`: An object controlling code exclusion. Set its `comments` field to `true` to ignore comments within code blocks (for example, `"code": { "comments": true }`). - `documentTemplateIds`: An array of unique identifiers for predefined templates stored in your Private Cloud Hub or the Shared Data Hub. These templates' content is then excluded from the document and won't count towards plagiarism or AI analysis. Use these options to customize your scans and focus on the most relevant content. ## Using the Exclude The `exclude` property is a powerful feature with two primary uses: 1. **Active Scans**: When submitting a document for scanning, you can include the `exclude` object in the request payload to specify which parts of the document should be ignored during analysis, e.g., you can exclude quotes, citations, or code blocks to focus on the most relevant content. 2. **Exclude Template**: The `exclude` template allows you to refine the analysis of documents by excluding specific sections based on a predefined template. The template document could be located in either your Private Cloud Hub or the Shared Data Hub, e.g., excluding exam questions from a student's filled out exam. Use `documentTemplateIds` to streamline your workflow when dealing with repetitive document structures. This ensures consistency and saves time during the scanning process. ## Get Started Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. To perform a scan, we first need to generate an access token. For that, we will use the [**login**](/reference/actions/account/login) endpoint. The API key can be found on the [**Copyleaks API Dashboard**](https://api.copyleaks.com/dashboard). Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the `Authorization: Bearer ` header. This token remains valid for 48 hours. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Headers Content-Type: application/json Body { "email": "your@email.address", "key": "00000000-0000-0000-0000-000000000000" } ``` ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" # Login to Copyleaks auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Logged successfully!\nToken:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); // Login function function loginToCopyleaks() { return copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then( (loginResult) => { console.log("Login successful!"); console.log("Access Token:", loginResult.access_token); return loginResult; }, (err) => { console.error('Login failed:', err); throw err; } ); } loginToCopyleaks(); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; // Login to Copyleaks try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); } catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1); } ``` **Response** ```json { "access_token": "", ".issued": "2025-07-31T10:19:40.0690015Z", ".expires": "2025-08-02T10:19:40.0690016Z" } ``` Save this token! It's valid for 48 hours and can be reused for subsequent API calls. Use the following example to index a document as a template in your Private Cloud Hub. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-template-index Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "student_solved_exam", "properties": { "action": 2, "indexing": { "repositories": ["my_private_cloud_exam_template"] }, "sandbox": true } } ``` ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/file/my-template-index \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "student_solved_exam", "properties": { "action": 2, "indexing": { "repositories": ["my_private_cloud_exam_template"] }, "sandbox": true } }' ``` ```python title="Python" icon="python" import requests import base64 # Document content document_content = "This is a test document." base64_content = base64.b64encode(document_content.encode()).decode('utf-8') url = "https://api.copyleaks.com/v3/scans/submit/file/my-template-index" payload = { "base64": base64_content, "filename": "student_solved_exam", "properties": { "action": 2, "indexing": { "repositories": ["my_private_cloud_exam_template"] }, "sandbox": True } } headers = { "Authorization": "Bearer YOUR_LOGIN_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require('plagiarism-checker'); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; async function indexTemplate() { const copyleaks = new Copyleaks(); const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); const documentContent = "This is a test document."; const base64Content = Buffer.from(documentContent).toString('base64'); const scanId = "my-template-index"; const fileSubmission = { base64: base64Content, filename: "student_solved_exam", properties: { action: 2, indexing: { repositories: ["my_private_cloud_exam_template"] }, sandbox: true } }; try { const result = await copyleaks.submitFileAsync(authToken, scanId, fileSubmission); console.log('Template indexed successfully!', result); } catch (error) { console.error('Failed to index template:', error); } } indexTemplate(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.response.CopyleaksAuthToken; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; public class IndexTemplateExample { private static final String EMAIL_ADDRESS = "your@email.address"; private static final String API_KEY = "00000000-0000-0000-0000-000000000000"; public static void main(String[] args) { try { CopyleaksAuthToken authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); String documentContent = "This is a test document."; String base64Content = Base64.getEncoder().encodeToString( documentContent.getBytes(StandardCharsets.UTF_8) ); SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}"); SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); properties.setAction(SubmissionActions.IndexOnly); // Action 2 = IndexOnly SubmissionIndexingRepository repo = new SubmissionIndexingRepository(); repo.setId("my_private_cloud_exam_template"); SubmissionIndexing indexing = new SubmissionIndexing(); // Requires copyleaks-java-sdk SubmissionIndexing.setRepositories (coming soon) indexing.setRepositories(new SubmissionIndexingRepository[]{ repo }); properties.setIndexing(indexing); CopyleaksFileSubmissionModel fileSubmission = new CopyleaksFileSubmissionModel( base64Content, "student_solved_exam", properties ); Copyleaks.submitFile(authToken, "my-template-index", fileSubmission); System.out.println("Template indexed successfully!"); } catch (Exception e) { System.out.println("Failed: " + e.getMessage()); e.printStackTrace(); } } } ``` Include the `exclude` object in the request payload to specify which parts of the document should be ignored during analysis. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/my-scan-with-template Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "document-to-scan.txt", "properties": { "exclude": { "documentTemplateIds": ["my-template-index"], "quotes": true, "citations": true, "references": true, "tableOfContents": true, "titles": true, "htmlTemplate": true, "code": { "comments": true } }, "sandbox": true } } ``` ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/file/my-scan-with-template \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "base64": "VGhpcyBpcyBhIHRlc3QgZG9jdW1lbnQu", "filename": "document-to-scan.txt", "properties": { "exclude": { "documentTemplateIds": ["my-template-index"], "quotes": true, "citations": true, "references": true, "tableOfContents": true, "titles": true, "htmlTemplate": true, "code": { "comments": true } }, "sandbox": true } }' ``` ```python title="Python" icon="python" import requests import base64 # Document content document_content = "This is a test document." base64_content = base64.b64encode(document_content.encode()).decode('utf-8') url = "https://api.copyleaks.com/v3/scans/submit/file/my-scan-with-template" payload = { "base64": base64_content, "filename": "document-to-scan.txt", "properties": { "exclude": { "documentTemplateIds": ["my-template-index"], "quotes": true, "citations": true, "references": true, "tableOfContents": true, "titles": true, "htmlTemplate": true, "code": { "comments": true } }, "sandbox": True } } headers = { "Authorization": "Bearer YOUR_LOGIN_TOKEN", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require('plagiarism-checker'); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; async function submitScanWithTemplate() { const copyleaks = new Copyleaks(); const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); const documentContent = "This is a test document."; const base64Content = Buffer.from(documentContent).toString('base64'); const scanId = "my-scan-with-template"; const fileSubmission = { base64: base64Content, filename: "document-to-scan.txt", properties: { exclude: { documentTemplateIds: ["my-template-index"], quotes: true, citations: true, references: true, tableOfContents: true, titles: true, htmlTemplate: true, code: { comments: true } }, sandbox: true } }; try { const result = await copyleaks.submitFileAsync(authToken, scanId, fileSubmission); console.log('Scan submitted successfully!', result); } catch (error) { console.error('Failed to submit scan:', error); } } submitScanWithTemplate(); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.response.CopyleaksAuthToken; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.charset.StandardCharsets; public class SubmitScanWithTemplate { private static final String EMAIL_ADDRESS = "your@email.address"; private static final String API_KEY = "00000000-0000-0000-0000-000000000000"; public static void main(String[] args) { try { CopyleaksAuthToken authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); String documentContent = "This is a test document."; String base64Content = Base64.getEncoder().encodeToString( documentContent.getBytes(StandardCharsets.UTF_8) ); SubmissionWebhooks webhooks = new SubmissionWebhooks("https://your-server.com/webhook/{STATUS}"); SubmissionProperties properties = new SubmissionProperties(webhooks); properties.setSandbox(true); SubmissionExclude exclude = new SubmissionExclude(); exclude.setDocumentTemplateIds(new String[]{"my-template-index"}); properties.setExclude(exclude); CopyleaksFileSubmissionModel fileSubmission = new CopyleaksFileSubmissionModel( base64Content, "document-to-scan.txt", properties ); Copyleaks.submitFile(authToken, "my-scan-with-template", fileSubmission); System.out.println("Scan submitted successfully!"); } catch (Exception e) { System.out.println("Failed: " + e.getMessage()); e.printStackTrace(); } } } ``` ## Response Example When the scan is processed, the `scannedDocument` object in the response will reflect the number of words that were excluded. **201 Created** - The scan was successfully created and is now processing. The excluded word count is reflected in the response. ```json { "scannedDocument": { "scanId": "my-scan-exclude-example", "totalWords": 8, "totalExcluded": 4, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-10T10:00:00.000000Z", "metadata": { "filename": "document-with-exclusions.txt" }, "enabled": { "plagiarismDetection": true, "aiDetection": false, "explainableAi": false, "writingFeedback": false, "pdfReport": true, "cheatDetection": false, "aiSourceMatch": false, "internalAiSourceMatch": false }, "detectedLanguage": "en" }, "results": { "score": { "identicalWords": 0, "minorChangedWords": 0, "relatedMeaningWords": 0, "aggregatedScore": 0.0 }, "internet": [], "database": [], "batch": [], "repositories": [] }, "notifications": {}, "writingFeedback": {}, "status": 0, "developerPayload": "" } ``` ## Next Steps Learn how to securely receive and process notifications from Copyleaks. Understand the scan result format and how to display it to your users. --- ## Export PDF Report Source: https://docs.copyleaks.com/concepts/features/export-pdf-report > Generate branded, customizable PDF reports of Copyleaks scan results (plagiarism, AI detection, and grammar feedback), delivered via webhook. import InstallSDKs from '/snippets/install-sdks.mdx'; This document provides a comprehensive overview of the essential steps for creating and customizing PDF reports, setting up report generation, handling webhooks, and managing completed reports. ## Introduction The PDF API allows you to generate detailed and customizable PDF reports of scan results, including plagiarism checks, AI detection, and Grammar Checker feedback. These reports can be branded with your own logo and customized to match your organization's needs. The PDF generation process is integrated with the Copyleaks scanning process, where you enable PDF creation during scan submission and then receive the generated PDF through webhooks. Copyleaks API also offers different PDF report versions, with version 3 being the latest and most feature-rich option that includes advanced formatting and comprehensive analysis visualization. PDF files for keeping records of individual scan results, which complement the interactive reports, are created through the download functionality in the report UI. If you have other PDF requirements to complement the interactive report options, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new). ## Before you begin Before you start using the PDF API, ensure you have the following: 1. An active Copyleaks account: If you don't have one, [sign up here](https://copyleaks.com). 2. Familiarity with RESTful API principles: Basic knowledge of HTTP requests and responses. 3. A tool for HTTP requests: Use tools like cURL, Postman, or Copyleaks' SDK. ## Installations ## Login To enable PDF report generation, we first need to generate an access token. We will use the [login](/reference/actions/account/login) endpoint. The API key can be found on the [Copyleaks API Dashboard](https://api.copyleaks.com/dashboard). Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer `` header. This token remains valid for 48 hours. To boost performance, cache your login token and reuse it for all requests. The token remains valid for up to 48 hours, so you don't need to log in repeatedly. The login method has stricter rate limits than other endpoints. ```http title="HTTP" icon="globe" POST https://id.copyleaks.com/v3/account/login/api Content-Type: application/json { "email": "", "key": "" } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://id.copyleaks.com/v3/account/login/api" \ -H "Content-Type: application/json" \ -d '{ "email": "", "key": "" }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.exceptions.command_error import CommandError from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.export import Export, ExportCrawledVersion, ExportResult, ExportPDF import base64 import random EMAIL_ADDRESS = "" API_KEY = "" # Login to Copyleaks try: auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) except CommandError as ce: response = ce.get_response() print(f"An error occurred (HTTP status code {response.status_code}):") print(response.content) exit(1) print("Logged successfully!\nToken:") print(auth_token) ``` ```javascript title="JavaScript" icon="square-js" const copyleaks = require('copyleaks'); const EMAIL_ADDRESS = ""; const API_KEY = ""; // Login to Copyleaks const login = async () => { try { const authToken = await copyleaks.login(EMAIL_ADDRESS, API_KEY); console.log('Logged successfully!\nToken:', authToken); return authToken; } catch (error) { console.error('Failed to login:', error); process.exit(1); } }; ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; import com.copyleaks.sdk.api.exceptions.CommandException; import com.copyleaks.sdk.api.models.ScanProperties; import com.copyleaks.sdk.api.models.FileSubmission; import com.copyleaks.sdk.api.models.Export; import com.copyleaks.sdk.api.models.ExportCrawledVersion; import com.copyleaks.sdk.api.models.ExportResult; import com.copyleaks.sdk.api.models.ExportPDF; import java.util.Base64; import java.util.Arrays; String EMAIL_ADDRESS = ""; String API_KEY = ""; // Login to Copyleaks try { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); } catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1); } ``` ## Submit Scan with PDF Report Enabled Use the [submit](/reference/actions/authenticity/submit-file/) file endpoint to send content for analysis while enabling PDF report generation. The key difference for PDF reports is including the `properties.pdf.create` parameter set to true. In the URL, supply your chosen scan ID, which serves as the identifier for the scan. Each scan needs to have a unique scan ID. The `properties.pdf.reportVersion` should be set to "latest" to use the latest PDF report format with enhanced visuals and comprehensive data visualization. The `properties.pdf.title` allows you to customize the title that appears on the PDF report. The `properties.displayLanguage` allows you to generate the PDF report in a specific language. For branding purposes, you can include your organization's logo using `properties.pdf.largeLogo` (PNG format, base64 encoded, max 100kb, recommended size 185x50px). There are more customization options available for PDF reports, but this guide doesn't cover all of them. For this tutorial, we also pass in `properties.sandbox` as **TRUE** to enable sandbox mode. The sandbox mode is free to use, but it returns mock results. Using sandbox mode while working on integrating with the Copyleaks API is helpful. ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v3/scans/submit/file/ Authorization: Bearer Content-Type: application/json { "base64": "", "filename": "", "properties": { "webhooks": { "status": "https://your.server/webhook?event={\{STATUS\}}" }, "sandbox": true, "pdf": { "create": true, "reportVersion": "v3", "title": "Custom PDF Report Title", "largeLogo": "" } } } ``` ```bash title="cURL" icon="terminal" curl -X PUT "https://api.copyleaks.com/v3/scans/submit/file/" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "base64": "", "filename": "", "properties": { "webhooks": { "status": "https://your.server/webhook?event={\{STATUS\}}" }, "sandbox": true, "pdf": { "create": true, "reportVersion": "v3", "title": "Custom PDF Report Title", "largeLogo": "" } } }' ``` ```python title="Python" icon="python" # Submit a file for scanning with PDF generation enabled scan_id = ""; file_name = "" base64_file_content = base64.b64encode(b'Hello world.').decode('utf8') # or read your file and convert it into BASE64 presentation. print("Submitting a new file...") file_submission = FileDocument(base64_file_content, file_name) # Set scan properties with PDF options scan_properties = ScanProperties('https://your.server/webhook?event={\{STATUS\}}') scan_properties.set_sandbox(True) # Turn on sandbox mode. Turn off on production. # Enable PDF report generation scan_properties.set_pdf({ "create": True, "reportVersion": "v3", "title": "Custom PDF Report Title" # Add base64_logo if needed }) file_submission.set_properties(scan_properties) # Submit the file for scanning Copyleaks.submit_file(auth_token, scan_id, file_submission) print("Sent to scanning with PDF report enabled") print("You will be notified, using your webhook, once the scan is completed.") ``` ```javascript title="JavaScript" icon="square-js" // Submit a file for scanning with PDF report enabled const scanId = ""; // Replace with your unique scan ID const filename = ""; const fileContent = Buffer.from('Hello world').toString('base64'); // Convert file content to base64 const submitFile = async (authToken) => { const scanProperties = new copyleaks.ScanProperties('https://your.server/webhook?event={\{STATUS\}}'); scanProperties.setSandbox(true); // Enable sandbox mode for testing // Enable PDF report generation scanProperties.setPDF({ create: true, reportVersion: "v3", title: "Custom PDF Report Title" // Add largeLogo if needed }); const fileSubmission = new copyleaks.FileSubmission(fileContent, filename); fileSubmission.setProperties(scanProperties); try { await copyleaks.submitFile(authToken, scanId, fileSubmission); console.log('File submitted for scanning with PDF report enabled. Scan ID:', scanId); } catch (error) { console.error('Failed to submit file:', error); } }; ``` ```java title="Java" icon="java" // Submit a file for scanning with PDF report enabled String scanId = ""; // Replace with your unique scan ID String filename = ""; String fileContent = Base64.getEncoder().encodeToString("Hello world".getBytes()); // Convert file content to base64 ScanProperties scanProperties = new ScanProperties("https://your.server/webhook?event={\{STATUS\}}"); scanProperties.setSandbox(true); // Enable sandbox mode for testing // Enable PDF report generation Map pdfProperties = new HashMap<>(); pdfProperties.put("create", true); pdfProperties.put("reportVersion", "v3"); pdfProperties.put("title", "Custom PDF Report Title"); // Add largeLogo if needed scanProperties.setPDF(pdfProperties); FileSubmission fileSubmission = new FileSubmission(fileContent, filename); fileSubmission.setProperties(scanProperties); try { Copyleaks.submitFile(authToken, scanId, fileSubmission); System.out.println("File submitted for scanning with PDF report enabled. Scan ID: " + scanId); } catch (CommandException e) { System.out.println("Failed to submit file: " + e.getMessage()); } ``` ## PDF Customization Options The PDF report can be extensively customized to match your organization's branding and requirements. | Property | Type | Description | Default | | ----------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | | `create` | boolean | Add a request to generate a customizable export of the scan report, in a pdf format. Set to true in order to generate a pdf report for this scan. | false | | `title` | string | Customize the title for the PDF report. Maximum 256 characters. | null | | `colors` | object | Object containing color customization options for the PDF report. | - | | `largeLogo` | string (base64) | Customize the logo image in the PDF report. Only supports **png** format. Max file size: 100kb. Recommended size: width 185px, height 50px. | null | | `rtl` | boolean | When set to true, the text in the report will be aligned from right to left. | false | | `reportVersion` | string | PDF version to generate. By default latest version will be generated. Version 3 is the latest iteration of the PDF report. Available values: **v1**, **v2**, **v3**, **latest** | latest | ## Wait For Scan Completion The scan and PDF report generation may take seconds to minutes, depending on the content, features used, and products enabled. Once the scan is complete successfully, Copyleaks API will send a completed webhook to the URL you supplied in the submit under `properties.webhooks.status`. At the same time, the **\{STATUS\}** is replaced with "completed". The completed webhooks hold the summary information about the scan, such as the number of matched words, total words, and results found. If the scan finishes with an error, an error webhook will be sent to the `properties.webhooks.status` while the **\{STATUS\}** is replaced with **error**. For testing purposes, we recommend using a third-party service such as **request bin** or **ngrok**. ## Exporting PDF Reports Use the [export](/reference/actions/downloads/export/) method to retrieve the generated PDF report along with other scan artifacts. The export method sends webhooks with each artifact's content to your specified target server. We supply the Scan ID we used earlier in the submit endpoint in the URL. The user chooses a unique Export ID for each export. For PDF reports specifically, we add a `pdf` section to the export request, providing an endpoint where the PDF should be sent when ready. ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v3/downloads//export/ Authorization: Bearer Content-Type: application/json { "completionWebhook": "https://your.server/webhook/export/completion", "pdf": { "endpoint": "https://your.server/webhook/export/pdf", "verb": "POST", "headers": { "key": "value", "key2": "value2" } } } ``` ```bash title="cURL" icon="terminal" curl -X POST "https://api.copyleaks.com/v3/downloads//export/" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "completionWebhook": "https://your.server/webhook/export/completion", "pdf": { "endpoint": "https://your.server/webhook/export/pdf", "verb": "POST", "headers": { "key": "value", "key2": "value2" } } }' ``` ```python title="Python" icon="python" # Export scan results including PDF report export_id = "" export = Export() export.set_completion_webhook('https://your.server/webhook/export/completion') # Export PDF report pdf_export = ExportPDF() pdf_export.set_endpoint('https://your.server/webhook/export/pdf') pdf_export.set_verb('POST') pdf_export.set_headers([['key', 'value'], ['key2', 'value2']]) # optional export.set_pdf(pdf_export) # Trigger the export Copyleaks.export(auth_token, scan_id, export_id, export) print("Export initiated. You will be notified via webhook once the export is completed.") ``` ```javascript title="JavaScript" icon="square-js" // Export scan results including PDF report const exportId = ''; const exportResults = async (authToken, scanId) => { const exportRequest = new copyleaks.Export(); exportRequest.setCompletionWebhook('https://your.server/webhook/export/completion'); // Export PDF report const pdfExport = new copyleaks.ExportPDF(); pdfExport.setEndpoint('https://your.server/webhook/export/pdf'); pdfExport.setVerb('POST'); exportRequest.setPDF(pdfExport); try { await copyleaks.export(authToken, scanId, exportId, exportRequest); console.log('Export initiated with PDF report. Export ID:', exportId); } catch (error) { console.error('Failed to export results:', error); } }; ``` ```java title="Java" icon="java" // Export scan results including PDF report String exportId = ""; Export exportRequest = new Export(); exportRequest.setCompletionWebhook("https://your.server/webhook/export/completion"); // Export PDF report ExportPDF pdfExport = new ExportPDF(); pdfExport.setEndpoint("https://your.server/webhook/export/pdf"); pdfExport.setVerb("POST"); exportRequest.setPDF(pdfExport); try { Copyleaks.export(authToken, scanId, exportId, exportRequest); System.out.println("Export initiated with PDF report. Export ID: " + exportId); } catch (CommandException e) { System.out.println("Failed to export results: " + e.getMessage()); } ``` ## Next Steps Learn about webhooks in the Copyleaks API and how to handle real-time notifications. Understand the export method for retrieving various scan artifacts including PDF reports. Learn about the comprehensive scanning API that supports multiple products and features. ## Support Should you require any assistance or have inquiries, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. --- ## Scan Overview Source: https://docs.copyleaks.com/concepts/features/gen-ai-scan-overview > Overview of Copyleaks' GenAI Scan feature, which provides AI-generated insights into scan results, including plagiarism, AI detection, and writing quality. Copyleaks’ Gen AI automatically reviews and summarizes each scan. It highlights the main data points, identifies key insights, and uses the author’s past work (if available) to add helpful context. This makes it easy to understand the writing quality, AI involvement, and any signs of plagiarism, all in one clear and simple overview. ## Properties Fields | **Property** | **Type** | **Default** | **Description** | | --------------------------- | --------- | ----------- | --------------------------------------------------------------------------------------------------------------------------- | | `enable` | `boolean` | `false` | Enable Gen-AI Overview feature to extract key insights from the scan data. | | `ignoreAIDetection` | `boolean` | `false` | Ignore [AI detection](https://copyleaks.com/ai-detector) when generating the scan's overview. Only applicable if AI detection was enabled. | | `ignorePlagiarismDetection` | `boolean` | `false` | Ignore plagiarism detection when generating the scan's overview. Only applicable if plagiarism detection was enabled. | | `ignoreWritingFeedback` | `boolean` | `false` | Ignore Grammar Checker when generating the scan's overview. Only applicable if the Grammar Checker was enabled. | | `ignoreAuthorData` | `boolean` | `false` | Ignore the author's historical data when generating the scan's overview. Only applicable if author ID was added to the request. | ## Examples ### Request - Submit Endpoint Example ```json {6-8} { "base64": "...", "filename": "file.txt", "properties": { "action": 0, "overview": { "enable": true } } } ``` ### Export Endpoint Example This is the same description as other types of [export](/reference/actions/downloads/export), just the key is `overview`. ```json { "overview": { "verb": "POST", "headers": [ [ "header-key", "header-value" ] ], "endpoint": "https://yoursite.com/export/overview" }, "completionWebhook": "https://yoursite.com/export/completed", "maxRetries": 3 } ``` ### Response #### Example ```json { "overview": "### Historical Author Data:\n- Four scans analyzed with an average plagiarism similarity of 13.18%\n- 4 instances of AI-generated content detected\n\n### Current Plagiarism Detection:\n- 0% overall plagiarism\n- Main sources: \n - yard.com (3.0%, 74 words)\n - brainly.com (3.2%, 45 words)\n - llcattorney.com (1.3%, 29 words)\n - montrosedemocrats.org (3.0%, 12 words)\n\n### AI Content Detection:\n- 100% AI-written content detected\n\n### Grammar Checker:\n- 100% writing quality with no errors in grammar, sentence structure, word choice, and mechanics.", "modelVersion": "v1" } ``` #### Response Fields | Field | Type | Description | | -------------- | ------ | ----------------------------------------------------------------------- | | `overview` | string | A markdown-formatted string containing the Gen-AI overview of the scan. | | `modelVersion` | string | The version of the AI model used to generate the overview. | ## Next Steps Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## Ways to Display Reports Source: https://docs.copyleaks.com/concepts/features/how-to-display > Compare the ways to display Copyleaks scan results: interactive reports, the hosted report, PDF exports, and custom white-label implementations. Copyleaks offers multiple flexible options for displaying scan results to accommodate different technical requirements and use cases. Whether you prefer a ready-to-use hosted solution, want to integrate an interactive report into your existing application, need downloadable PDF reports, or require a completely custom implementation, Copyleaks provides the tools and data necessary to meet your specific needs. The display options range from plug-and-play solutions that require minimal technical implementation to comprehensive data exports that enable full customization of the user experience. Each method offers different levels of control, customization, and integration complexity to match your project requirements. All display methods are designed to work seamlessly with the Copyleaks scanning process and provide comprehensive visualization of [plagiarism checker](https://copyleaks.com/plagiarism-checker), [AI detection](https://copyleaks.com/ai-detector), and other scan results through modern, responsive interfaces. ![Check for Plagiarism](/assets/mainpage/SampleReport-2.svg) ## Viewing the Results ### Hosted Web Report A responsive web page that can be opened in a new window or an iframe. This solution provides immediate access to professional report viewing without any development overhead or hosting requirements. The hosted report automatically updates with the latest features and improvements, ensuring users always have access to the most current functionality. Perfect for rapid deployment and scenarios where minimal technical implementation is preferred. Learn how to embed the Copyleaks hosted web report into your application. ### Open-Source Web Report Build your own Copyleaks Interactive Report from our [Github repository](https://github.com/Copyleaks/ng-web-report). You will need to host the report and send Copyleaks data to populate it. The Interactive Report provides a comprehensive, web-based interface that displays detailed scan results including highlighted matches, source comparisons, AI detection results, and [Grammar Checker](https://copyleaks.com/grammar-checker) suggestions. The report can display Grammar Checker corrections when provided with the appropriate correction data and links from your scan results. This solution offers maximum customization flexibility while leveraging Copyleaks' proven report interface design and functionality. Integration requires [Angular](https://angular.dev/) development skills and the ability to host and maintain the report within your own infrastructure. Learn how to install and configure the Copyleaks open-source web report. ### White Label Customization Some Copyleaks customers opt to build their own custom solutions for viewing data. We empower you with resourceful data like the start and length of plagiarism and detected AI, and you can build your own custom viewing platform designed to your preferences and specifications. This approach provides complete control over the user experience, allowing you to integrate scan results seamlessly into your existing application workflow and design language. [Learn more about Custom Implementations](/guides/authenticity/detect-plagiarism-text) ## Choosing the Right Display Method To help you decide which display method is right for you, here is a side-by-side comparison of the available options: | Display Method | Implementation Effort | Customization Level | Hosting | Primary Use Case | | :--- | :--- | :--- | :--- | :--- | | **Hosted Report** | Low | Low | Copyleaks | Quick setup, embedding in iframes, maintenance-free. | | **Open-Source Report** | Medium | High | Self-hosted | Full UI control, integration with your brand, feature-rich. | | **Custom (API Data)** | High | Complete | Self-hosted | Seamless integration into existing apps, unique workflows. | ## Support Should you require any assistance or have inquiries about implementing any of these display methods, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. --- ## Identical Matches Detection Source: https://docs.copyleaks.com/concepts/features/identical-matches > Learn how to configure the Copyleaks API to detect only identical text matches by filtering out paraphrased content and minor changes. This document provides an overview of configuring the Copyleaks API to detect only identical text matches while filtering out paraphrased and minor changed content, focusing specifically on exact duplications. ## Introduction The Identical Matches Only configuration is designed for teams that need to focus specifically on exact text duplications without the complexity of similarity detection. This approach is particularly useful for detecting direct copying and verbatim plagiarism. By focusing exclusively on identical matches, teams can efficiently identify the most straightforward cases of content duplication while reducing false positives and ambiguous similarity detections that might require additional review time. ## Configuration To detect only identical matches, you must disable the settings for paraphrased content and minor changes in your API request. - **Disable Minor Changes**: Set `properties.filters.minorChangesEnabled` to `false`. - **Disable Paraphrased Content**: Set `properties.filters.relatedMeaningEnabled` to `false`. - **Enable Internet Scanning**: Set `properties.scanning.internet` to `true` to scan against online sources. By setting both `minorChangesEnabled` and `relatedMeaningEnabled` to `false`, the API will only return results that are exact, word-for-word matches. ### Example JSON Configuration Here is an example of the `properties` object configured for an identical-only scan against internet sources. ```json title="Request Body Properties" { "properties": { "filters": { "minorChangesEnabled": false, "relatedMeaningEnabled": false }, "scanning": { "internet": true } } } ``` ## Next Steps After configuring your identical matches detection: Learn how to interpret and display identical match results. Set up automated notifications for scan completion. Explore additional scanning capabilities beyond identical matches. Get personalized guidance on optimizing your identical match detection. ## Support Should you require any assistance, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. --- ## References Validation Source: https://docs.copyleaks.com/concepts/features/references-validation > Detect and validate the references and citations in a document against trusted sources with Copyleaks References Validation. References Validation checks whether the citations in a document are real and accurately described. When enabled, Copyleaks finds every reference in the submitted text, identifies the work it points to, and verifies it against a trusted source, so you can catch fabricated, misattributed, or incorrectly dated citations. It covers two kinds of references: - **Academic references** (papers, journal articles) are verified against the Copyleaks academic citation index. - **Non-academic references** (web pages, documentation, blogs, encyclopedias) are verified by fetching the cited URL and comparing the live page to what was cited. ## Benefits and Use Cases AI-generated and low-quality writing often includes citations that look real but are not. References Validation surfaces those automatically, helping you: - **Catch fabricated or hallucinated citations** - references to works that do not exist or cannot be found. - **Spot misattribution** - wrong authors, wrong year, or a title that does not match the cited source. - **Verify bibliographies at scale** - check every citation in a submission without manual lookup. Common use cases: - **Academic integrity** - flag invented or misquoted sources in student work. - **Student writing support** - help students improve their citations by catching missing, incorrect, or mismatched references before they submit. - **Publishing and research** - confirm a manuscript's references are genuine and correctly described before publication. - **Content review** - assess how trustworthy the cited material in a submitted document is. ## Validation Results For each detected reference you get what Copyleaks parsed from the citation, the corroborating source it found, and a per-field breakdown of which details matched (title, authors, year). Results are delivered in two places: - **Completed webhook** - a `referencesValidation.summary` with the headline counts: how many references were found and how many were fully validated. - **Crawled version** - the full per-reference results, including the parsed fields and the corroborating sources. ## Next steps Step by step: enable references validation on a scan, read the summary, and fetch the per-reference results. The full response schema: parsed fields, suggestions, and per-field signals. --- ## Prevent Self-Plagiarism and Author Conflicts Source: https://docs.copyleaks.com/concepts/features/self-plagiarism > Learn how to use scan ID patterns to prevent an author's documents from being flagged as plagiarism against their own previous submissions. This guide helps you avoid situations where documents from the same author are flagged as plagiarism against each other. This is particularly important when authors submit multiple assignments, revisions, or when you want to prevent matches within the same author's work while maintaining detection across different authors. ## Understanding the Problem When working with document databases, you may encounter scenarios where: - An author's current document matches against their previous work from earlier submissions. - Multiple versions or drafts of the same document are flagged against each other. - Legitimate self-referencing or building upon previous work is incorrectly identified as plagiarism. This guide provides strategies to prevent these false positives while maintaining effective plagiarism detection. ## Prevention Strategy: Smart Scan ID Structure The best strategy is to design a strategic `scanId` for each submission. A well-structured ID makes it easy to include or exclude specific groups of documents from a scan. **Important**: The maximum `scanId` length is 36 characters. Plan your structure accordingly. ### Example ID Structures **Basic Structure:** - `-` (e.g., `author123-essay1`, `emp456-report2`) **Extended Structure:** - `--` (e.g., `acmeuni-author123-essay1`, `techcorp-emp456-proposal`) This structure enables you to: - **Exclude by author**: Use `author123-*` or `emp456-*`. - **Include by organization**: Use `acmeuni-*` or `techcorp-*`. - **Focus on document types**: Use `*-final` or `*-report`. ## Using Exclude Patterns Use the `properties.scanning.exclude.idPattern` parameter to exclude specific patterns from your scan results. The `*` character acts as a wildcard. ### Exclude by ID Pattern ```json { "properties": { "scanning": { "exclude": { "idPattern": "author123-*" } } } } ``` This example excludes all submissions with IDs starting with `author123-`. ### Exclude by Domain ```json { "properties": { "scanning": { "exclude": { "backlinksDomains": ["wikipedia.org", "example.edu"] } } } } ``` This example excludes any internet results that contain backlinks to Wikipedia or example.edu. ### Exclude by Text Phrases ```json { "properties": { "scanning": { "exclude": { "text": ["common reference phrase", "standard disclaimer"] } } } } ``` This example excludes any results that contain the specified text phrases, useful for filtering out common boilerplate text or standard disclaimers. ## Using Include Patterns Use the `properties.scanning.include.idPattern` parameter to *only* include specific patterns in your scan results. This is useful for limiting comparisons to specific groups, like an organization or a class. ```json { "properties": { "scanning": { "include": { "idPattern": "acmeuni-*" } } } } ``` This example will only compare the submitted document against other documents with IDs starting with `acmeuni-`. ## Implementation Examples ### Example 1: Exclude Same Author's Previous Work ```json { "properties": { "scanning": { "copyleaksDb": { "includeMySubmissions": true, "includeOthersSubmissions": true }, "exclude": { "idPattern": "author123-*" } } } } ``` ### Example 2: Compare Only Within Same Organization ```json { "properties": { "scanning": { "repositories": [{ "id": "assignment_repository", "includeMySubmissions": true, "includeOthersSubmissions": true }], "include": { "idPattern": "acmeuni-*" } } } } ``` ## Best Practices - ** Plan your ID structure**: Design scan ID patterns from the beginning. - ** Be specific**: Use precise patterns to avoid excluding too much or too little. - ** Test patterns**: Verify your patterns work correctly with sample data. - ** Document conventions**: Maintain clear documentation of your ID structure for your team. - ** Keep it short**: Remember the 36-character limit. ## Next Steps Learn how to submit files with your custom scan IDs. Learn about cross-document comparison strategies. ## Support Should you require any assistance or have inquiries about implementing author conflict prevention, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. --- ## Detecting Text Manipulation Source: https://docs.copyleaks.com/concepts/features/text-manipulation > Detect attempts to deceive Copyleaks detection through text manipulation, and learn how the API flags these techniques in submitted documents. This document provides a comprehensive overview of using the Copyleaks API to detect text manipulation attempts in submitted documents. Text manipulation detection helps identify when users attempt to deceive detection systems through various deceptive techniques. ## Introduction The Text Manipulation detection feature is designed to identify sophisticated attempts to bypass detection systems. This feature recognizes when users employ various deceptive techniques to hide copied content or manipulate the scanning process. Text manipulation attempts can include: - **Hidden Characters**: Inserting invisible characters to break up text patterns - **Character Replacement**: Using special characters or symbols that look similar to normal letters - **Invisible or White Text**: Adding white text on white backgrounds or other concealment methods (works only in PDF and DOCX documents) - **Major Text Exclusion**: Attempting to exclude large portions of text from scanning By detecting these manipulation attempts, you can maintain the integrity of your [plagiarism checker](https://copyleaks.com/plagiarism-checker) or [AI detection](https://copyleaks.com/ai-detector) process and ensure accurate results. ## Before You Begin To get the most out of this document, you should first be familiar with how to submit a basic scan. If you're new to the process, we recommend starting with the guide below. **Detect Plagiarism in Text**: This guide walks you through the fundamentals of customizing your API request to scan for plagiarism. ## Getting Started ### Enabling Text Manipulation Detection To enable text manipulation detection in your scans, set the `properties.cheatDetection` parameter to `true`: ```json { "properties": { "cheatDetection": true } } ``` **Default**: `false` When enabled, the submitted document will be analyzed for various text manipulation techniques. If manipulation is detected, a scan alert will be added to the completed webhook. For more information on submitting documents, check out our documentation for URL, OCR, and File scans. ## Interpreting Scan Results ### Scan Alerts When text manipulation is detected, you'll receive specific alerts in your scan completion webhook. These alerts are found at: ``` notifications.alerts[] ``` ### Types of Text Manipulation Alerts | Alert Code | Title | Description | | --- | --- | --- | | `suspected-cheating-detected` | Advanced Detection: Hidden Characters | Detected possible use of hidden characters to cheat the plagiarism scan | | `suspected-character-replacement` | Advanced Detection: Character Replacement | Detected possible use of special characters to cheat the plagiarism scan | | `suspected-white-text` | Suspected Cheating: Invisible Text | Detected possible use of invisible or white text - switch to textual version to see all text | | `text-mostly-excluded` | Advanced Detection: Major Text Exclusion | Detected possible attempt to exclude the majority of text from scanning | | `cheat-detection-failed` | Advanced Detection Failed | Unable to validate that there was no manipulation in the submitted document | For a complete list of all possible alerts, see our Scan Alerts documentation. ### Example Alert Response ```json { "notifications": { "alerts": [ { "code": "suspected-character-replacement", "title": "Advanced Detection: Character Replacement", "message": "We have detected possible use of special characters to cheat the plagiarism scan.", "category": 3 } ] } } ``` ## Best Practices - **Monitor alerts**: Check for text manipulation alerts in your webhook responses - **Document findings**: Keep records of detected manipulation attempts for policy enforcement - **Handle failures**: Implement proper error handling for cases where detection fails - **Stay updated**: Alert titles and messages may change over time as the system improves ## Next Steps After implementing text manipulation detection: Explore additional scanning capabilities beyond text manipulation detection. Learn how to present detection results to users effectively. ## Support Should you require any assistance or have inquiries about implementing text manipulation detection, please contact [**Copyleaks Support**](https://help.copyleaks.com/hc/en-us/requests/new) or ask a question on [**Stack Overflow**](https://stackoverflow.com/questions/tagged/copyleaks-api) with the `copyleaks-api` tag. We appreciate your interest in Copyleaks and look forward to supporting your efforts to maintain originality and integrity. By implementing text manipulation detection, you're adding an essential layer of security to your plagiarism detection workflow, ensuring that sophisticated cheating attempts don't go unnoticed.
Get personalized guidance on implementing comprehensive content analysis with text manipulation detection and other advanced features. --- # Concepts → Management ## Management Source: https://docs.copyleaks.com/concepts/management/overview > Manage scans, credits, and organization-wide settings for the Copyleaks API. Operational concepts for running Copyleaks in production, how to identify scans, manage credit consumption, and configure organization-level access. Naming and format requirements for `scanId`, the unique key for every submission. Monitor credit consumption, set limits, and forecast usage. Configure users, roles, and access policies across an enterprise account. --- ## Choosing Your Scan ID Source: https://docs.copyleaks.com/concepts/management/choosing-scan-id > Learn how to choose a scan ID that fits your organization's needs while adhering to Copyleaks' requirements. A **Scan ID** is a unique identifier that you assign to every scan submitted to Copyleaks. This ID acts as a crucial link between your system and ours, allowing you to manage, track, and organize your scans effectively. Choosing a thoughtful and consistent naming convention for your Scan IDs is essential for leveraging advanced Copyleaks features, such as preventing self-plagiarism and managing large volumes of scans. ## Core Requirements While you have the flexibility to choose a Scan ID that aligns with your internal system, there are a few limitations to keep in mind: - **Character Length**: Must be between 3 and 36 characters. - **Allowed Characters**: The Scan ID can include lower case characters `a-z`, digits `0-9` and special symbols `!@$&-=_()';:., ~`. We recommend using lower case letters, digits and dashes for simplicity. Uppercase letters (`A-Z`) and any characters not listed above are not permitted. If your internal IDs use unsupported characters, see the section on [Handling ID Mismatches](#handling-id-mismatches). ## Strategies for Naming Your Scan ID The best approach is to create a structured Scan ID that embeds useful information. This allows you to easily identify a scan based on its scan ID and use advanced features like include or exclude specific groups of documents from a scan. ### Recommended Structure A highly effective structure is: `--` #### Examples - `tech-corp-employee456-q3-report` - `acme-university-student123-final-thesis` In plagiarism scans, this structure enables powerful filtering capabilities: - **Exclude by author**: Use a pattern like `*-student123-*` to prevent a student's new submission from being checked against their previous work. - **Include by organization**: Use `acme-university-*` to compare a document only against others from the same institution. - **Focus on document types**: Use `*-final-thesis` to analyze all final theses submitted. For more information, see the [Prevent Self-Plagiarism](/concepts/features/self-plagiarism/) guide. ## Handling ID Mismatches If your internal system uses IDs that don't meet Copyleaks' requirements (e.g., they are too long or contain uppercase letters), the recommended solution is to generate a compliant Scan ID and maintain a mapping table on your end. This table will link your internal entity ID to the corresponding Copyleaks Scan ID, ensuring seamless integration. | Your Internal ID | Copyleaks Scan ID | | :--- | :--- | | `USER-9876-DOC-A` | `user9876-doca` | | `Submission_ABC_123`| `submission-abc-123` | ## Next Steps Learn more about how to exclude previous submissions from the same student to prevent self-plagiarism. See how to implement your Scan ID strategy when submitting a file for scanning. --- ## Manage Your Credits Source: https://docs.copyleaks.com/concepts/management/manage-your-credits > Learn how to manage your Copyleaks credits effectively to optimize usage and prevent unnecessary costs. Copyleaks provides a comprehensive suite of content integrity services through a flexible, credit-based API. To help you maximize the value of the platform and manage your usage effectively, it is essential to implement smart credit management strategies. Copyleaks offers robust tools to monitor and control your credit consumption, ensuring full transparency and predictability. This guide outlines the available options to help you get started. ## Price Check Before Scan Some applications may not have visibility into document sizes before submission, as end-users directly upload files. This can lead to **unintended credit consumption** when scanning large documents. To mitigate this, Copyleaks recommends **pre-checking** the number of credits required for a scan before proceeding. This allows you to decide whether to continue with the scan or abort it, avoiding unnecessary charges. ### How to Enable Price Check To activate the **Check-Credits** flow, set the `properties.action` parameter to `1` (Check-Credits) when submitting a document. In the webhook response, you will receive the expected cost of the scan without actually performing it. After receiving the response, you can decide whether to proceed with the scan or not. To start the scan use the [**Start**](/reference/actions/authenticity/start) endpoint. ## Confirming Scan Cost After Completion Once a scan is completed, Copyleaks sends a **[Completed Webhook](/reference/data-types/authenticity/webhooks/scan-completed)** to your application, including details about the **final cost** of the scan. By tracking this information, you can develop insights into your **expected service costs** and optimize your usage accordingly. You are only charged for **successfully completed** scans. If a scan fails due to an error, the credits will be **automatically refunded**. ## Programmatically Monitor Your Remaining Credits Copyleaks API is designed to provide **full automation**, reducing the need for manual intervention. You can retrieve your **current credit balance** to implement various control mechanisms: - **Set spending limits** - Define a threshold (e.g., limit usage to 50% of the budget by mid-month) and configure your system to react accordingly. - **Trigger alerts** - Automatically send notifications when your remaining credits fall below a certain percentage (e.g., below 10%). This can be implemented as a **cron job** for regular monitoring. ### Retrieve Credit Balance You can check your current credit balance using the **[Get Credits Balance](/reference/actions/admin/check-credits)** endpoint. This will return the number of credits available in your account. ## Set a Spend Limit on Automatic Refills To prevent running out of credits during a billing cycle, **Copyleaks offers automatic refills**, ensuring that scans are never interrupted. ### Why Use Automatic Refills? - Ensures that ongoing scans are not disrupted. - Eliminates the need for manual intervention. However, **uncontrolled automatic refills can lead to unexpected costs**, especially if a bug in your application results in excessive scans. Set a **maximum budget** for automatic refills to prevent unforeseen expenses. ### How to Enable Automatic Refills You can manage this feature via the **billing settings** in your Copyleaks account. ## Predict Your Usage To forecast your credit consumption, **Copyleaks provides access to historical usage data**. By retrieving your **usage history**, you can generate reports (in CSV format) to analyze past trends and predict future requirements. ### Retrieve Usage History You can programmatically retrieve a detailed history of your credit consumption using the **[API Usage History](/reference/actions/admin/usage-history)** endpoint. This allows you to fetch data for specific date ranges, which can then be exported or integrated into your own internal dashboards. By analyzing this historical data, you can identify usage patterns, track costs associated with different projects, and build more accurate forecasts for future credit needs. ## Summary The Copyleaks API offers extensive flexibility to help you manage credits efficiently. By leveraging these features strategically, you can prevent excessive usage, optimize costs, and maintain control over your plagiarism detection workflows. Use these tools to ensure a cost-effective and seamless integration. ## Next Steps Learn how to initiate a scan after checking the credit cost. Understand the details provided in the completed webhook, including the final scan cost. Retrieve your current credit balance programmatically. Access your historical usage data to predict future credit consumption. --- ## Enterprise Organization Management Source: https://docs.copyleaks.com/concepts/management/organization-management > Manage your organization using admin.copyleaks.com - structure teams, set permissions, and control credit allocation. Copyleaks provides enterprise organization management through [admin.copyleaks.com](https://admin.copyleaks.com). Structure your teams hierarchically, manage permissions, and control resource allocation across your organization. ## Managing Members ### Adding Team Members Invited members receive an email with join instructions. Once accepted, they appear in your members list and can start using Copyleaks under your organization's account. Added members will use your organization's credits. Plan accordingly when inviting team members. ### Managing Departments Organize members into departments for better control and tracking: The members table shows Email, Department, Status (Activated/Pending), Role, and Last activity for each user. Use departments to match your organizational structure - by division, project, or client account for granular reporting. ## Roles and Permissions | Role | Permissions | Typical Use | |------|-------------|-------------| | **Super Admin** | Full access to billing, organization settings, and all features | Executive leadership, IT administrators | | **Admin** | Full feature access and user management, limited billing | Department managers, team leads | | **Member/Contributor** | Use all features, cannot manage users | Regular team members | ## Organization Settings Access organization-wide settings through the **Organization** menu in the sidebar. ### Organization Details Configure your organization profile: - Organization name and branding - Billing address (Country, Address Lines, City, Zip/Postal Code) - Open ID Authentication settings ### Available Policies Navigate to **Policies** in the sidebar to configure: - **Member Session Timeout** - Control how long sessions stay active - **IP Whitelist** - Restrict access to specific IP addresses - **Organization Scan Profiles** - Assign default scan settings by department - **Multi-Factor Authentication (MFA) Policy** - Enforce 2FA across the organization - **Shared Data Hub** - Control internal content scanning without saving data - **Prevent email address autofill** - Security policy for email entry Properly configured policies help maintain compliance with GDPR, CCPA, and industry-specific regulations. ## Credits and Billing ### Centralized Credit Management View your credit status in the **Billing** section: - **Current balance** displayed in the top navigation bar (e.g., "133k Credits left") - **Credit usage** bar shows available credits and word capacity - **Plan type** (Prepaid, Free, or Subscription) - **Member seats** allocation and usage All organization members consume credits from the central pool. No individual billing required. ### Monitoring Usage The **Analytics** dashboard provides detailed tracking: - Total Credits consumed - Total Submitted Scans - Matched Text Results - AI Text Cases - Character Manipulation Alerts - Cross-Language scans - **Credits Used** - Monthly breakdown of credit consumption - **Submitted Scans** - Track scan volume over time - Filter by date range and method (APP, API) - Export data for custom analysis Set usage thresholds and alerts to monitor when credits fall below specified amounts. ## Private Cloud Hubs Create secure, internal repositories for content comparison. Access through **Private Cloud Hubs** in the sidebar. ### Creating a Repository ### Repository Management The Billing page shows your Private Cloud Hub usage and allocation. Manage existing repositories through the dedicated hub interface. Private Cloud Hubs keep document comparisons within organizational boundaries for compliance requirements. ## API Integration ### Generating API Keys Never embed API keys in client-side code. Use environment variables and secure secret storage. ## Next Steps Explore API endpoints for programmatic organization management Deep dive into secure internal document repositories Detailed credit management and optimization strategies Get help with organization setup, administrator training, and API integration planning. --- # Concepts → Performance ## Performance Source: https://docs.copyleaks.com/concepts/performance/overview > Optimize throughput, retry behavior, and compression when working with the Copyleaks APIs at scale. Run scans efficiently. These pages cover the practical knobs, compression, batching, retries, and the per-content-type best practices. Optimize text and document scanning, compression, feature scoping, submission patterns. Optimize the AI Image Detection API, multipart uploads, compression, throughput. Retry strategy and exponential backoff for transient errors and rate limits. --- ## Best Practices for Working with Texts & Documents Source: https://docs.copyleaks.com/concepts/performance/best-practices > Optimize Copyleaks scan performance with data compression, feature management, and submission strategies for the text and document APIs. Copyleaks is designed for **scalability and high performance**, handling large workloads efficiently. To get the best results from your integration, follow these best practices to **optimize speed, reduce bottlenecks, and maximize efficiency**. This guide covers best practices for **text and document scanning** using the Authenticity, Grammar Checker, Text Moderation and AI Text Detector APIs. For image-specific optimization, see the [Image Detection Best Practices](/concepts/performance/image-best-practices) guide. ## Use Network Data Compression Transmitting large amounts of data over the internet **slows down** performance. **Compressing data** can reduce payload size by **up to 70%**, speeding up processing times. ### Enable Request Compression Compress the data before sending it to Copyleaks and add this header: ```http Content-Encoding: gzip ``` This is **especially useful** when submitting large files. ### Enable Response Compression To receive compressed responses from Copyleaks, include this header in your request: ```http Accept-Encoding: gzip ``` This ensures faster data transfer between your system and Copyleaks. ## Disable Unused Features Copyleaks offers **many configurable features**, but enabling unnecessary ones can **slow down** scans. Only enable what you need. Some features to **disable if not needed**: | Feature | Description | Recommendation | |---------|------------|---------------| | `properties.includeHtml` | Includes results in **HTML format** | Disable if plain text is enough. | | `properties.pdf.create` | Generates a **PDF report** | Turn off if you don’t need a PDF. | | `properties.expiration` | Defines how long scan data is stored | Use **7 days or less** for optimal speed. | | `properties.filters` | Narrows search results | Customize filters to **improve scan efficiency**. | Check the [Authenticity API methods](/reference/actions/authenticity/overview) for the full list of features you can toggle. ## Submit Scans at an Optimal Rate Copyleaks runs on cloud infrastructure, dynamically scaling resources based on demand. However, submitting too many requests at once can reduce efficiency. ### Avoid Overloading the System - Instead of submitting all documents at once, send them gradually at a controlled rate (`N` calls per second). - If handling large volumes (e.g., 1M+ files), adjust to the maximum allowed rate limit (see [Rate Limit Policy](/reference/data-types/authenticity/technical-specifications)). ### Prevent Slow Start Issues - Don’t flood the system with a sudden burst of requests. - Instead, start with a low rate and gradually increase to maintain stable performance. Custom plans are available for large-scale users who need higher limits. Contact [support@copyleaks.com](mailto:support@copyleaks.com) to discuss options. ## Adjust Sensitivity for Speed vs. Accuracy Copyleaks supports different **sensitivity levels**, balancing **speed** and **comprehensiveness** based on your needs. Set the **`properties.sensitivityLevel`** value based on priority: | Level | Focus | Best For | |-------|-------|---------| | `1` | **Speed** | Quicker scans, less comprehensive. | | `3` *(default)* | **Balanced** | Recommended for most use cases. | | `5` | **Comprehensive** | Deep analysis, high accuracy. | We recommend level `3` for most users, but feel free to adjust as needed. ## Reuse Your Authentication Token Each **JWT token** generated during login is **valid for 48 hours**. Avoid unnecessary login calls, reuse your token for multiple requests within its validity period. For more information on obtaining a new token, refer to the **[Login API](/reference/actions/account/login)**. ## Next Steps Learn optimization strategies specific to AI Image Detection API. Explore the full list of features and options available for configuring your scans. Understand the rate limit policy and other technical specifications for optimal API usage. Learn how to obtain and manage your authentication token for API access. --- ## Handling Failures Source: https://docs.copyleaks.com/concepts/performance/handling-failures > Learn how to implement an exponential backoff strategy for retrying requests to the Copyleaks API. This document outlines how to handle failures when interacting with the Copyleaks API, specifically focusing on implementing an **exponential backoff strategy** for retrying requests. ## Understanding Failure Responses When making requests to the Copyleaks API, you may encounter various HTTP status codes indicating different types of failures. Here are some common ones: - **Error code 503:** Service Unavailable. Typically, this error will appear when Copyleaks is undergoing a maintenance period. You can be notified for these events using [**Copyleaks Status**](https://status.copyleaks.com) by subscribing to alerts. We broadcast a message days prior to the event time so users will be able to make preparations in advance. - **Error code 5xx**: Internal errors. There is an issue pertaining to Copyleaks’ service and\or the network. - **Error code 429**: Too many requests. Copyleaks, like other REST API services, has a rate limit policy that defines the maximum calls that can be made. Exceeding the maximum calls repeatedly will lead to temporary/permanent blocks. ## Suggested Retry Strategy [**Exponential backoff**](https://en.wikipedia.org/wiki/Exponential_backoff) is a standard algorithm that helps applications define a retry strategy for consuming a network service. For these status codes mentioned above, we recommend implementing a retry algorithm by doing the following: 1. Make a request to the Copyleaks API. 2. If the requests fail, wait 1 + `rand_seconds_number` seconds. Then, retry. 3. If the requests fail, wait 2 + `rand_seconds_number` seconds. Then, retry. 4. If the requests fail, wait 4 + `rand_seconds_number` seconds. Then, retry. 5. ... 6. And so on, up to `max_time` seconds. 7. Wait `max_time` and retry up to a limit of n times. ### Definitions: `rand_seconds_number` - Is a random number to add to the wait time. This is to prevent multiple clients from retrying at the same time, which can lead to a thundering herd problem. Suggested values is between 1 and 10 seconds. `max_time` - Is the maximum number of seconds to wait. Suggested value is 60 seconds. ## Next Steps Learn how to use webhooks to receive real-time notifications about scan statuses, including failures. Review the technical specifications, including rate limits, to optimize your API usage. Explore the comprehensive Authenticity API for managing your plagiarism and AI detection processes. --- ## Best Practices for Working with Images Source: https://docs.copyleaks.com/concepts/performance/image-best-practices > Learn how to optimize performance when using the Copyleaks AI Image Detection API, including compression, multipart uploads and throughput optimization. Follow these best practices to **maximize performance, reduce bandwidth usage and improve throughput** when working with the Copyleaks [AI Image Detection](https://copyleaks.com/ai-detector/ai-image-detector) API. This guide covers best practices specifically for **AI Image Detection**. For text and document scanning optimization, see the [Text & Document Best Practices](/concepts/performance/best-practices) guide. ## Use Multipart/Form-Data Format Always use **multipart/form-data** instead of JSON with base64 encoding: - **Smaller payload size**: Avoids 33% base64 encoding overhead - **Faster uploads**: Direct binary transfer is more efficient - **Better memory usage**: Reduces processing overhead ## Enable Response Compression Add this header to your requests to reduce response size: ```http Accept-Encoding: gzip ``` Image detection results can include large RLE masks. Most HTTP clients automatically decompress gzip responses. ## Submit Scans at an Optimal Rate The API has rate limits to ensure optimal performance: - **900 requests per 15 minutes** per host - **10 requests per second** per user (default) Send images at a steady rate rather than in bursts, and implement retry logic with exponential backoff when rate limits are reached. Need higher rate limits? Contact [support@copyleaks.com](mailto:support@copyleaks.com) to discuss custom plans. ## Scale Across Multiple Servers For higher throughput, distribute uploads across multiple servers. Each server can independently send up to 900 requests per 15 minutes, allowing parallel processing of large image batches. ## Reuse Your Authentication Token JWT tokens are **valid for 48 hours**: - Cache and reuse tokens for multiple requests - Refresh before the 48-hour window ends - Avoid calling the login API for every image submission ## Preserve Original Image Data Submit images in their original form for accurate [AI detection](https://copyleaks.com/ai-detector) results. **Avoid:** - Resizing or cropping - Recompressing or converting formats - Applying filters or adjustments **Best practice:** Submit the exact image file as received or captured, preserving EXIF metadata and original format. AI-generated images have subtle patterns in pixel data that can be lost through manipulation. ## Summary - Use **multipart/form-data** format - Enable **response compression** with `Accept-Encoding: gzip` - Submit at a **steady rate** (under 900/15min per host, 10/sec per user) - **Distribute load across multiple servers** for higher throughput - **Reuse authentication tokens** for up to 48 hours - **Submit original images** without modifications ## Next Steps Learn how to implement AI image detection in your application. View the complete API specification and parameters. --- # Concepts → Security ## Trust & Security Source: https://docs.copyleaks.com/concepts/security/overview > How Copyleaks protects your data: AES-256 encryption, SOC 2 and SOC 3 certification, GDPR compliance, and a restricted, TLS-secured network. At Copyleaks, we are committed to the security of your data and privacy. We understand that our customers are entrusting us with their data, and we take that responsibility very seriously. We have implemented a comprehensive security program that includes administrative, technical, and physical safeguards to protect your data from unauthorized access, use, or disclosure. This page provides an overview of our security program, including our security architecture, data handling policies, and compliance certifications. ## Our Commitment to Security Our approach to security is built on several key pillars: ### Security Architecture and Infrastructure Our platform is built on a robust and secure foundation to protect your data at every level. - **Secure Network Design:** All platform components communicate through a secure internal company network. Access to this network is highly restricted, even for Copyleaks employees, and requires identity verification via an SSL client certificate. All communication within the internal network is secured using TLS v1.2 or newer. - **Cloud-Based Architecture:** We leverage a secure, cloud-based system architecture to provide scalable and reliable service. - **On-Premises Option:** For organizations requiring complete control over their data infrastructure, we offer on-premises Cloud Private Hubs. This allows you to retain all sensitive data within your own secured digital environment while utilizing our advanced detection technology. - **Continuous Monitoring:** Our systems are monitored 24/7, enabling us to respond instantly to any downtime or security incidents as they are detected. ### Data Encryption Data safety is a cornerstone of our security mechanisms. We employ military-grade encryption to ensure your data is protected at all times. - **Encryption in Transit:** All data transferred to and from our platform is sent exclusively over secure channels (100% HTTPS) using SSL connections. - **Encryption at Rest:** All data saved on our platform is encrypted using the AES-256 standard. Encryption keys are managed by our Cloud providers and are rotated automatically to ensure maximum security. - **Data Backup:** We perform daily data backups, which are stored securely in our backup data centers. ## Compliance and Certifications Our products routinely undergo independent verification of privacy, security, and compliance controls to meet global standards and earn the trust of our users. - [**SOC 2 & SOC 3:**](https://en.wikipedia.org/wiki/System_and_Organization_Controls) Copyleaks is SOC 2 & 3 certified, demonstrating our commitment to securely managing data to protect our customers' interests and privacy. Our SOC 3 report, audited by KPMG, is publicly available and outlines our high-powered system's adherence to security, privacy, and confidentiality standards. - [**GDPR:**](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation) We are fully committed to adhering to the guidelines of the EU General Data Protection Regulation (GDPR). For our European customers, we offer the `copyleaks.eu` site with servers located in Germany, ensuring data processing remains within Europe. - [**PCI DSS:**](https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard) We adhere to the Payment Card Industry Data Security Standard (PCI DSS). All payments are processed through Stripe, and we do not access or store any personal credit card information within the Copyleaks system. - [**NIST RMF:**](https://en.wikipedia.org/wiki/Risk_Management_Framework) We meet the guidelines of the NIST Risk Management Framework (RMF), a systematic process for managing information security risk developed by the U.S. National Institute of Standards and Technology. - [**Accessibility:**](https://copyleaks.com/accessibility) We believe technology should be accessible to everyone. Our platform is designed to be user-friendly for all, and our Voluntary Product Accessibility Templates (VPATs) are available for review. ## Application and Operational Security We maintain a rigorous application security program to protect our platform from threats. - **Vulnerability Management:** We routinely run vulnerability scans of our system components and use static code analyzers to detect problematic code before it is deployed. - **Regular Updates:** We regularly update the security of our products to protect against emerging threats. - **Responsible Disclosure:** We take security and privacy very seriously and encourage our users to report any identified vulnerabilities. If you believe you have found a security vulnerability, please submit a report with details such as your account email and a screenshot of the issue so our team can investigate. ## Useful Links Learn about our compliance with global security standards and certifications. Explore our security practices and measures to protect your data. --- ## Webhooks Security Source: https://docs.copyleaks.com/concepts/security/webhooks > Learn how to secure your Copyleaks webhook endpoints against unauthorized access and ensure reliable communication. Communication with the Copyleaks service is conducted via RESTful requests and responses. Some operations involve asynchronous processing, during which a webhook notification is sent upon completion. Since your server must be accessible over the internet to receive webhook notifications, it is crucial to ensure that incoming requests originate from Copyleaks. To verify the authenticity of webhook requests, you can implement one or more of the following security measures. ## Authentication via HTTPS Client Certificate Copyleaks webhook servers support **HTTPS connections** for secure communication with your endpoints, preventing unauthorized access to transmitted data. To enable this security feature, simply provide an **HTTPS endpoint** when submitting a file for scanning. To further secure your endpoint, Copyleaks employs **SSL client certificates** to authenticate webhook requests and confirm they originate from Copyleaks. Self-signed certificates are also supported. To retrieve the latest SSL client certificate thumbprints, use the following REST API request: ```http GET https://api.copyleaks.com/v2/security/client-certificates ``` This authentication method requires an HTTPS-enabled endpoint with SSL support. Non-secure HTTP connections do not support this feature. Since this list is **dynamic** and subject to change, we recommend setting up an automated process to update your environment daily. ## Authentication via Developer Payload An alternative method to prevent unauthorized access is by utilizing the `properties.developerPayload` field. To implement this: 1. Set the `developerPayload` value to a unique, secret string known only to you. 2. When receiving a webhook request, verify that the `developerPayload` in the request matches the expected value. 3. For enhanced security, consider encrypting the secret string with a private key known only to your system. By employing these authentication methods, you can safeguard your webhook endpoints and ensure secure communication with Copyleaks. ## Configuring Web Application Firewalls (WAF) Many users have security measures such as AWS WAF, Cloudflare, or other Web Application Firewalls (WAF) in place, which may block webhook requests if they appear suspicious. If you are not receiving webhook notifications, it may be due to your WAF filtering the requests. ### Exclude Copyleaks Webhook Requests from WAF To resolve this, allow Copyleaks' webhooks by adding a custom header to the requests and configuring your WAF to allow requests containing this header. This ensures that webhook notifications are received without interference from security mechanisms. By employing these authentication methods and considering WAF exclusions, you can safeguard your webhook endpoints and ensure secure, uninterrupted communication with Copyleaks. ## Static IP Addresses for Webhook Delivery Enterprise For an enhanced layer of security, we offer enterprise customers the option to receive all webhook notifications from a static, predefined list of IP addresses. Enabling this feature allows you to configure your firewall to accept incoming traffic exclusively from our trusted servers, a practice known as IP allowlisting. This significantly reduces the risk of spoofing and ensures that your systems only process legitimate, verified requests from our platform. To have this feature enabled and to receive the list of static IPs for allowlisting, please contact your account manager. ## Next Steps Learn about the different types of webhooks and how to configure them. Review the technical specifications, including security considerations for API interactions. Understand how to export scan results, often delivered via webhooks. --- # Resources ## Working with AI Agents Source: https://docs.copyleaks.com/resources/llms > Copyleaks Docs provide llms.txt standard to optimize AI interactions with our documentation. When working with any AI or Large Language Model (LLM), providing relevant and accurate context is critical for achieving high-quality results. To help developers and their AI applications better understand our documentation, we have adopted the `llms.txt` standard. This standard provides a structured, machine-readable format that guides AI models on how to interpret and utilize our documentation, ensuring the highest level of integrity and accuracy in AI-powered applications. The `llms.txt` standard is an open initiative for GenAI Governance. You can learn more about its specification and goals at [llmstxt.org](https://llmstxt.org/). ## Available Documents We provide several versions of our documentation in the `llms.txt` format, each tailored for different use cases: This file provides a high-level, structured sitemap of our documentation, including page descriptions. It is ideal for use cases where a concise overview of the content is required. [**llms.txt**](/llms.txt) This file contains the entire, unabridged content of our documentation in a single markdown file, providing the most comprehensive context possible. The full content version is extensive and may exceed the context window of some Large Language Models. [**llms-full.txt**](/llms-full.txt) --- ## Run in Postman Source: https://docs.copyleaks.com/resources/postman > Access and utilize the Copyleaks API Postman collection for seamless integration and testing. Postman is a popular tool that simplifies API testing and development. Copyleaks provides a Postman collection that covers all available API calls. This document will guide you through setting up the collection and making requests. ### Get Started - Sign up or log in to your account on [**Postman**](https://www.postman.com) - Click the button below to access the Copyleaks Postman collection: Run In Postman - Select **Fork Collection** - Name your fork and select a workspace - To make API calls, you need to authenticate: - Find your **API Key** in the **[API Dashboard](https://api.copyleaks.com/dashboard)** - In Postman, select your fork of the Copyleaks collection - Go to the **Variables** tab and enter the following values in the **CURRENT VALUE** column: - **email**: `YOUR_EMAIL_ADDRESS` - **key**: `YOUR_API_KEY` - Save the changes - After logging in, check the response for the `access_token` - Take the value of the `access_token` and place it in the Authorization tab of your fork in Postman as the value of Token. All endpoints will inherit this token from the parent and will use it for authentication automatically You can now start making API requests. For example, to run an AI detection scan: - In your Postman workspace, navigate to your fork of the Copyleaks collection - Select **AI Detection** > **Submit Natural Language** > Update the request body and add the scan ID, then click **Send** - Review the response ## Next Steps Check out our Copyleaks API Postman Profile Visit the complete Copyleaks API Postman Collection documentation Learn how to authenticate and get started with Copyleaks APIs Discover the full list of available Scans Methods Endpoints. Submit, start, and manage plagiarism scans --- # Resources → SDKs ## Overview Source: https://docs.copyleaks.com/resources/sdks/overview > Accelerate your integration with our official SDKs. Connect to the Copyleaks API with just a few lines of code and start building with confidence. Integrate the full power of the Copyleaks API with just a few lines of code. Our official Software Development Kits (SDKs) are designed to provide a seamless developer experience, allowing you to build robust applications quickly and confidently. ### The Developer Experience The official Copyleaks SDKs are: Save hours of development time with pre-built functions for every API endpoint. Our SDKs are always in sync with the latest API features, so you can take advantage of new capabilities as soon as they are released. Rely on officially maintained, production-ready code with comprehensive documentation and clear examples. We handle the complexities of authentication, request signing, and error handling, so you can focus on building great features for your users. ### Get Started with Your Language Select an official SDK for your preferred programming language and start building with Copyleaks today. --- ## Python SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/python > Install the Copyleaks Python SDK, authenticate, and submit your first scan in under 5 minutes with this step-by-step guide. This guide will walk you through installing the official Python SDK and running your first scan. In just a few minutes, you'll be able to run your first scan directly from your Python application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started First, install the official `copyleaks` package from PyPI into your project using pip: ```bash pip install copyleaks ``` Remember to replace the placeholder `YOUR_EMAIL_ADDRESS` and `YOUR_API_KEY` with your actual credentials. ```python title="scan_text.py" import base64 from copyleaks.copyleaks import Copyleaks from copyleaks.exceptions.command_error import CommandError from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties # --- Your Credentials --- EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS' KEY = 'YOUR_API_KEY' # -------------------- # Log in to the Copyleaks API try: auth_token = Copyleaks.login(EMAIL_ADDRESS, KEY) print(" Logged in successfully!") except CommandError as ce: print(f" Login failed: {ce}") exit() # Prepare your content for scanning # You can scan a URL, a local file, or raw text. # This example scans a simple string of text. print("Submitting text for scanning...") text_to_scan = "Hello world, this is a test." base64_content = base64.b64encode(text_to_scan.encode()).decode() # Configure the scan # A unique scan ID for this submission scan_id = "my-first-scan" scan_properties = ScanProperties("https://your-server.com/webhook/{STATUS}") scan_properties.set_sandbox(True) # Turn on sandbox mode for testing file_submission = FileDocument(base64_content, "test.txt") file_submission.set_properties(scan_properties) # Submit the scan to Copyleaks Copyleaks.submit_file(auth_token, scan_id, file_submission) print(f" Scan submitted successfully! Scan ID: {scan_id}") print("You will be notified via your webhook when the scan is complete.") ``` The example code performs four main actions to submit a scan: 1. **Login:** It authenticates with your email and API key to get a secure login token from the Copyleaks server. This token is required for all subsequent requests. 2. **Prepare Content:** It takes a simple string of text and encodes it into Base64 format. The SDK requires content to be in this format for submission. 3. **Configure Scan:** It creates a `ScanProperties` object to define the scan's behavior. We enable `sandbox` mode for safe testing without using credits and provide a `webhook` URL. 4. **Submit for Scanning:** It sends the prepared content and its configuration to the Copyleaks API. The process is asynchronous, meaning you don't have to wait for the results. Instead, Copyleaks will notify your webhook URL once the scan is complete. ## Next Steps Check the official Copyleaks Python SDK repository on GitHub for installation and usage details. Install the official Copyleaks Python package from PyPI for easy integration. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## JavaScript SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/javascript > Install the Copyleaks JavaScript SDK, authenticate, and submit your first scan in minutes with this step-by-step guide. This guide will walk you through installing the official JavaScript SDK and running your first scan. In just a few minutes, you'll be able to easily use Copyleaks products directly from your JavaScript or TypeScript application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started First, install the official `plagiarism-checker` package from npm into your project. ```bash npm i plagiarism-checker ``` The following example shows how to authenticate and submit a simple string of text for a plagiarism scan using the SDK's data models. Remember to replace the placeholder credentials and webhook URL with your actual values. ```javascript title="scan.js" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); // --- Your Credentials --- const EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; const KEY = 'YOUR_API_KEY'; const WEBHOOK_URL = 'https://your-server.com/webhook/{STATUS}'; // -------------------- async function main() { console.log('Authenticating...'); const copyleaks = new Copyleaks(); const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, KEY); console.log(' Login successful!'); console.log('Submitting text for scanning...'); const scanId = `${Date.now()}`; // Use a timestamp for a unique ID const textToScan = 'Hello world, this is a test.'; const base64Content = Buffer.from(textToScan).toString('base64'); const submission = new CopyleaksFileSubmissionModel( base64Content, 'test.txt', { sandbox: true, // Turn on sandbox mode for testing webhooks: { status: WEBHOOK_URL } } ); await copyleaks.submitFileAsync(authToken, scanId, submission); console.log(` Scan submitted successfully! Scan ID: ${scanId}`); } main().catch(err => console.error(err)); ``` ```typescript title="scan.ts" icon="code" import { Copyleaks, CopyleaksFileSubmissionModel, type CopyleaksAuthToken } from 'plagiarism-checker'; // --- Your Credentials --- const EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS'; const KEY = 'YOUR_API_KEY'; const WEBHOOK_URL = 'https://your-server.com/webhook/{STATUS}'; // -------------------- async function main() { console.log('Authenticating...'); const copyleaks = new Copyleaks(); const authToken: CopyleaksAuthToken = await copyleaks.loginAsync(EMAIL_ADDRESS, KEY); console.log(' Login successful!'); console.log('Submitting text for scanning...'); const scanId = `${Date.now()}`; // Use a timestamp for a unique ID const textToScan = 'Hello world, this is a test.'; const base64Content = Buffer.from(textToScan).toString('base64'); const submission = new CopyleaksFileSubmissionModel( base64Content, 'test.txt', { sandbox: true, // Turn on sandbox mode for testing webhooks: { status: WEBHOOK_URL } } ); await copyleaks.submitFileAsync(authToken, scanId, submission); console.log(` Scan submitted successfully! Scan ID: ${scanId}`); } main().catch(err => console.error(err)); ``` 1. **Login**: We authenticate with your email and API key to get a secure login token. 2. **Prepare Submission**: We encode a string to Base64 and create a new `CopyleaksFileSubmissionModel`. This model is the recommended way to structure your submission data. 3. **Configure & Submit**: We pass the submission model to `submitFileAsync`. The model itself contains the sandbox settings and the webhook URL where Copyleaks will send a notification when the scan is complete. ## Next Steps Check the official Copyleaks NodeJS SDK repository on GitHub for installation and usage details. Install the official Copyleaks NodeJS package from NPM for easy integration. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## Java SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/java > Install the Copyleaks Java SDK, authenticate, and submit your first scan in under 5 minutes with this step-by-step guide. This guide will walk you through installing the official Java SDK and running your first scan. In just a few minutes, you'll be able to check content for plagiarism, AI-generated text, moderation and more directly from your Java application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started The SDK requires **Java 11 or higher**. Add the official `copyleaks-java-sdk` dependency to your project's `pom.xml` file. ```xml title="pom.xml" com.copyleaks.sdk copyleaks-java-sdk 5.1.0 ``` Remember to replace the placeholder credentials and webhook URL with your actual values. ```java title="ScanExample.java" import classes.Copyleaks; import models.response.CopyleaksAuthToken; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.SubmissionProperties; import models.submissions.properties.SubmissionWebhooks; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Random; public class ScanExample { // --- Your Credentials --- private static final String EMAIL_ADDRESS = "YOUR_EMAIL_ADDRESS"; private static final String KEY = "YOUR_API_KEY"; private static final String WEBHOOK_URL = "https://your-server.com/webhook/{STATUS}"; // -------------------- public static void main(String[] args) { CopyleaksAuthToken token; try { // Log in to the Copyleaks API System.out.println("Authenticating..."); token = Copyleaks.login(EMAIL_ADDRESS, KEY); System.out.println(" Logged in successfully!"); // Prepare your content for scanning System.out.println("Submitting text for scanning..."); String textToScan = "Hello world, this is a test."; String base64Content = Base64.getEncoder().encodeToString(textToScan.getBytes(StandardCharsets.UTF_8)); String filename = "test.txt"; String scanId = Integer.toString(new Random().nextInt(100000)); // Configure the scan SubmissionWebhooks webhooks = new SubmissionWebhooks(WEBHOOK_URL); SubmissionProperties submissionProperties = new SubmissionProperties(webhooks); submissionProperties.setSandbox(true); // Turn on sandbox mode for testing CopyleaksFileSubmissionModel submissionModel = new CopyleaksFileSubmissionModel(base64Content, filename, submissionProperties); // Submit the scan to Copyleaks Copyleaks.submitFile(token, scanId, submissionModel); System.out.println(" Scan submitted successfully! Scan ID: " + scanId); System.out.println("You will be notified via your webhook when the scan is complete."); } catch (Exception e) { System.out.println(" An error occurred:"); e.printStackTrace(); } } } ``` The example code performs four main actions to submit a scan: 1. **Login:** It authenticates with your email and API key to get a secure `CopyleaksAuthToken` object, which is required for all subsequent requests. 2. **Prepare Content:** It takes a simple string of text and encodes it into Base64 format. 3. **Configure Scan:** It creates a `SubmissionProperties` object containing `SubmissionWebhooks` to define the scan's behavior. We enable `sandbox` mode for safe testing and provide the webhook URL. 4. **Submit for Scanning:** It creates a `CopyleaksFileSubmissionModel` with the content and properties, then sends it to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete. ## Next Steps Check the official SDK repository on GitHub for more examples and details. View the official package on the Maven Central Repository to see all available versions. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## C# SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/csharp > Install the Copyleaks C# SDK, authenticate, and submit your first scan in under 5 minutes with this step-by-step guide. This guide will walk you through installing the official C# SDK and running your first scan. In just a few minutes, you'll be able to check content for plagiarism, AI-generated text, and more directly from your .NET application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started First, install the official `Copyleaks` package from NuGet into your project using the Package Manager Console. ```powershell Install-Package Copyleaks ``` Remember to replace the placeholder credentials and webhook URL with your actual values. ```csharp title="Program.cs" using System; using System.Text; using System.Threading.Tasks; using Copyleaks.SDK.V3.API; using Copyleaks.SDK.V3.API.Models.Requests; using Copyleaks.SDK.V3.API.Models.Requests.Properties; public class Program { // --- Your Credentials --- private const string USER_EMAIL = "YOUR_EMAIL_ADDRESS"; private const string USER_KEY = "YOUR_API_KEY"; private const string WEBHOOK_URL = "https://your-server.com/webhook/{STATUS}"; // -------------------- public static async Task Main(string[] args) { try { // Log in to the Copyleaks API Console.WriteLine("Authenticating..."); var identityClient = new CopyleaksIdentityApi(); var loginResponse = await identityClient.LoginAsync(USER_EMAIL, USER_KEY); Console.WriteLine(" Logged in successfully!"); // Prepare your content for scanning Console.WriteLine("Submitting text for scanning..."); var apiClient = new CopyleaksScansApi(); var scanId = Guid.NewGuid().ToString(); var textToScan = "Hello world, this is a test."; var base64Content = Convert.ToBase64String(Encoding.UTF8.GetBytes(textToScan)); // Configure the scan var scanProperties = new ClientScanProperties(); scanProperties.Sandbox = true; // Turn on sandbox mode for testing scanProperties.Webhooks = new Webhooks { Status = new Uri($"{WEBHOOK_URL}") }; var fileDocument = new FileDocument { Base64 = base64Content, Filename = "test.txt", PropertiesSection = scanProperties }; // Submit the scan to Copyleaks await apiClient.SubmitFileAsync(scanId, fileDocument, loginResponse.Token); Console.WriteLine($" Scan submitted successfully! Scan ID: {scanId}"); Console.WriteLine("You will be notified via your webhook when the scan is complete."); } catch (Exception ex) { Console.WriteLine($" An error occurred: {ex.Message}"); } } } ``` The example code performs four main actions to submit a scan: 1. **Login:** It authenticates with your email and API key to get a secure login token. This token is required for all subsequent requests. 2. **Prepare Content:** It takes a simple string of text and converts it into a Base64 string. 3. **Configure Scan:** It creates a `ClientScanProperties` object to define the scan's behavior. We enable `sandbox` mode for safe testing and provide a `webhook` URL for completion notifications. 4. **Submit for Scanning:** It creates a `FileDocument` with the content and properties, then sends it to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete. ## Next Steps Check the official SDK repository on GitHub for more examples and details. View the official package on the NuGet Gallery to see all available versions. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## PHP SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/php > Install the Copyleaks PHP SDK, authenticate, and submit your first scan in under 5 minutes with this step-by-step guide. This guide will walk you through installing the official PHP SDK and running your first scan. In just a few minutes, you'll be able to check content for plagiarism, AI-generated text, and more directly from your PHP application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started First, install the official `copyleaks/php-plagiarism-checker` package from Packagist into your project using Composer. ```bash composer require copyleaks/php-plagiarism-checker ``` Remember to replace the placeholder credentials and webhook URL with your actual values. ```php title="scan.php" login($EMAIL_ADDRESS, $KEY); echo " Logged in successfully!\n"; // Prepare your content for scanning echo "Submitting text for scanning...\n"; $textToScan = "Hello world, this is a test."; $base64Content = base64_encode($textToScan); $scanId = time(); // Configure the scan $webhooks = new SubmissionWebhooks($WEBHOOK_URL); $properties = new SubmissionProperties($webhooks); $properties->setSandbox(true); // Turn on sandbox mode for testing $submission = new CopyleaksFileSubmissionModel($base64Content, 'test.txt', $properties); // Submit the scan to Copyleaks $copyleaks->submitFile($loginToken, $scanId, $submission); echo " Scan submitted successfully! Scan ID: " . $scanId . "\n"; echo "You will be notified via your webhook when the scan is complete.\n"; } catch (Exception $e) { echo " An error occurred: " . $e->getMessage() . "\n"; } ``` The example code performs four main actions to submit a scan: 1. **Login:** It authenticates with your email and API key to get a secure login token, which is required for all subsequent requests. 2. **Prepare Content:** It takes a simple string of text and encodes it into Base64 format. 3. **Configure Scan:** It creates a `SubmissionProperties` object containing `SubmissionWebhooks` to define the scan's behavior. We enable `sandbox` mode for safe testing and provide the webhook URL. 4. **Submit for Scanning:** It creates a `CopyleaksFileSubmissionModel` with the content and properties, then sends it to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete. ## Next Steps Check the official SDK repository on GitHub for more examples and details. View the official package on Packagist to see all available versions. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- ## Ruby SDK Quickstart Source: https://docs.copyleaks.com/resources/sdks/ruby > Install the Copyleaks Ruby SDK, authenticate, and submit your first scan in under 5 minutes with this step-by-step guide. This guide will walk you through installing the official Ruby SDK and running your first scan. In just a few minutes, you'll be able to check content for plagiarism, AI-generated text, and more directly from your Ruby application. Before you start, ensure you have the following: - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**. - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**. ## Get Started First, install the official `plagiarism-checker` gem from RubyGems into your project. ```bash gem install plagiarism-checker ``` Remember to replace the placeholder credentials and webhook URL with your actual values. ```ruby title="scan.rb" require 'copyleaks' require 'base64' # --- Your Credentials --- USER_EMAIL = 'YOUR_EMAIL_ADDRESS' USER_API_KEY = 'YOUR_API_KEY' WEBHOOK_URL = 'https://your-server.com/webhook/{STATUS}' # -------------------- begin # Log in to the Copyleaks API puts "Authenticating..." copyleaks = Copyleaks::API.new auth_token = copyleaks.login(USER_EMAIL, USER_API_KEY) puts " Logged in successfully!" # Prepare your content for scanning puts "Submitting text for scanning..." scan_id = Time.now.to_i.to_s text_to_scan = 'Hello world, this is a test.' base64_content = Base64.strict_encode64(text_to_scan) # Configure the scan webhooks = Copyleaks::SubmissionWebhooks.new(WEBHOOK_URL) properties = Copyleaks::SubmissionProperties.new(webhooks) properties.sandbox = true # Turn on sandbox mode for testing submission = Copyleaks::CopyleaksFileSubmissionModel.new( base64_content, 'test.txt', properties ) # Submit the scan to Copyleaks copyleaks.submit_file(auth_token, scan_id, submission) puts " Scan submitted successfully! Scan ID: #{scan_id}" puts "You will be notified via your webhook when the scan is complete." rescue StandardError => e puts " An error occurred: #{e.message}" end ``` The example code performs four main actions to submit a scan: 1. **Login:** It authenticates with your email and API key to get a secure login token, which is required for all subsequent requests. 2. **Prepare Content:** It takes a simple string of text and encodes it into Base64 format. 3. **Configure Scan:** It creates a `SubmissionProperties` object containing `SubmissionWebhooks` to define the scan's behavior. We enable `sandbox` mode for safe testing and provide the webhook URL. 4. **Submit for Scanning:** It creates a `CopyleaksFileSubmissionModel` with the content and properties, then sends it to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete. ## Next Steps Check the official SDK repository on GitHub for more examples and details. View the official package on RubyGems.org to see all available versions. Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content. Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async. Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs. Scan and moderate text content for unsafe or policy-relevant material across 10+ categories. --- # Resources → Legal ## About CopyleaksBot Source: https://docs.copyleaks.com/resources/legal/copyleaksbot > Information for webmasters, SEOs, and developers about CopyleaksBot, the web crawler used by Copyleaks. CopyleaksBot is the official web crawler for Copyleaks. Its purpose is to discover and crawl publicly available web pages for our search services. We are committed to respecting the rules set forth by webmasters in their robots.txt files. ## User Agent CopyleaksBot identifies itself with the following User-Agent string in its HTTP requests: ``` CopyleaksBot/1.0 ``` ## How to Control CopyleaksBot To limit which pages Copyleaks can index, use your website's robots.txt file. CopyleaksBot fully respects the robots.txt standard. You can use it to prevent our bot from indexing your entire site, specific directories, or individual pages. The User-agent token for our bot is `CopyleaksBot`. Add the following to your robots.txt file: ```txt User-agent: CopyleaksBot Disallow: / ``` Add the following to your robots.txt file: ```txt User-agent: CopyleaksBot Disallow: /private-directory/ ``` Add the following to your robots.txt file: ```txt User-agent: CopyleaksBot Disallow: /path/to/page.html ``` ## Related Resources Get help with CopyleaksBot or other questions from our support team. --- # Resources → Updates ## What's New Source: https://docs.copyleaks.com/resources/updates/release-notes > Learn about the latest updates and features in Copyleaks API. Please periodically check this page to get official updates on the product. In this document, you will find information about product updates, new releases, deprecated functionality, bug fixes, and known issues. *** ## July 12, 2026 New **References Validation** A new scan capability that checks whether the references and citations in a document are real and accurately described. Copyleaks detects every reference in the submitted text, parses it into structured fields, and validates it against a trusted source, helping you catch fabricated, misattributed, or incorrectly dated citations. **Highlights:** - Enable per scan with the new top-level `references.validate` property on the existing Submit endpoints (defaults to `false`) - **Academic references** (papers, journal articles) are verified against the Copyleaks academic citation index - **Non-academic references** (web pages, docs, encyclopedias) are verified by fetching the cited URL and comparing the live page to the citation - The completed webhook reports a `referencesValidation` summary; the full per-reference results, including parsed fields, corroborating sources, and per-field match signals, are available in the crawled version See the [References Validation concept](/concepts/features/references-validation), the [Validate References guide](/guides/authenticity/validate-references), or the [response schema](/reference/data-types/authenticity/results/crawled-version#references-validation). --- ## July 1, 2026 New **AI Image Detection Upgrade** This version improves overall accuracy, particularly for image-editing use cases where AI-generated features are blended into standard images. We've sharpened our detection algorithms to better localize intricate details and specific subjects across varying image qualities. As always, this release ensures excellent, continuous compatibility with state-of-the-art, recently-released models. --- ## July 1, 2026 New **Image Plagiarism Detection API Launch** The new Image Plagiarism Detection API is now available. Submit an image and receive a categorized list of web matches - full matches (exact copies) and partial matches (modified versions), each with the web pages where the image was found — in a single synchronous call. See the [Image Plagiarism Detection guide](/guides/authenticity/image-plagiarism-detection) to get started, or jump to the [API reference](/reference/actions/image-plagiarism-detector/check). --- ## June 22, 2026 New **Higher Character Limit for AI Detection** The synchronous AI Detection endpoint now accepts up to **100,000 characters** per request, raised from the previous 25,000 character limit. Submit larger text passages in a single call without splitting them. See the [AI Text Detector reference](/reference/actions/writer-detector/check). --- ## June 17, 2026 New **AI Image Detection Async Endpoint** A new asynchronous endpoint joins the AI Image Detection API. Submit an image URL and receive results via webhook when processing is complete useful when you want a fire-and-forget submission instead of holding the connection open for the synchronous response. **Highlights:** - `POST /v1/ai-image-detector-async/{scanId}/submit` accepts an image URL and a webhook config - Optional `maskType: "heatmap"` returns a pixel-level overlay of AI-generated regions - Same `ai-image-1-ultra` model and webhook payload shape as the synchronous endpoint - Custom `headers` for both the inbound image fetch and the outbound webhook call See the [Async Submit reference](/reference/actions/ai-image-detector/submit) for the full property list and code samples. The original synchronous [Detect](/reference/actions/ai-image-detector/check) endpoint remains unchanged. --- ## May 31, 2026 New **AI Video Detection API Launch** We're launching the AI Video Detection API, which detects whether a video was generated or partially generated by AI. **Key features:** - **Audio & visual track analysis** - independently analyzes both tracks, returning time-based detection data (start positions and durations in milliseconds) for each - **Overall AI ratio** - a single `overallAIRatio` score representing the proportion of the video that is AI-generated, combining both audio and visual detections - **Metadata extraction** - pulls embedded provenance metadata (C2PA standard) to identify the generating tool and creation timestamp when available - **Broad format support** - `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.mpg`, `.m4v`, `.3gp`, `.mxf`, up to 0.5 GB and 1 hour - **Async webhook delivery** - submit a video URL and receive results via webhook when processing completes See the [AI Video Detection guide](/guides/ai-detector/ai-video-detection) to get started, or jump to the [API reference](/reference/actions/ai-video-detector/submit). --- ## February 22, 2026 New **Multipart Support for AI Image Detection** The [AI Image Detection API](/reference/actions/ai-image-detector/check) now supports `multipart/form-data` (recommended) for submitting images as binary files. JSON with base64 encoding remains available but is less recommended for production use. See [Best Practices for Working with Images](/concepts/performance/image-best-practices) for optimization tips. --- ## February 1, 2026 New **AI Image Detection Upgrade** Enhanced capability by improving accuracy, adding supported models, smartphone features (iPhone smart magic eraser and Samsung GenAI editing). The new version offers accuracy level improvements on social media, small, low-quality, and professionally filtered images. It also provides excellent support for the top-of-the-class models. ## December 16, 2025 Removal **AI Code Detection Deprecated in Submit Endpoints** Following the deprecation of the standalone AI Code Detection endpoint in August, we are now deprecating AI code detection capabilities from the all endpoints. The `properties.aiGeneratedText` feature will no longer support source code files. The following property is deprecated in: - `PUT https://api.copyleaks.com/v3/scans/submit/file/{scanid}` - `PUT https://api.copyleaks.com/v3/scans/submit/url/{scanid}` - `PUT https://api.copyleaks.com/v3/scans/submit-ocr/url/{scanid}` For further information about the submit methods, please see [Scans Actions](/reference/actions/authenticity/overview). This change only affects AI detection for programming languages and source code. AI Content Detection for natural language text continues to be fully supported. --- ## December 3, 2025 New **Enhanced Scan Exclusion Options** Added new fields to the `properties.scanning.exclude` object in Submit Endpoints: - `properties.scanning.exclude.backlinksDomains` - Exclude results that contain backlinks to these specific domains. Provide an array of domain names to filter out from internet plagiarism results. - `properties.scanning.exclude.text` - Exclude any results that contain text matching these phrases. Provide an array of text strings to ignore during scanning. Documentation available in the [API Reference](/reference/actions/overview). --- ## August 31, 2025 New **AI Image Detection API Launch** The new AI Image Detection API is now available, enabling you to detect whether an image is AI-generated or partially AI-generated. **Key Features:** - **Pixel-level analysis** - Get detailed masks showing which parts of an image are AI-generated vs. human-created - **Metadata extraction** - Automatically extract AI generation metadata when available (issuer, creation time, tool used) - **Comprehensive results** - Receive percentage breakdowns of AI vs. human content, plus detailed RLE-encoded mask data - **Flexible image support** - Process PNG, JPG, JPEG, BMP, WebP, and HEIC/HEIF formats up to 27 megapixels See the [AI Image Detection API documentation](/reference/actions/ai-image-detector/check) for details. --- ## August 28, 2025 Deprecated **Standalone AI Code Detection Endpoint Deprecated** The standalone AI Code Detection endpoint for source code has been deprecated and will be removed in a future release. This is a dedicated endpoint specifically for detecting AI-generated source code across multiple programming languages. **Deprecated endpoint:** `POST https://api.copyleaks.com/v2/writer-detector/source-code/{scanId}/check` **Alternative:** For natural language text, use the standard [AI Content Detection API](/reference/actions/writer-detector/overview). ## August 18, 2025 New **Timezone Customization for PDF Reports** You can now control the timezone of the scan time displayed on PDF reports by using a new field in your scan submissions. `properties.scanTimeZone` - Specifies the desired IANA Time Zone (e.g., 'America/New_York') for the report's scan time. If this property is not set, the timezone will default to the user's country. If the country is unknown, UTC will be used. --- ## July 08, 2025 New **Text Moderation API Launch** The new Text Moderation API is now available, designed to help you maintain safe and appropriate content across your platform. **Key Features:** - **Real-time content analysis** - Get instant results for submitted text - **10+ moderation categories** - Detect hate speech, toxic language, adult content, violence, self-harm, cybersecurity threats, and more - **Precise flagging** - Receive exact character positions for each flagged segment - **Simple integration** - RESTful API that fits seamlessly into any content workflow See the [Text Moderation API documentation](/guides/moderation/moderate-text/) for details. --- ## May 15, 2025 New **PDF Report Version Management** A new field has been added for scan submissions: - `properties.pdf.reportVersion` - Specifies which version of the PDF report to generate. This string-based property overrides the legacy `version` (integer) property if both are provided. It also allows you to select the latest stable version of the PDF report by using `"latest"`. **Default Behavior:** If neither `reportVersion` nor `version` is set: - New users (created after **2025-05-15**) receive **v3** by default - Existing users receive **v1** by default --- ## May 14, 2025 New **AI Source Match Feature Launch** In an evolving digital landscape, understanding the origin and nature of content is more crucial than ever. AI Source Match revolutionizes our plagiarism and AI detection capabilities by identifying online sources that are suspected to be AI-generated. **Key Benefits:** - **Comprehensive Plagiarism Analysis** - Go beyond standard plagiarism checks by providing insights into whether the source of plagiarized content is likely AI-generated - **Deeper Source Intelligence** - Gain a clearer understanding of the authenticity of external sources, helping you assess content originality more thoroughly - **Enhanced Authenticity & Integrity** - Equip yourself with advanced tools to better uphold originality and academic/creative integrity by identifying both direct plagiarism and reliance on AI-generated source material **Implementation:** The `properties.aiSourceMatch` feature can be easily activated with the `enable` parameter within your Authenticity API calls. --- ## May 08, 2025 New **Display Language Support** A new field has been added for scan submissions: - **Display Language** - When specified, the PDF report will be generated in the selected language. Future updates may also apply this setting to the overview and other components. --- ## March 09, 2025 New **Overview API Introduction** Copyleaks introduces the Overview API to provide key insights from user scans and author's historical data. **Features:** - **Gen AI Overview** - Delivers a thorough analysis of each submitted scan, summarizing its content and identifying central themes or patterns - **Key Insights Analysis** - Pinpoints notable findings and directs user attention to significant details within the scanned material - **Historical Context** - When historical scan data is available, incorporates past insights and trends to provide a richer, context-driven perspective on current scan results --- ## March 05, 2025 New **Course and Assignment Identification** New fields have been added for scan submissions: - **Course ID** - A unique identifier for the course associated with the submission - **Assignment ID** - A unique identifier for the assignment associated with the submission --- ## April 18, 2024 New **Enhanced Alert Categorization** A new field has been added for alerts in the completed webhook response: - `category` - Scan alert category --- ## April 16, 2024 New **AI Content Detection Model Versioning** Added a new field to the response of AI Content Detection: - `modelVersion` - The version of the AI Content Detection model used --- ## April 16, 2024 New **ID Pattern Filtering for Scan Results** Added a new field in the different types of Submit Endpoints in the API: - `properties.scanning.include.idPattern` - Includes results only if their scan ID matches the supplied pattern. Matched submissions will be the only submissions included from Shared Data Hub and Private Cloud Hubs results. Documentation available in the [API Reference](/reference/actions/overview). --- ## April 4, 2024 New **Alert Types Documentation** Added comprehensive [Alert Types documentation](/reference/data-types/authenticity/scan-alerts). When scanning with Copyleaks, various alerts may be received in your Completion Webhook for AI detection, writing suggestions, failed scans, cheating, and more. This page provides a complete list of possible alerts. --- ## February 26, 2024 New **Grammar Checker API Enhancement** New field added to the Grammar Checker API - [Get Correction Types](/reference/data-types/writing/correction-types): - `correctionTypes[].category` - Category of the correction type --- ## February 26, 2024 New **Language Code Support** New field added to the request body for: - [AI Content Detection - Submit Natural Language](/reference/actions/writer-detector/check) - [Grammar Checker - Submit Text](/reference/actions/writing-assistant/check) - `language` - The language code of your content. The selected language should be from the Supported Languages list. If not supplied, the system will automatically detect the content language. --- ## February 25, 2024 New **Private Cloud Hubs API** Introduction of the [Private Cloud Hubs API](/reference/actions/private-cloud-hub/overview). Retrieve Private Cloud Hub information including credit consumption, metadata values, and current status. Requires "Super Admin" or "Admin" role. --- ## December 7, 2023 New **Grammar Checker API Launch** Introduction of the [Grammar Checker API](/reference/actions/writing-assistant/overview). Grammar Checker offers real-time, AI-driven writing corrections, serving as a virtual assessment API capable of providing constructive critiques and instantaneous enhancements to textual content. --- ## September 28, 2023 New **AI Content Detection for Source Code** Launch of [AI Content Detection API for Source Code](/reference/actions/writer-detector/overview). Use Copyleaks AI Content Detection to differentiate between human-written and AI-generated source code. --- ## May 3, 2023 New **PDF Report Version 2 Public Release** PDF version 2 is now publicly available for API users. The updated PDF report includes AI detection results, cheat alerts, and an updated interface. To enable the newest version, edit the `properties.pdf.version` flag of the [Submit endpoint](/reference/actions/authenticity/overview). --- ## January 29, 2023 New **Document Template Exclusion** You can now easily exclude document template text from plagiarism scanning. For more information, check the `properties.exclude.documentTemplateIds` flag on the [Submit endpoint](/reference/actions/authenticity/overview). --- ## January 12, 2023 New **AI Content Detection API Launch** Launch of the AI Content Detection API, which confirms whether provided text was created by a human or AI. Read the [AI Content Detection API Documentation](/reference/actions/writer-detector/overview). --- ## January 1, 2023 New **AI Content Detection Integration** AI Content Detection is now available as an option within the plagiarism detection API. To enable this option, use the flag `properties.aiGeneratedText.detect`. Documentation available for the [Submit endpoint](/reference/actions/authenticity/overview). --- ## November 13, 2022 New **Cross-Language Plagiarism Detection** Launch of Cross-Language Plagiarism Detection feature. Scans can be performed on uploaded documents across nearly 30 languages, with additional languages regularly added. For example, a document uploaded in English can find potential plagiarism matches in Chinese, Spanish, German, or any other selected language. To activate this feature, use the flag: `properties.scanning.crossLanguages.languages[]`. Documentation available for the [Submit endpoint](/reference/actions/authenticity/overview). --- ## November 1, 2022 New **New-Result Webhook Enhancement** Added two fields to the [New-Result webhook](/reference/data-types/authenticity/results/new-result): - `developerPayload` - The developer payload provided in the submit method - `score` - The current aggregate score of the scan up to this point --- ## May 25, 2022 New **Product Unification** Merged Education and Business products into one unified product that includes all features from both previous products. **Key Changes:** - Former Business users can now access Education-exclusive features, such as the Copyleaks Shared Data Hub - [New endpoints](/reference/actions/authenticity/overview) available for the merged product (existing integrations remain unchanged) - Pricing model aligned with Education pricing model (existing subscriptions unchanged) --- ## February 9, 2022 New **Indexed Document Masking Policy** Added support for indexed document masking policy for repository users. Define custom masking policies for each document in your repository. For more information, see the `properties.indexing.repositories[].maskingPolicy` flag on the submit method. --- ## February 8, 2022 New **Enhanced URL Submission Control** Added options to control HTTP headers (`headers` field) and request method (`verb` field) when using Submit by URL for both Business and Education users. --- ## February 6, 2022 New **Copyleaks Platform Release** Released new version of Copyleaks with comprehensive management capabilities: - [Copyleaks Identity](https://id.copyleaks.com) - Manage security settings, billing, and teams or Private Cloud Hubs - [Copyleaks Authentication](https://id.copyleaks.com/security) - Multi-factor authentication options: email or authenticator app - [Copyleaks Teams](https://admin.copyleaks.com/members) & [Private Cloud Hubs](https://admin.copyleaks.com/repositories) - Manage users, documents, analytics, and permissions - [Copyleaks Billing](https://id.copyleaks.com/billing) - View current plan, past invoices, and billing information --- ## January 9, 2022 New **Credits Management Documentation** Added comprehensive article about effective Copyleaks credits management and monitoring: [How to manage your credits?](/concepts/management/manage-your-credits) --- ## September 1, 2021 New **Teams Integration Documentation** Added integration guide between Copyleaks API and Copyleaks Teams. --- ## February 28, 2021 New **Java SDK Launch** Launched official SDK for Java developers: [Java SDK](https://github.com/Copyleaks/Java-Plagiarism-Checker). Package available via [Maven](https://search.maven.org/search?q=g:com.copyleaks.sdk). --- ## February 1, 2021 Change **Server IP Address Update** Server IP addresses changed starting March 1, 2021. If your application is behind a firewall, update your HTTP endpoints to allow the new Copyleaks IP policy. If you are not filtering access by IP, no action is required. Starting March 1, 2021, specific IP addresses for contacting your service are not guaranteed. --- ## January 24, 2021 New **Whitelist IP Authentication** Security enhancement: Whitelist IP Authentication allows approval of requests from specified IP addresses. Read more: [Whitelist IP Authentication](https://api.copyleaks.com/dashboard/ip-whitelist). --- ## January 21, 2021 Change **Date Format Update** Updated date format in result titles for better readability. - Old format: "dd/MM/yyyy" - New format: "MMMM dd, yyyy" --- ## January 19, 2021 New **PHP SDK Launch** Launched official SDK for PHP developers: [PHP SDK](https://github.com/Copyleaks/PHP-Plagiarism-Checker). Package available via [Packagist](https://packagist.org/packages/copyleaks/php-plagiarism-checker). --- ## January 17, 2021 New **Node.js SDK Launch** Launched official SDK for Node.js developers: [Node.js SDK](https://github.com/Copyleaks/NodeJS-Plagiarism-Checker). Package available via [npm](https://www.npmjs.com/package/plagiarism-checker). --- ## January 13, 2021 New **Python SDK Launch** Launched official SDK for Python developers: [Python SDK](https://github.com/Copyleaks/Python-Plagiarism-Checker). Package available via [PyPI](https://pypi.org/project/copyleaks/). --- ## December 24, 2020 Change **Webhook Retry Policy Enhancement** Increased the number of retry attempts when sending system webhooks. Read more in the "Retry Policy" section on the [Webhooks page](/reference/data-types/authenticity/webhooks/overview). - Previous: Up to 12 attempts (2, 4, 8, ..., 4096 seconds) - Updated: Up to 17 attempts (2, 4, ..., 65535 seconds) --- ## December 23, 2020 New **ID Pattern Exclusion** Added new feature to Submit methods: `properties.scanning.exclude.idPattern`. This feature allows exclusion of submissions from results if their ID matches the supplied pattern. Available for all Submit endpoints in both Business and Education APIs. --- ## December 10, 2020 Change **Webhooks Documentation Update** Updated [Webhooks documentation page](/reference/data-types/authenticity/webhooks/overview) with "At-Least-Once Delivery" section. --- ## November 24, 2020 Deprecated **Batch Method Deprecation** The following method is now obsolete: - `PATCH https://api.copyleaks.com/v3/education/batch/start` To compare multiple files, see instructions: [Cross Compare Multiple Files](/reference/actions/miscellaneous/supported-cross-languages). --- ## November 23, 2020 New **Cross Compare Documentation** New article: [Cross Compare Multiple Files](/reference/actions/miscellaneous/supported-cross-languages). --- ## November 2, 2020 New **API Dashboard Launch** Launched new version of the API dashboard. Easily administer scans and visualize API scan results to ensure comprehensive monitoring. --- ## October 25, 2020 Change **Rate Limiting Implementation** Copyleaks API now enforces rate limits for the following methods: - `https://id.copyleaks.com/v3/account/login/api` - Maximum 12 calls per 15 minutes - `https://api.copyleaks.com/v3/education|businesses/scans/{scanId}/webhooks/resend` - Maximum 300 calls per 60 minutes - `https://api.copyleaks.com/v3/education|businesses/usages/history` - Maximum 10 calls per 60 minutes - `https://api.copyleaks.com/v3/businesses/credits` - Maximum 10 calls per 15 minutes Exceeding the maximum number of calls will result in an [HTTP 429](/using-the-apis/rate-limits/#handling-rate-limit-blocks) response code. --- ## October 15, 2020 New **Open Source Plagiarism Report** Launched the Open Source Plagiarism Report. Embed a ready-to-use plagiarism report within your own domain (whitelabel). Read more: [Open Source Plagiarism Report](https://github.com/Copyleaks/plagiarism-report). --- ## October 10, 2020 New **Cheat Detection** Added cheat detection capabilities. To enable this feature, turn on the `properties.cheatDetection` flag in the Submit methods. Available for both Education and Business users. --- ## September 18, 2020 New **Teams Capabilities** Copyleaks V3 API now supports Teams capabilities. Build your own team, invite members, and share credits across multiple users. --- ## September 1, 2020 Deprecated **Download Methods Deprecation** The following methods are now obsolete: - `https://api.copyleaks.com/v3/downloads/{scanId}` - `https://api.copyleaks.com/v3/downloads/{scanId}/results/{resultId}` - `https://api.copyleaks.com/v3/downloads/{scanId}/report.pdf` Use the [Export method](/reference/actions/downloads/overview) instead. --- ## August 7, 2020 New **.NET Core SDK Launch** Launched official SDK for .NET Core: [.NET Core SDK](https://github.com/Copyleaks/.net-core-plagiarism-checker). Package available via [NuGet](https://www.nuget.org/packages/Copyleaks/). --- ## August 5, 2020 New **Sensitive Data Masking** Added Sensitive Data Masking feature to prevent leakage of sensitive data within submitted materials. This feature works on textual content and images; other media types are not covered. For more information, visit the Submit method documentation. --- ## June 25, 2020 New **Reference Exclusion** Copyleaks now supports excluding references from educational plagiarism scans. This text detection algorithm is based on advanced AI capabilities to ensure high success rates. To use this feature, turn on the `properties.exclude.references` flag. --- ## June 1, 2020 New **Private Cloud Hubs** Use Copyleaks to host all your internal documents and compare scans against them. This feature works similarly to the Copyleaks Shared Data Hub but provides private storage accessible only to you. To use this feature, purchase the product hosting plan and use the `properties.scanning.repositories` flag in the Submit method. --- ## May 15, 2020 Change **PDF Reports for Business Users** PDF reports are now available for Business users. To enable this feature, turn on the `properties.pdf.create` flag in the Submit method. --- ## February 28, 2019 New **API Version 3 Launch** API version 3 is now deployed and in production. --- # Reference ## API Reference Source: https://docs.copyleaks.com/reference/overview > Explore the comprehensive Copyleaks API reference, with detailed information about endpoints, data types, and specifications. Explore the comprehensive [Copyleaks API](https://copyleaks.com/api) reference, with detailed information about endpoints, data types, and specifications. Endpoints for submitting scans, checking credits, downloading reports, and more. Detailed information about various data types, supported languages, and other technical details. --- # Actions ## Actions Overview Source: https://docs.copyleaks.com/reference/actions/overview > Explore the Copyleaks API actions for managing scans, detecting AI-generated content, moderating text, and more. Explore the Copyleaks API actions to manage your content integrity and authenticity needs. Each action provides specific functionalities to help you integrate our services effectively. Manage your account and login. Submit scans, check status, and manage results. Check credits and view usage history. Detect AI-generated text. Detect AI-generated images. Search the web for unauthorized copies of an image. Check grammar and get writing feedback. Moderate text for harmful content. Export full scan results to your servers. Get supported file types, languages, and more. Get information about your Private Cloud Hubs. --- # Actions → Account ## Account Actions Source: https://docs.copyleaks.com/reference/actions/account/overview > Learn how to authenticate and get started with Copyleaks APIs import { EndpointRow } from '/snippets/endpoint-row.mdx'; Copyleaks APIs allow you to integrate your systems and services with Copyleaks products. You can start working with a Copyleaks API by sending HTTP requests to the Copyleaks servers. To do so, first register to Copyleaks and get your API key. Then, use your API key and email address to login. ## Authentication API
--- ## Login Source: https://docs.copyleaks.com/reference/actions/account/login > Authenticate with the Copyleaks API using your email and API key ```bash title="cURL" icon="terminal" export COPYLEAKS_EMAIL="your@email.address" export COPYLEAKS_API_KEY="your-api-key-here" curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }" ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks EMAIL_ADDRESS = "your@email.address" API_KEY = "your-api-key-here" auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY) print("Logged successfully!\nToken:", auth_token) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks } = require("plagiarism-checker"); const EMAIL_ADDRESS = "your@email.address"; const API_KEY = "your-api-key-here"; const copyleaks = new Copyleaks(); copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then( (loginResult) => console.log("Access Token:", loginResult.access_token), (err) => { throw err; } ); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; String EMAIL_ADDRESS = "your@email.address"; String API_KEY = "00000000-0000-0000-0000-000000000000"; String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken); ``` ```json 200 OK { "access_token": "ACLNSKNSDAACCAJANCOIUiausoo_saidjaskldjoa...", ".issued": "2018-11-24T16:15:38.2431255+02:00", ".expires": "2018-11-26T16:15:38.2431255+02:00" } ``` Login to the Copyleaks API using your email and API key. Once logged in, you will get back a login token that will be used to authenticate yourself when calling the other API methods. After generating the login-token, you should attach the token for your next calls. Attaching the endpoint is done by adding this header to your calls: ```http Authorization: Bearer TOKEN ``` A generated token is valid for **48 hours**. Within this period of time, you can use it multiple times. Before attaching the `Authorization` header for your next endpoint calls, make sure that the token has not expired. If it expired, generate a new one. The Copyleaks API token should be treated as a password. Attackers, who can gain access to this token, can access your private information and modify it. **12 requests per account/15 minutes** If you exceed the API limit, authentication will be blocked for 5 minutes (Rate Limit Exceeded HTTP 429 - Too Many Requests). ## Request ### Headers ```http Content-Type: application/json Accept: application/json ``` ### Body Your Copyleaks account email address Your Copyleaks account API key (UUID format) ## Responses **200 OK** - The command was executed successfully. ```json { "access_token": "ACLNSKNSDAACCAJANCOIUiausoo_saidjaskldjoa...", ".issued": "2018-11-24T16:15:38.2431255+02:00", ".expires": "2018-11-26T16:15:38.2431255+02:00" } ``` **400 Bad Request** - Invalid request format or missing required fields **401 Unauthorized** - Invalid email or API key **429 Too Many Requests** - Rate limit exceeded (blocked for 5 minutes) --- # Actions → Admin ## Admin Actions Source: https://docs.copyleaks.com/reference/actions/admin/overview > Manage your Copyleaks account, check credits, and view usage history import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks Admin API endpoints allow you to manage account-related operations such as checking your credit balance and viewing your usage history. These endpoints help you monitor and administer your Copyleaks account effectively. ## Endpoints
--- ## Get Credit Balance Source: https://docs.copyleaks.com/reference/actions/admin/check-credits > Get your current credit balance. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/scans/credits \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") balance = Copyleaks.credits_balance(auth_token) print(balance) ``` ```json 200 OK { "Amount": 100 } ``` Get your current credit balance. Each credit allows the scan of up to 250 words. **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 ### Headers ```http Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Responses **200 OK** - The command was executed. ```json { "Amount": 100 } ``` **401 Unauthorized** - Authorization has been denied for this request. --- ## Usage History Source: https://docs.copyleaks.com/reference/actions/admin/usage-history > Get your usage history between two dates. ```bash title="cURL" icon="terminal" curl --request GET \ --url 'https://api.copyleaks.com/v3/scans/usages/history?start=01-01-2020&end=31-01-2020' \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") csv_history = Copyleaks.usages_history_csv(auth_token, "01-01-2020", "31-01-2020") print(csv_history) ``` ```text 200 OK CSV file attached to the response. ``` This endpoint allows you to export your usage history between two dates. The output results will be exported to a csv file and it will be attached to the response. **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 ### Query Parameters The start date to collect usage history from. Format: `dd-MM-yyyy` Example: `01-01-2020` The end date to collect usage history from. Format: `dd-MM-yyyy` Example: `31-01-2020` ### Headers ```http Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Responses **200 OK** - The data was exported. Example: csv file will be attached to the response. **400 Bad Request** - Bad request. Wrong input parameters were provided. **401 Unauthorized** - Authorization has been denied for this request. --- # Actions → Authenticity ## Authenticity Actions Source: https://docs.copyleaks.com/reference/actions/authenticity/overview > Reference for the Copyleaks Authenticity API endpoints to submit, start, and manage plagiarism and AI detection scans. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks Authenticity API allows you to integrate your institution's platform, learning management system or any other e-learning solution with Copyleaks products. ## Endpoints
--- ## Submit File Source: https://docs.copyleaks.com/reference/actions/authenticity/submit-file > Scan files to find where the content has been used elsewhere and check its originality. import ScanSubmitProperties from '/snippets/scan-submit-properties.mdx'; ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/file/my-scan-123 \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "base64": "SGVsbG8gd29ybGQh", "filename": "file.txt", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "sandbox": true } }' ``` ```python title="Python" icon="python" import base64 from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import FileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") with open("file.txt", "rb") as f: b64 = base64.b64encode(f.read()).decode("utf-8") submission = FileDocument(b64, "file.txt") submission.set_properties(ScanProperties( webhooks=SubmitWebhooks(status="https://my-server.com/webhook/{STATUS}"), sandbox=True, )) Copyleaks.submit_file(auth_token, "my-scan-123", submission) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker'); const fs = require('fs'); const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY'); const base64Content = fs.readFileSync('file.txt').toString('base64'); const submission = new CopyleaksFileSubmissionModel(base64Content, 'file.txt', { sandbox: true, webhooks: { status: 'https://my-server.com/webhook/{STATUS}' }, }); await copyleaks.submitFileAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksFileSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.file.*; String authToken = Copyleaks.login("your@email", "API_KEY"); String b64 = Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("file.txt"))); SubmissionWebhooks hooks = new SubmissionWebhooks("https://my-server.com/webhook/{STATUS}"); SubmissionProperties props = new SubmissionProperties(hooks); props.setSandbox(true); Copyleaks.submitFile(authToken, "my-scan-123", new CopyleaksFileSubmissionModel(b64, "file.txt", props)); ``` ```json 201 Created { "scannedDocument": { "scanId": "scan-id32", "totalWords": 2, "totalExcluded": 0, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-05T07:19:08.181236Z", "metadata": { "filename": "file.txt" }, "detectedLanguage": "en" }, "results": { "score": { "aggregatedScore": 50.0, "identicalWords": 1 }, "internet": [ { "url": "http://example.com/", "id": "2a1b402420", "title": "Example Domain" } ] }, "status": 0, "developerPayload": "" } ``` Scan files to find where the content has been used elsewhere and check its originality. Using submit-file you can scan various file types for plagiarism and identify copied content. See [supported formats](/reference/actions/miscellaneous/supported-plagiarism-file-types). **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 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. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` Match pattern: ``[a-z0-9] !@$^&-+%=_(){}<>';:/.",~`|`` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the file to scan. A base64 data string of a file. If you would like to scan plain text, encode it as base64 and submit it. Example: `aGVsbG8gd29ybGQ=` The name of the file as it will appear in the Copyleaks scan report Make sure to include the right extension for your filetype. `<= 255` characters Example: `Myfile.pdf` Configuration options for the scan. For testing purposes, use sandbox mode, which does not consume credits. ## Responses **201 Created** - The scan was successfully created and is now processing. ```json { "scannedDocument": { "scanId": "scan-id32", "totalWords": 2, "totalExcluded": 0, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-05T07:19:08.181236Z", "metadata": { "filename": "file.txt" }, "enabled": { "plagiarismDetection": true, "aiDetection": false, "explainableAi": false, "writingFeedback": false, "pdfReport": true, "cheatDetection": false, "referencesValidation": false, "aiSourceMatch": false, "internalAiSourceMatch": false }, "detectedLanguage": "en" }, "results": { "score": { "identicalWords": 1, "minorChangedWords": 0, "relatedMeaningWords": 0, "aggregatedScore": 50.0 }, "internet": [ { "url": "http://example.com/", "id": "2a1b402420", "title": "Example Domain", "introduction": "Example Domain This domain is for use in illustrative examples in documents. You may use this domain in literature without...", "matchedWords": 1, "identicalWords": 1, "similarWords": 0, "paraphrasedWords": 0, "totalWords": 28, "metadata": { "authors": [] }, "tags": [] } ], "database": [], "batch": [], "repositories": [], "internalAIData": [] }, "notifications": { "alerts": [ { "code": "suspected-ai-text", "title": "Potential AI-Generated Text Detected", "message": "We are unable to verify that the text was written by a human.", "severity": 4, "additionalData": "{\"results\": [{\"classification\": 2, \"probability\": 0.7307997032499992, \"matches\": [ {\"text\": {\"chars\": {\"starts\": [0], \"lengths\": [1453]}, \"words\": {\"starts\": [0], \"lengths\": [230]}}}]}], \"summary\": {\"human\": 0.0, \"ai\": 1.0}, \"modelVersion\": \"v8.0\"}", "category": 2 } ] }, "writingFeedback": { "textStatistics": { "sentenceCount": 5, "averageWordLength": 4.7, "averageSentenceLength": 12.8, "readingTimeSeconds": 21.0, "speakingTimeSeconds": 29.5 }, "score": { "grammarCorrectionsCount": 1, "grammarCorrectionsScore": 93, "grammarScoreWeight": 1.0, "mechanicsCorrectionsCount": 1, "mechanicsCorrectionsScore": 93, "mechanicsScoreWeight": 1.0, "sentenceStructureCorrectionsCount": 1, "sentenceStructureCorrectionsScore": 93, "sentenceStructureScoreWeight": 1.0, "wordChoiceCorrectionsCount": 0, "wordChoiceCorrectionsScore": 100, "wordChoiceScoreWeight": 1.0, "overallScore": 94 }, "readability": { "score": 95, "readabilityLevel": 1, "readabilityLevelText": "5th Grader", "readabilityLevelDescription": "Very easy to read" } }, "status": 0, "developerPayload": "" } ``` **400 Bad Request** - The filename field is required. **401 Unauthorized** - Authentication failed or API key is invalid. **409 Conflict** - A scan with the same Id already exists in the system. **429 Too Many Requests** - Rate limit exceeded. Please retry after the specified time. --- ## Submit URL Source: https://docs.copyleaks.com/reference/actions/authenticity/submit-url > Scan a URL to check for plagiarism, AI-generated content, and writing quality. import ScanSubmitProperties from '/snippets/scan-submit-properties.mdx'; ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/url/my-scan-123 \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://copyleaks.com/ai-detector", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "sandbox": true, "aiGeneratedText": { "detect": true } } }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import UrlDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks from copyleaks.models.submit.properties.ai_generated_text import AIGeneratedText auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") submission = UrlDocument("https://copyleaks.com/ai-detector") submission.set_properties(ScanProperties( webhooks=SubmitWebhooks(status="https://my-server.com/webhook/{STATUS}"), sandbox=True, ai_generated_text=AIGeneratedText(detect=True), )) Copyleaks.submit_url(auth_token, "my-scan-123", submission) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksURLSubmissionModel } = require('plagiarism-checker'); const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY'); const submission = new CopyleaksURLSubmissionModel( 'https://copyleaks.com/ai-detector', { sandbox: true, webhooks: { status: 'https://my-server.com/webhook/{STATUS}' }, aiGeneratedText: { detect: true }, } ); await copyleaks.submitUrlAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import com.copyleaks.sdk.api.Copyleaks; import com.copyleaks.sdk.api.models.submissions.CopyleaksUrlSubmissionModel; import com.copyleaks.sdk.api.models.submissions.properties.*; String authToken = Copyleaks.login("your@email", "API_KEY"); SubmissionWebhooks hooks = new SubmissionWebhooks("https://my-server.com/webhook/{STATUS}"); SubmissionProperties props = new SubmissionProperties(hooks); props.setSandbox(true); SubmissionAIGeneratedText ai = new SubmissionAIGeneratedText(); ai.setDetect(true); props.setAiGeneratedText(ai); Copyleaks.submitUrl(authToken, "my-scan-123", new CopyleaksUrlSubmissionModel("https://copyleaks.com/ai-detector", props)); ``` ```json 201 Created { "scannedDocument": { "scanId": "scan-id23", "totalWords": 42, "totalExcluded": 0, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-05T06:46:31.501305Z", "metadata": {}, "detectedLanguage": "en" }, "results": { "score": { "aggregatedScore": 2.4, "identicalWords": 1 } }, "status": 0, "developerPayload": "" } ``` Submit a URL to be scanned for plagiarism, AI-generated content, and writing analysis. Copyleaks will crawl the URL, extract its content, and scan it against its vast database and the internet. Once submitted, the scan will be processed, and you can monitor its progress using webhooks or by checking the scan status. **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 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. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the URL to scan and a `properties` object to configure the scan. The URL to be scanned. e.g., `https://copyleaks.com` Describes the HTTP method that is going to be executed on the specified url. Supported Values: `GET`, `POST`, `PUT` Custom headers for the request. If specified, no Copyleaks headers are attached (otherwise defaults are used). Use `Set-Cookie` for cookies. Multiple values supported. Example: `[["header-key", "header-value"], ...]` Configuration options for the scan. For testing purposes, use sandbox mode, which does not consume credits. ## Responses **201 Created** - The scan was successfully created and is now processing. ```json { "scannedDocument": { "scanId": "scan-id23", "totalWords": 42, "creationTime": "2025-08-05T06:46:31.501305Z", "detectedLanguage": "en" }, "results": { "score": { "identicalWords": 1, "minorChangedWords": 0, "relatedMeaningWords": 0, "aggregatedScore": 2.4 } }, "status": 0, "developerPayload": "" } ``` **400 Bad Request** - The url field is required. **401 Unauthorized** - Authentication failed or API key is invalid. **409 Conflict** - A scan with the same Id already exists in the system. **429 Too Many Requests** - Rate limit exceeded. ## Next Steps Learn how to use Copyleaks to detect AI-generated text, including from the latest models. Learn how to use Copyleaks to detect plagiarism by comparing your content against billions of online sources and internal documents. Learn how to use Copyleaks to check for grammar mistakes and get suggestions for improving your writing. --- ## Submit OCR Source: https://docs.copyleaks.com/reference/actions/authenticity/submit-ocr > Scan images with textual content to find where the content has been used before and check its originality. import ScanSubmitProperties from '/snippets/scan-submit-properties.mdx'; ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v3/scans/submit/ocr/my-scan-123 \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "base64": "YOUR_BASE64_HERE", "filename": "image.jpg", "langCode": "en", "properties": { "webhooks": { "status": "https://my-server.com/webhook/{STATUS}" }, "sandbox": true } }' ``` ```python title="Python" icon="python" import base64 from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.document import OcrFileDocument from copyleaks.models.submit.properties.scan_properties import ScanProperties from copyleaks.models.submit.properties.submit_webhooks import SubmitWebhooks auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") with open("image.jpg", "rb") as f: b64 = base64.b64encode(f.read()).decode("utf-8") submission = OcrFileDocument(b64, "image.jpg", "en") submission.set_properties(ScanProperties( webhooks=SubmitWebhooks(status="https://my-server.com/webhook/{STATUS}"), sandbox=True, )) Copyleaks.submit_file_ocr(auth_token, "my-scan-123", submission) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksFileOcrSubmissionModel } = require('plagiarism-checker'); const fs = require('fs'); const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY'); const base64Content = fs.readFileSync('image.jpg').toString('base64'); const submission = new CopyleaksFileOcrSubmissionModel( 'en', base64Content, 'image.jpg', { sandbox: true, webhooks: { status: 'https://my-server.com/webhook/{STATUS}' }, } ); await copyleaks.submitFileOcrAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.CopyleaksOcrSubmissionModel; import models.submissions.properties.*; import java.util.Base64; import java.nio.file.*; String authToken = Copyleaks.login("your@email", "API_KEY"); String b64 = Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("image.jpg"))); SubmissionWebhooks hooks = new SubmissionWebhooks("https://my-server.com/webhook/{STATUS}"); SubmissionProperties props = new SubmissionProperties(hooks); props.setSandbox(true); Copyleaks.submitOCR(authToken, "my-scan-123", new CopyleaksOcrSubmissionModel(b64, "image.jpg", "en", props)); ``` ```json 201 Created { "scannedDocument": { "scanId": "scan-id32", "totalWords": 2, "totalExcluded": 0, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-05T07:19:08.181236Z", "metadata": { "filename": "file.jpg" }, "detectedLanguage": "en" }, "results": { "score": { "aggregatedScore": 50.0, "identicalWords": 1 }, "internet": [ { "url": "http://example.com/", "id": "2a1b402420", "title": "Example Domain" } ] }, "status": 0, "developerPayload": "" } ``` Scan images with textual content to find where the content has been used before and check its originality. Using submit-ocr you can scan various image file types for plagiarism and identify infringed content. Only the textual content in the picture will be scanned and not the graphics. See [supported formats](/reference/actions/miscellaneous/supported-plagiarism-file-types). **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 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. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the image file to scan and a `properties` object to configure the scan. A base64 data string of a file. If you would like to scan plain text, encode it as base64 and submit it. Example: `aGVsbG8gd29ybGQ=` The name of the file as it will appear in the Copyleaks scan report. Make sure to include the right extension for your filetype. `<= 255` characters Example: `image.jpg` The language of the text in the image. See [supported languages](/reference/actions/miscellaneous/ocr-supported-languages). Example: `en` Configuration options for the scan. For testing purposes, use sandbox mode, which does not consume credits. ## Responses **201 Created** - The scan was successfully created and is now processing. ```json { "scannedDocument": { "scanId": "scan-id32", "totalWords": 2, "totalExcluded": 0, "credits": 0, "expectedCredits": 1, "creationTime": "2025-08-05T07:19:08.181236Z", "metadata": { "filename": "file.jpg" }, "detectedLanguage": "en" }, "status": 0, "developerPayload": "" } ``` **400 Bad Request** - The filename field is required. **401 Unauthorized** - Authentication failed or API key is invalid. **409 Conflict** - A scan with the same Id already exists in the system. **429 Too Many Requests** - Rate limit exceeded. Please retry after the specified time. --- ## Start Scans Source: https://docs.copyleaks.com/reference/actions/authenticity/start > Start scanning a list of price-checked scans. ```bash title="cURL" icon="terminal" curl --request PATCH \ --url https://api.copyleaks.com/v3/scans/start \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "trigger": ["Your-scan-id-1", "Your-scan-id-2"], "errorHandling": 0 }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.start import Start, StartErrorHandling auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") start = Start() start.set_trigger(["Your-scan-id-1", "Your-scan-id-2"]) start.set_error_handling(StartErrorHandling.CANCEL) Copyleaks.start(auth_token, start) ``` ```json 200 OK { "success": ["Your-scan-id"], "failed": [] } ``` Start scanning all the files you submitted for a price-check. **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 ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the scans to start. A list of scans that you submitted for a check-credits scan and that you would like to submit for a full scan. This array can scan up to 100 submissions. Example: `[ "Your-scan-id-1", "Your-scan-id-2" ]` When set to ignore (ignore = 1) the trigger scans will start running even if some of them are in error mode, when set to cancel (cancel = 0) the request will be cancelled if any error was found. Possible Values: 0 (Cancel), 1 (Ignore). Possible Values: - **0** : Cancel - **1** : Ignore ## Responses **200 OK** - The command was executed. ```json { "success": ["Your-scan-id"], "failed": [] } ``` **400 Bad Request** - Bad request. **401 Unauthorized** - Authorization has been denied for this request. --- ## Delete Scans Source: https://docs.copyleaks.com/reference/actions/authenticity/delete > Delete scans from Copyleaks API. ```bash title="cURL" icon="terminal" curl --request PATCH \ --url https://api.copyleaks.com/v3.1/scans/delete \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "scans": [ { "id": "Your-scan-id-1" }, { "id": "Your-scan-id-2" } ], "purge": false }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.delete import Delete, DeleteScan auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") delete = Delete() delete.set_scans([DeleteScan("Your-scan-id-1"), DeleteScan("Your-scan-id-2")]) delete.set_purge(False) Copyleaks.delete(auth_token, delete) ``` ```json 202 Accepted {} ``` Delete scans from Copyleaks API. Only completed scans can be deleted. All of the scan results, metadata and information will be removed. The delete is performed in the background, the deletion process can take few minutes. **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 ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the scans to delete. The list of scans to delete. `<= 10000` items Example: `[ {"id": "Your-scan-id-1"}, {"id": "Your-scan-id-2"} ]` Deleting and purging a scan through the API will remove all traces of the scan from Copyleaks servers, including Shared Data Hubs and Private Cloud Hubs. Once purged, the scan will be permanently deleted and will not be available for future scans. Allows you to register to a webhook that will be fired once the removal has been completed. Make sure that your endpoint is listening to a POST method (no body parameters were supplied). Example: `https://yoursite.com/webhook/deleted` Adds user specific headers to the request. This is needed in case the webhook endpoint requires any custom headers. Example: `[ [ "header-key", "header-value" ], ... ]` ## Responses **202 Accepted** - The request was placed for removal. Note that this process is asynchronous. This means that the actual removal will take place once one of our servers will be free. In order to get notified after the command execution, register to webhook notification (completionWebhook). **400 Bad Request** - Bad Request. **401 Unauthorized** - Authorization has been denied for this request. --- ## Resend Webhook Source: https://docs.copyleaks.com/reference/actions/authenticity/resend-webhook > Resend webhooks for existing scans. ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v3/scans/my-scan-123/webhooks/resend \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") Copyleaks.resend_webhook(auth_token, "my-scan-123") ``` ```json 202 Accepted {} ``` If for some reason you did not receive the webhook to a specific scan or you are interested in resending a webhook, you can do it using the resend webhook. Simply add the Scan Id of the relevant scan and a webhook will be sent to your endpoint. Use this endpoint to resend webhooks for scan with completed status. Valid statuses: success (completed), failed (error'ed), indexed and price-checked. You cannot send the resend webhook for scans that are still running and processed. **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 The scan id of the scan you would like to resend the webhook for. ### Headers ```http Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Responses **202 Accepted** - The request accepted. The webhook will be sent shortly. **400 Bad Request** - The scan is not ready yet. Therefore, cannot resend webhook. **401 Unauthorized** - Authorization has been denied for this request. **404 Not Found** - No such scan. Check your scanId argument. --- # Actions → AI Text Detector ## AI Text Detection Actions Source: https://docs.copyleaks.com/reference/actions/writer-detector/overview > Detect the writer of a text. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks AI Detector API allows you to predict whether a text was written by a human or an AI. ## Endpoints
--- ## AI Text Detector Source: https://docs.copyleaks.com/reference/actions/writer-detector/check > Differentiate between human-written and AI-written text. ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v2/writer-detector/my-scan-123/check \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "text": "Copyleaks is a comprehensive plagiarism detection platform...", "sandbox": false, "explain": true, "sensitivity": 2 }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") submission = NaturalLanguageDocument("Copyleaks is a comprehensive plagiarism detection platform...") submission.set_sandbox(False) submission.set_explain(True) submission.set_sensitivity(2) response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, "my-scan-123", submission) print(response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksNaturalLanguageSubmissionModel } = require('plagiarism-checker'); const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY'); const submission = new CopyleaksNaturalLanguageSubmissionModel( 'Copyleaks is a comprehensive plagiarism detection platform...' ); submission.sandbox = false; submission.explain = true; submission.sensitivity = 2; await copyleaks.aiDetectionClient.submitNaturalTextAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.aidetection.CopyleaksNaturalLanguageSubmissionModel; String authToken = Copyleaks.login("your@email", "API_KEY"); CopyleaksNaturalLanguageSubmissionModel sub = new CopyleaksNaturalLanguageSubmissionModel( "Copyleaks is a comprehensive plagiarism detection platform..." ); sub.setSandbox(false); sub.setExplain(true); sub.setSensitivity(2); Copyleaks.writerDetectorClient.submitNaturalLanguage(authToken, "my-scan-123", sub); ``` ```json 200 OK { "modelVersion": "v5", "results": [ { "classification": 2, "probability": 1, "matches": [ { "text": { "chars": { "starts": [0], "lengths": [1509] }, "words": { "starts": [0], "lengths": [221] } } } ] } ], "summary": { "human": 0, "ai": 1 }, "scannedDocument": { "scanId": "my-scan-123", "totalWords": 221, "actualCredits": 1, "expectedCredits": 1, "creationTime": "2023-01-10T10:07:58.9459512Z" } } ``` Use Copyleaks AI Content Detection to differentiate between human-written and AI-written text. This endpoint will receive submitted text to be checked. At the end of the processing stage, the result will be shown as classifications. Text classification is divided into sections. Each section may have a different classification. **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 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](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body A text string. `>= 255 characters` `<= 100000 characters` Use sandbox mode to test your integration with the Copyleaks API for free. The language code of your content in ISO-639-1 format. See the full [list of supported languages](/reference/actions/miscellaneous/ai-detection-supported-languages). If the `language` field is not supplied, our system will automatically detect the language of the content. Example: `"en"` Enable AI Logic feature for AI detection. For further information, please check the [AI Logic](/concepts/features/ai-logic) for a detailed breakdown of its structure and usage, and for full AI Detection response please check the [AI Detection Response](/reference/data-types/authenticity/results/ai-detection). Control the behavior of the AI detection. - Detecting content copied directly from an LLM, like ChatGPT or Gemini, without edits. - Detecting content from an LLM with minor changes, like tense adjustments or added words. - Detecting content from an LLM that has been heavily modified using tools or manual edits. `>= 1` `<= 3` ## Responses **200 OK** - The command was executed. ```json { "modelVersion": "v5", "results": [ { "classification": 2, "probability": 1, "matches": [ { "text": { "chars": { "starts": [0], "lengths": [1509] }, "words": { "starts": [0], "lengths": [221] } } } ] } ], "summary": { "human": 0, "ai": 1 } } ``` **400 Bad Request** - Bad request. **401 Unauthorized** - Authorization has been denied for this request. **429 Too Many Requests** - Too many requests have been sent. The request has been rejected. ## Next Steps Learn how to use the AI Detection API to check if content was written by a human or generated by an AI. Understand how AI logic can help you interpret the results of AI text detection. Learn about the webhook that delivers AI detection results. --- ## Get Credit Balance Source: https://docs.copyleaks.com/reference/actions/writer-detector/credits > Get the amount of available credits in your account wallet. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v2/writer-detector/credits \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' ``` ```json 200 OK { "credits": 382 } ``` Get the amount of available credits in your account wallet. **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 ### Headers ```http Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Responses **200 OK** - The command was executed. ```json { "credits": 382 } ``` **401 Unauthorized** - Authorization has been denied for this request. --- # Actions → AI Image Detector ## AI Image Detector Actions Source: https://docs.copyleaks.com/reference/actions/ai-image-detector/overview > Detect whether an image is AI-generated or partially AI-generated. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks AI Image Detection API analyzes whether an image was generated or partially generated by AI, with support for multipart and JSON submission. Both a synchronous and an asynchronous (webhook-based) flow are available. ## Endpoints
--- ## AI Image Detector Source: https://docs.copyleaks.com/reference/actions/ai-image-detector/check > Detect whether an image is AI-generated or partially AI-generated. ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v1/ai-image-detector/my-scan-123/check \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --form 'image=@/path/to/test-image.png' \ --form 'filename=test-image.png' \ --form 'sandbox=true' \ --form 'model=ai-image-1-ultra' ``` ```python title="Python" icon="python" import base64 from copyleaks.copyleaks import Copyleaks from copyleaks.clients.image_detection_client import ImageDetectionClient from copyleaks.models.ai_image_detection import ( CopyleaksAiImageDetectionRequestModel, CopyleaksAiImageDetectionModels, ) auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") with open("test-image.png", "rb") as f: b64 = base64.b64encode(f.read()).decode("utf-8") payload = CopyleaksAiImageDetectionRequestModel( base64=b64, filename="test-image.png", model=CopyleaksAiImageDetectionModels.AI_IMAGE_1_ULTRA, sandbox=True, ) client = ImageDetectionClient() response = client.submit(auth_token, "my-scan-123", payload) print(response) ``` ```javascript title="JavaScript" icon="square-js" const imageFile = document.getElementById('fileInput').files[0]; const formData = new FormData(); formData.append('image', imageFile); formData.append('filename', imageFile.name); formData.append('sandbox', 'true'); formData.append('model', 'ai-image-1-ultra'); const response = await fetch( 'https://api.copyleaks.com/v1/ai-image-detector/my-scan-123/check', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' }, body: formData, } ); const result = await response.json(); ``` ```json 200 OK { "model": "ai-image-1-ultra", "result": { "starts": [0, 512, 1536, 2560], "lengths": [256, 512, 768, 1024] }, "summary": { "human": 0.3, "ai": 0.7 }, "isAiDetected": true, "imageInfo": { "shape": { "height": 1024, "width": 768 }, "metadata": { "issuedTime": "2025-07-23T12:44:05", "issuedBy": "OpenAI", "appOrDeviceUsed": "OpenAI-API", "contentSummary": "Created using generative AI" } }, "scannedDocument": { "scanId": "my-scan-123", "actualCredits": 1, "expectedCredits": 1, "creationTime": "2023-01-10T10:07:58.9459512Z" } } ``` Detect whether an image is AI-generated or partially AI-generated. Returns a detailed analysis with an RLE mask indicating AI-generated regions. AI Image Detection has wrapper support in the **Python SDK** via `ImageDetectionClient`. The JavaScript and Java SDKs don't yet expose a method for this endpoint, so those samples call the HTTP API directly. **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>** Image detection API has a rate limit of **900 requests per 15 minutes** per host. If exceeded, requests will be rejected with a 429 status code until the rate limit window resets. ## Request ### Path Parameters 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. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Supported Content Types Submit images using **multipart/form-data** (recommended) or **JSON with base64**. `multipart/form-data` sends the image file directly without base64 encoding overhead, making it more efficient for large images. Use `application/json` when you need to submit image data as a base64-encoded string. #### Option 1: Multipart/Form-Data (Recommended) **Headers:** ```http Content-Type: multipart/form-data Authorization: Bearer YOUR_LOGIN_TOKEN ``` #### Option 2: JSON with Base64 **Headers:** ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` The `Accept-Encoding: gzip` header enables response compression, reducing bandwidth usage and improving performance. ### Body Parameters The image field used depends on the content type: - **`multipart/form-data`** -> use the `image` field (binary file) - **`application/json`** -> use the `base64` field (base64-encoded string) Binary image file. Required when using `multipart/form-data`. Base64-encoded images are not accepted for multipart requests. **Requirements:** - **Size:** Minimum 512x512px, maximum 6000x4500px (27 megapixels) - **File size:** Less than 32MB - **Formats:** PNG, JPG, JPEG, BMP, WebP, HEIC/HEIF Base64-encoded image data. Required when using `application/json` content type. **Requirements:** - **Size:** Minimum 512x512px, maximum 6000x4500px (27 megapixels) - **File size:** Less than 32MB (before encoding) - **Formats:** PNG, JPG, JPEG, BMP, WebP, HEIC/HEIF The name of the image file including its extension. **Requirements:** - Allowed file extensions: `.png`, `.jpg`, `.jpeg`, `.bmp`, `.webp`, `.heic`, `.heif` - `<= 255 characters` The AI detection model to use for analysis. - AI Image 1 Ultra: `"ai-image-1-ultra"` Use sandbox mode to test your integration with the Copyleaks API without consuming any credits. ## Responses **200 OK** - The image was successfully analyzed. ```json { "model": "ai-image-1-ultra", "result": { "starts": [0, 512, 1536, 2560], "lengths": [256, 512, 768, 1024] }, "summary": { "human": 0.3, "ai": 0.7 }, "isAiDetected": true } ``` **400 Bad Request** - Invalid request parameters, unsupported image format, or image processing issues. **401 Unauthorized** - Authentication or authorization issues. **402 Payment Required** - Insufficient credits. **429 Too Many Requests** - Too many requests have been sent. The request has been rejected. **500 Internal Server Error** - The server encountered an internal error or misconfiguration. --- ## AI Image Detector Async Source: https://docs.copyleaks.com/reference/actions/ai-image-detector/submit > Submit an image URL for AI-generated content detection. Results are delivered asynchronously via webhook. Submit an image URL for AI-generated content detection. The endpoint is **asynchronous** - it returns `201 Created` immediately, and the detection results are delivered to your webhook URL once processing is complete. Use this endpoint when you have a publicly reachable image URL and prefer a fire-and-forget submission. For an immediate, synchronous response with the image uploaded directly in the request, use [AI Image Detection](/reference/actions/ai-image-detector/check) instead. Authentication is required. See [Login](/reference/actions/account/login) for how to obtain a bearer token. This is a new endpoint and the official Copyleaks SDKs (Python, JavaScript, Java, C#, PHP, Ruby) don't yet expose a wrapper method for the async flow. The code samples below call the HTTP API directly. SDK support is planned - until then, use the raw HTTP pattern. ## Path parameters A unique scan id provided by you. We recommend using the same id in your database to represent the scan in the Copyleaks database - this helps debug incidents and avoid duplicate scans for the same image. See [criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters`   `<= 36 characters` Match pattern: ``[a-z0-9] !@$^&-+%=_(){}<>';:/.",~`|`` ## Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Body parameters Publicly accessible URL of the image file to analyze. Example: `"https://example.com/my-image.png"` The name of the image file including its extension. **Supported extensions:** `.jpg`, `.jpeg`, `.png`, `.webp`, `.tiff`, `.bmp`, `.heic`, `.heif` Example: `"image1.png"` The AI image detection model to use for analysis. - AI Image 1 Ultra: `"ai-image-1-ultra"` Example: `"ai-image-1-ultra"` The type of detection overlay to return alongside the detection result. Use this when you want a pixel-level visualization of which regions of the image were flagged as AI-generated. Supported values: - `"heatmap"` - gradient overlay highlighting AI-generated regions with intensity proportional to confidence. Example: `"heatmap"` Optional custom headers to include when Copyleaks fetches the image from the provided `url`. Each entry is a two-element array: `["Header-Name", "Header-Value"]`. Example: `[["X-Custom-Auth", "my-token"]]` Webhook configuration for receiving the async results. The URL that Copyleaks will POST the detection results to when processing is complete. Example: `"https://your-server.com/webhook/receive-results"` Optional custom headers to include in the webhook request. Each entry is a two-element array: `["Header-Name", "Header-Value"]`. Example: `[["Authorization", "Bearer my-webhook-token"]]` Use sandbox mode to test your integration with the [Copyleaks API](https://copyleaks.com/api) without consuming any credits. Submit images for AI detection and receive mock results simulating the API. Intended for development purposes only. An optional string payload that Copyleaks will include in the webhook response, allowing you to correlate the callback with your internal data. Example: `"order-id-12345"` ```bash title="cURL" icon="terminal" curl --request PUT \ --url https://api.copyleaks.com/v1/ai-image-detector-async/my-image-scan-1/submit \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/image1.png", "fileName": "image1.png", "model": "ai-image-1-ultra", "maskType": "heatmap", "webhooks": { "url": "https://your-server.com/webhook/receive-results" } }' ``` ```python title="Python" icon="python" import requests url = 'https://api.copyleaks.com/v1/ai-image-detector-async/my-image-scan-1/submit' headers = { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' } payload = { 'url': 'https://example.com/image1.png', 'fileName': 'image1.png', 'model': 'ai-image-1-ultra', 'maskType': 'heatmap', 'webhooks': { 'url': 'https://your-server.com/webhook/receive-results' } } response = requests.put(url, json=payload, headers=headers) print(f"Submission status: {response.status_code}") # 201 Created ``` ```javascript title="JavaScript" icon="square-js" const response = await fetch( 'https://api.copyleaks.com/v1/ai-image-detector-async/my-image-scan-1/submit', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://example.com/image1.png', fileName: 'image1.png', model: 'ai-image-1-ultra', maskType: 'heatmap', webhooks: { url: 'https://your-server.com/webhook/receive-results' } }) } ); console.log('Submission status:', response.status); // 201 Created ``` ```http title="HTTP" icon="globe" PUT https://api.copyleaks.com/v1/ai-image-detector-async/my-image-scan-1/submit Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "url": "https://example.com/image1.png", "fileName": "image1.png", "model": "ai-image-1-ultra", "maskType": "heatmap", "webhooks": { "url": "https://your-server.com/webhook/receive-results" } } ``` ```json 201 Created {} ``` ```json 400 Bad Request { "error": "Invalid request parameters." } ``` ```json 401 Unauthorized { "error": "Authentication or authorization failed." } ``` ```json 402 Payment Required { "error": "Insufficient credits." } ``` ```json 429 Too Many Requests { "error": "Rate limit exceeded." } ``` ```json 500 Internal Server Error { "error": "The server encountered an internal error." } ``` ## Webhook payload When processing completes, Copyleaks sends a `POST` request to your webhook URL with the detection results. The payload follows the same shape as the synchronous [AI Image Detection](/reference/actions/ai-image-detector/check) response. --- # Actions → Image Plagiarism Detector ## Image Plagiarism Detector Actions Source: https://docs.copyleaks.com/reference/actions/image-plagiarism-detector/overview > Search the web for unauthorized copies of an image. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks Image Plagiarism Detection API searches the web for copies of a submitted image, returning categorized matches - full matches and partial matches, each with the web pages where the image was found - in a single synchronous call. ## Endpoints
--- ## Image Plagiarism Detection Source: https://docs.copyleaks.com/reference/actions/image-plagiarism-detector/check > Search the web for unauthorized copies of an image. ```bash cURL curl --request POST \ --url https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --form 'image=@/path/to/my-photo.jpg' \ --form 'filename=my-photo.jpg' \ --form 'sandbox=false' ``` ```python Python import requests url = 'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check' headers = {'Authorization': 'Bearer YOUR_LOGIN_TOKEN'} with open('my-photo.jpg', 'rb') as image_file: files = {'image': ('my-photo.jpg', image_file, 'image/jpeg')} data = {'filename': 'my-photo.jpg', 'sandbox': 'false'} response = requests.post(url, files=files, data=data, headers=headers) result = response.json() print(f"Total matches: {result['matches']['score']['totalMatches']}") print(f"Full matches: {result['matches']['score']['fullMatches']}") print(f"Partial matches: {result['matches']['score']['partialMatches']}") ``` ```javascript JavaScript const imageFile = document.getElementById('fileInput').files[0]; const formData = new FormData(); formData.append('image', imageFile); formData.append('filename', imageFile.name); formData.append('sandbox', 'false'); const response = await fetch( 'https://api.copyleaks.com/v1/image-plagiarism-detector/my-scan-1/check', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN' }, body: formData, } ); const result = await response.json(); console.log('Total matches:', result.matches.score.totalMatches); console.log('Matches:', result.matches.internet); ``` ```json 200 OK { "developerPayload": "my-custom-data", "scannedImage": { "scanId": "my-scan-1", "expectedCredits": 1, "actualCredits": 1, "creationTime": "2026-05-24T10:00:00Z", "width": 1920, "height": 1080, "filename": "my-photo.jpg" }, "matches": { "internet": [ { "url": "https://example.com/images/photo.jpg", "matchType": 0, "webPages": [ { "url": "https://example.com/blog/my-post" }, { "url": "https://example.org/news/article" } ] }, { "url": "https://example.com/thumbs/photo-thumb.jpg", "matchType": 1, "webPages": [ { "url": "https://example.org/gallery" } ] }, { "url": "https://example.org/gallery/photo-sm.jpg", "matchType": 1 } ], "score": { "totalMatches": 3, "fullMatches": 1, "partialMatches": 2 } } } ``` Search the web for copies of an image. Returns a list of full matches (exact or near-exact copies) and partial matches (cropped, resized, or modified versions), each with the web pages where the image was found - all in a single synchronous API call. **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>** Image Plagiarism Detection has a rate limit of **1,800 requests per 15 minutes** per user. If exceeded, requests will be rejected with a 429 status code until the rate limit window resets. ## Request ### Path Parameters A unique scan ID provided by you. We recommend you use the same ID in your database to represent the scan. Using the same ID for the same file helps avoid duplicate scans caused by network issues. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Supported Content Type Submit images using **multipart/form-data**. **Headers:** ```http Content-Type: multipart/form-data Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Body Parameters Binary image file to check for plagiarism. **Requirements:** - **File size:** Less than 20MB - **Max resolution:** 75 megapixels (width × height ≤ 75,000,000) - **Formats:** JPG, JPEG, PNG, GIF, BMP, WebP, RAW, ICO The name of the image file including its extension. **Requirements:** - Allowed extensions: `.jpg`, `.jpeg`, `.png`, `.gif`, `.bmp`, `.webp`, `.ico` - `<= 255 characters` Example: `"my-photo.jpg"` Use sandbox mode to test your integration without consuming credits. Returns mock results. An optional custom string you can attach to the request. It is echoed back unchanged in the response under `developerPayload`. Useful for correlating results with your own records. ## Responses **200 OK** The image was successfully analyzed. See the [Image Plagiarism Response](/reference/data-types/authenticity/results/image-plagiarism-response) for the full response structure. ```json { "developerPayload": null, "scannedImage": { "scanId": "my-scan-1", "expectedCredits": 1, "actualCredits": 1, "creationTime": "2026-05-24T10:00:00Z", "width": 1920, "height": 1080, "filename": "my-photo.jpg" }, "matches": { "internet": [ { "url": "https://example.com/images/photo.jpg", "matchType": 0, "webPages": [ { "url": "https://example.com/blog/my-post" } ] }, { "url": "https://example.com/thumbs/photo.jpg", "matchType": 1 } ], "score": { "totalMatches": 2, "fullMatches": 1, "partialMatches": 1 } } } ``` **400 Bad Request** Invalid request parameters, unsupported file format, or image validation failure (e.g. file too large, resolution too high, corrupt file). **401 Unauthorized** Authentication or authorization issues. **402 Payment Required** Insufficient credits. **429 Too Many Requests** Rate limit exceeded. The request has been rejected. **500 Internal Server Error** The server encountered an internal error. --- # Actions → AI Video Detector ## AI Video Detector Actions Source: https://docs.copyleaks.com/reference/actions/ai-video-detector/overview > Detect AI-generated content in videos via an async submit-and-webhook flow. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks AI Video Detection API analyzes whether a video was generated or partially generated by AI. Submit a video URL and receive granular audio and visual analysis via webhook when processing completes. Submit a video and inspect the webhook response without writing code. Opens in a new tab. ## Endpoints
--- ## AI Video Detection Source: https://docs.copyleaks.com/reference/actions/ai-video-detector/submit > Submit a video URL for AI-generated content detection. Results are delivered asynchronously via webhook. Submit a video URL for AI-generated content detection. The endpoint is **asynchronous** - it returns `201 Created` immediately, and the detection results are delivered to your webhook URL once processing is complete. Authentication is required. See [Login](/reference/actions/account/login) for how to obtain a bearer token. **Try it without writing code** - open the [Video Detection Playground](https://api.copyleaks.com/dashboard/playground/video-detection) to submit a sample video and inspect the webhook response in your browser. AI Video Detection is a new endpoint and the official Copyleaks SDKs (Python, JavaScript, Java, C#, PHP, Ruby) don't yet expose a wrapper method. The code samples below call the HTTP API directly. SDK support is planned - until then, use the raw HTTP pattern. ## Path parameters A unique scan id provided by you. We recommend using the same id in your database to represent the scan in the Copyleaks database - this helps debug incidents and avoid duplicate scans for the same file. See [criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters`   `<= 36 characters` Match pattern: ``[a-z0-9] !@$^&-+%=_(){}<>';:/.",~`|`` ## Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Body parameters Publicly accessible URL of the video file to analyze. Example: `"https://example.com/my-video.mp4"` Optional custom headers to include when Copyleaks fetches the video from the provided `url`. Each entry is a two-element array: `["Header-Name", "Header-Value"]`. Example: `[["X-Custom-Auth", "my-token"]]` Describes the HTTP method that is going to be executed on the specified `url`. Supported values: `GET`, `POST`, `PUT`. The name of the video file including its extension. **Requirements:** - Must include a supported video extension - `<= 255 characters` **Supported extensions:** `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.mpg`, `.m4v`, `.3gp`, `.mxf` Example: `"my-video.mp4"` The AI detection model to use for analysis. - AI Video 1 Pro: `"ai-video-1-pro"` Example: `"ai-video-1-pro"` Webhook configuration for receiving the async results. The URL that Copyleaks will POST the detection results to when processing is complete. Example: `"https://your-server.com/webhook/receive-results"` Optional custom headers to include in the webhook request. Each entry is a two-element array: `["Header-Name", "Header-Value"]`. Example: `[["Authorization", "Bearer my-webhook-token"]]` Use sandbox mode to test your integration with the [Copyleaks API](https://copyleaks.com/api) without consuming any credits. Submit videos for AI detection and receive mock results simulating the API. Intended for development purposes only. An optional string payload that Copyleaks will include in the webhook response, allowing you to correlate the callback with your internal data. Example: `"order-id-12345"` For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results. ### Video requirements **Returned as `400 Bad Request` at submit (synchronous):** - Missing or invalid `scanId`, `filename`, `url`, `model`, or `webhooks` - Unsupported file extension - Filename longer than 255 characters - Invalid `verb` value **Delivered to your webhook as an error result (asynchronous, after download):** - Duration outside 2 seconds-1 hour → `video_too_short` (67) / `video_too_long` (68) - File larger than 512 MiB → `file_too_large` (6) - Resolution below 360×360 → `video_resolution_too_low` (65) - Frame rate below 16 FPS → `fps_too_low` (66) - Undecodable codec → `unsupported_video_codec` (71) - Corrupt or truncated file → `video_truncated` (70) - Generic decode failure → `video_load_failed` (72) ## Webhook payload When processing completes, Copyleaks sends a `POST` request to your webhook URL with the detection results. See [AI Video Detection Response](/reference/data-types/ai-detector/ai-video-detection-response) for the complete field reference. ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/my-video.mp4", "filename": "my-video.mp4", "model": "ai-video-1-pro", "sandbox": true, "webhooks": { "url": "https://your-server.com/webhook/receive-results" } }' ``` ```python title="Python" icon="python" import requests url = 'https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit' headers = { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' } payload = { 'url': 'https://example.com/my-video.mp4', 'filename': 'my-video.mp4', 'model': 'ai-video-1-pro', 'sandbox': True, 'webhooks': { 'url': 'https://your-server.com/webhook/receive-results' } } response = requests.post(url, json=payload, headers=headers) print(f"Submission status: {response.status_code}") # 201 Created ``` ```javascript title="JavaScript" icon="square-js" const response = await fetch( 'https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_LOGIN_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://example.com/my-video.mp4', filename: 'my-video.mp4', model: 'ai-video-1-pro', sandbox: true, webhooks: { url: 'https://your-server.com/webhook/receive-results' } }) } ); console.log('Submission status:', response.status); // 201 Created ``` ```http title="HTTP" icon="globe" POST https://api.copyleaks.com/v1/ai-video-detector/my-video-scan-1/submit Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN { "url": "https://example.com/my-video.mp4", "filename": "my-video.mp4", "model": "ai-video-1-pro", "sandbox": true, "webhooks": { "url": "https://your-server.com/webhook/receive-results" } } ``` ```json 201 Created {} ``` ```json 400 Bad Request { "error": "Invalid request parameters." } ``` ```json 401 Unauthorized { "error": "Authentication or authorization failed." } ``` ```json 402 Payment Required { "error": "Insufficient credits." } ``` ```json 429 Too Many Requests { "error": "Rate limit exceeded." } ``` ```json 500 Internal Server Error { "error": "The server encountered an internal error." } ``` ## Example webhook delivery ```json { "model": "ai-video-1-pro", "audioResult": { "starts": [13000, 45000, 47000], "lengths": [14000, 1000, 8700], "exclude": { "starts": [0, 3250, 5400, 7600, 10500], "lengths": [2950, 1500, 1200, 650, 1050] } }, "visualResult": { "starts": [11566, 29433], "lengths": [6134, 26267], "exclude": { "starts": [], "lengths": [] } }, "summary": { "audioAIRatio": 0.4902, "visualAIRatio": 0.5817, "overallAIRatio": 0.7487 }, "videoInfo": { "metadata": { "issuedTime": "2026-03-17T13:14:57+00:00", "issuedBy": "OpenAI", "appOrDeviceUsed": "Sora", "contentSummary": "Created using generative AI" }, "duration": 55.7 }, "scannedVideo": { "scanId": "my-video-scan-1", "actualCredits": 1, "expectedCredits": 1, "creationTime": "2026-05-05T12:37:50Z" } } ``` --- # Actions → Downloads ## Downloads Actions Source: https://docs.copyleaks.com/reference/actions/downloads/overview > Download your scan reports. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks downloads API allows you to download your scan reports. ## Endpoints
--- ## Export Source: https://docs.copyleaks.com/reference/actions/downloads/export > Export the full raw scan information and push it to your servers. import ExportRequestBody from '/snippets/export-request-body.mdx'; ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v3/downloads/my-scan-123/export/my-export-1 \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "results": [ { "id": "my-result-id", "verb": "POST", "headers": [["header-key", "header-value"]], "endpoint": "https://yourserver.com/export/export-id/results/my-result-id" } ], "pdfReport": { "verb": "POST", "endpoint": "https://yourserver.com/export/export-id/pdf-report" }, "crawledVersion": { "verb": "POST", "endpoint": "https://yourserver.com/export/export-id/crawled-version" }, "completionWebhook": "https://yourserver.com/export/export-id/completed", "maxRetries": 3 }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.export import Export, ExportResult, ExportPdf, ExportCrawledVersion auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") result = ExportResult() result.set_id("my-result-id") result.set_endpoint("https://yourserver.com/export/export-id/results/my-result-id") result.set_verb("POST") pdf = ExportPdf() pdf.set_endpoint("https://yourserver.com/export/export-id/pdf-report") pdf.set_verb("POST") crawled = ExportCrawledVersion() crawled.set_endpoint("https://yourserver.com/export/export-id/crawled-version") crawled.set_verb("POST") export = Export() export.set_results([result]) export.set_pdf_report(pdf) export.set_crawled_version(crawled) export.set_completion_webhook("https://yourserver.com/export/export-id/completed") export.set_max_retries(3) Copyleaks.export(auth_token, "my-scan-123", "my-export-1", export) ``` ```json 204 No Content {} ``` One of the most common patterns when integrating with our services is to submit a scan and download the full results as soon as the scan is completed. When the scan is completed, Copyleaks triggers a 'Completed' webhook to inform that the scan has been completed. At this point, you will have all the needed information (i.e. the 'result ids') to download and present the reports on your side. Since you may have a large number of documents to download (the results, crawled version of the text and the pdf-report), you may need to send many HTTP REST calls to execute to export the data from our services. The 'Export' method makes this process easier by specifying the content you would like to export in a single call, and we will copy all the data according to your request. Then, we will fire an 'export-completed' webhook with the export results summary. If you are using a distributed cloud storage system (like AWS buckets, Google buckets or Azure Storage), we can export the data directly to your storage without the involvement of your servers. To do so, create a Signed URL for each data item that you would like to export. By specifying the request method (verb) and optionally added headers, the writing to this storage will be triggered, as per your definition. **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 A new Id for the export process. `>= 3 characters` `<= 36 characters` The scan ID of the specific scan to export. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the export configuration. ## Responses **204 No Content** - The command was executed. The export started. **400 Bad Request** - Bad request. One or more details in your request is wrong. **401 Unauthorized** - Authorization has been denied for this request. **404 Not Found** - The scan id that was specified doesn't exist. **409 Conflict** - Conflict. An export task with the same Id already exists in the system. ## Next Steps Learn about the different types of webhooks and how to handle them, including export completion webhooks. Understand the details provided in the export completed webhook. Learn how to present exported scan data to your users. --- # Actions → Miscellaneous ## Miscellaneous Actions Source: https://docs.copyleaks.com/reference/actions/miscellaneous/overview > Get information about supported file types, languages, and more. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks miscellaneous API allows you to get information about supported file types, languages, and more. ## Endpoints
--- ## AI Detection Supported Languages Source: https://docs.copyleaks.com/reference/actions/miscellaneous/ai-detection-supported-languages > The 30 languages supported by the Copyleaks AI Content Detector, with ISO-639-1 codes. Omit the language field and the API auto-detects it. Get a list of the supported languages for AI Content Detection. This is a list of languages supported by the AI Content Detector. If the `language` field is not supplied, our system will automatically detect the language of the content. ## AI Detection Supported Languages These are the language codes supported by our AI Content Detection, in `ISO-639-1` standard: | Language | Code | | :------------------------ | :--------- | | English | `en` | | Spanish | `es` | | French | `fr` | | Portuguese | `pt` | | German | `de` | | Italian | `it` | | Russian | `ru` | | Polish | `pl` | | Romanian | `ro` | | Dutch | `nl` | | Swedish | `sv` | | Czech | `cs` | | Norwegian | `no` | | Korean | `ko` | | Japanese | `ja` | | Chinese (Simplified) | `zh-CN` | | Chinese (Traditional) | `zh-TW` | | Arabic | `ar` | | Bengali | `bn` | | Bulgarian | `bg` | | Croatian | `hr` | | Greek | `el` | | Hebrew | `he` | | Hindi | `hi` | | Hungarian | `hu` | | Serbian | `sr` | | Thai | `th` | | Turkish | `tr` | | Ukrainian | `uk` | | Vietnamese | `vi` | ## Frequently asked questions ### How many languages does the Copyleaks AI Detector support? The AI Content Detector supports 30 languages, each identified by its ISO-639-1 code (for example `en`, `es`, `fr`, `zh-CN`). ### Do I have to specify the language for AI detection? No. If you omit the `language` field, Copyleaks automatically detects the language of the submitted content. Set `language` only when you want to force a specific one. ### What language code format does the API use? ISO-639-1 two-letter codes. Chinese is the exception, using `zh-CN` for Simplified and `zh-TW` for Traditional. ### Does the AI Detector support Chinese, Arabic, and Hebrew? Yes. It supports Chinese (Simplified `zh-CN` and Traditional `zh-TW`), Arabic (`ar`), and Hebrew (`he`), among the 30 supported languages. --- ## OCR Supported Languages Source: https://docs.copyleaks.com/reference/actions/miscellaneous/ocr-supported-languages > Get the list of languages the Copyleaks OCR engine supports for extracting text from images and scanned documents. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/miscellaneous/ocr-languages-list ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks # Public endpoint no authentication required. languages = Copyleaks.ocr_supported_langauges() print(languages) ``` ```json 200 OK ["af", "sq", "az", "...", "zu"] ``` Get a list of the supported languages for OCR This is not a list of supported languages for the API, but only for the OCR files scan ## Response **200 OK** - The supported language codes in ISO-639-1 standard. ```json ["af", "sq", "az", "...", "zu"] ``` --- ## OCR Supported Languages These are the language codes supported by our OCR scan in `ISO-639-1` standard: We keep updating the list with new languages so we recommend [loading the list in runtime](/reference/actions/miscellaneous/ocr-supported-languages) rather than copying it to your code. | Code | Language | Code | Language | |--------|---------------|--------|---------------| | af | Afrikaans | am | Amharic | | ar | Arabic | az | Azerbaijani | | be | Belarusian | bg | Bulgarian | | bn | Bengali | bs | Bosnian | | ca | Catalan | ceb | Cebuano | | co | Corsican | cs | Czech | | cy | Welsh | da | Danish | | de | German | el | Greek | | en | English | eo | Esperanto | | es | Spanish | et | Estonian | | eu | Basque | fa | Persian | | fi | Finnish | fr | French | | fy | Frisian | ga | Irish | | gd | Scottish Gaelic | gl | Galician | | gu | Gujarati | ha | Hausa | | haw | Hawaiian | hi | Hindi | | hmn | Hmong | hr | Croatian | | ht | Haitian Creole | hu | Hungarian | | hy | Armenian | id | Indonesian | | ig | Igbo | is | Icelandic | | it | Italian | iw | Hebrew | | ja | Japanese | jw | Javanese | | ka | Georgian | kk | Kazakh | | km | Khmer | kn | Kannada | | ko | Korean | ku | Kurdish | | ky | Kyrgyz | la | Latin | | lb | Luxembourgish | lo | Lao | | lt | Lithuanian | lv | Latvian | | ma | Marathi | mg | Malagasy | | mi | Maori | mk | Macedonian | | ml | Malayalam | mn | Mongolian | | mr | Marathi | ms | Malay | | mt | Maltese | my | Burmese | | ne | Nepali | nl | Dutch | | no | Norwegian | ny | Chichewa | | pl | Polish | ps | Pashto | | pt | Portuguese | ro | Romanian | | ru | Russian | sd | Sindhi | | si | Sinhala | sk | Slovak | | sl | Slovenian | sm | Samoan | | sn | Shona | so | Somali | | sq | Albanian | sr | Serbian | | st | Sesotho | su | Sundanese | | sv | Swedish | sw | Swahili | | ta | Tamil | te | Telugu | | tg | Tajik | th | Thai | | tl | Tagalog | tr | Turkish | | uk | Ukrainian | ur | Urdu | | uz | Uzbek | vi | Vietnamese | | xh | Xhosa | yi | Yiddish | | yo | Yoruba | zh-CN | Chinese (Simplified) | | zh-TW | Chinese (Traditional) | zu | Zulu | ## Frequently asked questions ### What are OCR supported languages used for? They apply only to OCR scans, where Copyleaks extracts text from images and scanned documents. This is not the general language list for plagiarism or AI detection. ### How do I get the current list of OCR languages? Call `GET https://api.copyleaks.com/v3/miscellaneous/ocr-languages-list`. It is a public endpoint that needs no authentication. Copyleaks keeps adding languages, so load the list at runtime instead of hardcoding it. ### What language code format does OCR use? ISO-639-1 codes (for example `en`, `fr`, `ar`), with `zh-CN` for Simplified Chinese and `zh-TW` for Traditional Chinese. ### Does OCR support non-Latin scripts like Arabic, Chinese, and Hindi? Yes. The OCR engine supports 100+ languages, including Arabic (`ar`), Chinese (`zh-CN`, `zh-TW`), Hindi (`hi`), Japanese (`ja`), Korean (`ko`), and many more. --- ## Supported AI Text Detection File Types Source: https://docs.copyleaks.com/reference/actions/miscellaneous/supported-ai-text-detection-file-types > File formats accepted by the API ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/miscellaneous/supported-ai-text-detection-file-types ``` ```json 200 OK { "supportedAiFileTypes": [ "pdf", "docx", "doc", "txt", "rtf", "xml", "pptx", "ppt", "odt", "chm", "epub", "odp", "ppsx", "pages", "xlsx", "xls", "csv", "LaTeX", "html", "htm" ] } ``` Get a list of the Supported AI Text Detection File Types. ## Response **200 OK** - The command was executed. ```json { "supportedAiFileTypes": [ "pdf", "docx", "doc", "txt", "rtf", "xml", "pptx", "ppt", "odt", "chm", "epub", "odp", "ppsx", "pages", "xlsx", "xls", "csv", "LaTeX", "html", "htm" ] } ``` --- ## Cross-Language Plagiarism Source: https://docs.copyleaks.com/reference/actions/miscellaneous/supported-cross-languages > Get the source and target languages supported for cross-language plagiarism detection with the Copyleaks API. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/miscellaneous/allowed-cross-languages ``` ```json 200 OK { "documentLanguages": ["da", "nl", "en", "...", "es"], "resultLanguages": ["sq", "bg", "my", "ca", "hr", "cs", "da", "...", "vi"] } ``` Cross-language plagiarism detection identifies content that has been translated from one language to another, helping catch plagiarism attempts where text is copied and translated to avoid detection. This document provides information about the languages supported by Copyleaks for cross-language scans. The language codes are provided in the `ISO-639-1` standard. ## Response **200 OK** - The supported language codes in `ISO-639-1` standard. ```json { "documentLanguages": [ "da", "nl", "en", "...", "es" ], "resultLanguages": [ "sq", "bg", "my", "ca", "hr", "cs", "da", "...", "vi" ] } ``` ## Supported Languages for Cross-Language Scans The following sections list the supported source and result languages for cross-language scans. These language codes are provided in the `ISO-639-1` standard. We keep updating the list with new languages so we recommend [loading the list in runtime](/reference/actions/miscellaneous/supported-cross-languages) rather than copying it to your code. ### Allowed Source Languages The following languages can be used as the source language in a cross-language scan: | Code | Language | Code | Language | |------|-----------|------|-----------| | da | Danish | fr | French | | nl | Dutch | de | German | | en | English | it | Italian | | pt | Portuguese| ru | Russian | | es | Spanish | | | ### Allowed Result Languages The following languages can be used as the result language in a cross-language scan: | Code | Language | Code | Language | |------|------------|------|------------| | sq | Albanian | gl | Galician | | bg | Bulgarian | ka | Georgian | | ca | Catalan | de | German | | hr | Croatian | el | Greek | | cs | Czech | hi | Hindi | | da | Danish | hu | Hungarian | | nl | Dutch | id | Indonesian | | en | English | it | Italian | | fi | Finnish | lv | Latvian | | fr | French | lt | Lithuanian | | mk | Macedonian | my | Burmese | | fa | Persian | pl | Polish | | pt | Portuguese | ro | Romanian | | ru | Russian | sr | Serbian | | sk | Slovak | sl | Slovenian | | es | Spanish | sv | Swedish | | tr | Turkish | uk | Ukrainian | | ur | Urdu | vi | Vietnamese | --- ## Supported Plagiarism File Types Source: https://docs.copyleaks.com/reference/actions/miscellaneous/supported-plagiarism-file-types > File formats accepted by the API ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/miscellaneous/supported-plagiarism-file-types ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks # Public endpoint no authentication required. file_types = Copyleaks.supported_file_types() print(file_types) ``` ```json 200 OK { "textual": [ "pdf", "docx", "doc", "txt", "rtf", "xml", "pptx", "ppt", "odt", "chm", "epub", "odp", "ppsx", "pages", "xlsx", "xls", "csv", "LaTeX" ], "ocr": ["gif", "png", "bmp", "jpg", "jpeg"] } ``` Get a list of the supported plagiarism file types. ## Response **200 OK** - The command was executed. ```json { "textual": [ "pdf", "docx", "doc", "txt", "rtf", "xml", "pptx", "ppt", "odt", "chm", "epub", "odp", "ppsx", "pages", "xlsx", "xls", "csv", "LaTeX" ], "ocr": ["gif", "png", "bmp", "jpg", "jpeg"] } ``` --- # Actions → Private Cloud Hub ## Private Cloud Hub Actions Source: https://docs.copyleaks.com/reference/actions/private-cloud-hub/overview > Manage your Private Cloud Hubs. import { EndpointRow } from '/snippets/endpoint-row.mdx'; A **Private Cloud Hub** is a private database exclusive to your organization, your documents are indexed into it and stay within your private environment, making them available for cross-comparison against future scans without ever being exposed to other Copyleaks customers. You can create and manage your hubs from the [admin dashboard](https://admin.copyleaks.com/repositories). The endpoints below let you inspect and manage hub metadata programmatically for end-to-end usage (indexing documents, scanning against a hub), see the [Data Hubs concept guide](/concepts/features/data-hubs). ## Endpoints
--- ## Get Repository Information Source: https://docs.copyleaks.com/reference/actions/private-cloud-hub/info > Get repository information such as credit consumption, metadata values and current status. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v3/repositories/repository/my-repo-123/info \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' ``` ```json 200 OK { "id": "private-data-hub-id", "name": "Private Data Hub Name", "description": "Your Description", "permission": 4, "status": 0, "maxCredits": 1000, "currentCredits": 1000, "maskingPolicy": 0, "creationTime": "2024-09-09T10:43:52" } ``` Get repository information such as credit consumption, metadata values and current status. A "Super Admin" or "Admin" role is required. **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 The repository ID to get the info for. The repository ID can be fetched from the [Copyleaks Admin Dashboard](https://admin.copyleaks.com/repositories). ### Headers ```http Authorization: Bearer YOUR_LOGIN_TOKEN ``` ## Responses **200 OK** - The command was executed. ```json { "id": "private-data-hub-id", "name": "Private Data Hub Name", "description": "Your Description", "permission": 4, "status": 0, "maxCredits": 1000, "currentCredits": 1000, "maskingPolicy": 0, "creationTime": "2024-09-09T10:43:52" } ``` **400 Bad Request** - Bad Request. **401 Unauthorized** - Authorization has been denied for this request. **403 Forbidden** - Your organization role does not permit you to perform this request. This operation requires "Super Admin" or "Admin" role. --- # Actions → Text Moderation ## Text Moderation Actions Source: https://docs.copyleaks.com/reference/actions/text-moderation/overview > Moderate text for harmful content. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks text moderation API allows you to moderate text for harmful content. ## Endpoints
--- ## Moderate Text Source: https://docs.copyleaks.com/reference/actions/text-moderation/check > Instantly flag hateful, explicit, toxic, or otherwise risky content in any text. ```bash title="cURL" icon="terminal" 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" } ] }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.TextModeration.Requests.CopyleaksTextModerationRequestModel import CopyleaksTextModerationRequestModel auth_token = Copyleaks.login("your@email.address", "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) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksTextModerationRequestModel } = require('plagiarism-checker'); 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' }, ], }); await copyleaks.textModerationClient.submitTextAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.request.TextModeration.CopyleaksTextModerationRequest; import models.request.TextModeration.Label; String authToken = Copyleaks.login("your@email", "API_KEY"); CopyleaksTextModerationRequest req = new CopyleaksTextModerationRequest( "Your text content to be moderated goes here.", true, "en", new Label[] { new Label("toxic-v1"), new Label("profanity-v1"), new Label("hate-speech-v1"), } ); Copyleaks.textModerationClient.submitText(authToken, "my-scan-123", req); ``` ```json 200 OK { "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 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](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body The request body is a JSON object containing the text to scan. Text to produce Text Moderation report for. `>= 1 characters` `<= 25000 characters` Use sandbox mode to test your integration with the Copyleaks API without consuming any credits. 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"` A list of label configurations to be used for the moderation process. Identifier for the label. [List of moderation labels](/reference/data-types/moderation/text-moderation-labels/). `>= 1 characters` `<= 32 characters` ## Responses **200 OK** - The moderation report was returned successfully. ```json { "modelVersion": "v1", "moderations": { "text": { "chars": { "labels": [4], "starts": [15], "lengths": [4] } } }, "scannedDocument": { "scanId": "scan-id", "totalWords": 86, "creationTime": "2025-08-06T08:05:20.6787519Z" } } ``` **400 Bad Request** - Bad Request. **401 Unauthorized** - Authorization has been denied for this request. **402 Payment Required** - Text Moderation is not enabled to your account. **429 Too Many Requests** - Too many requests have been sent. The request has been rejected. --- # Actions → Grammar Checker ## Grammar Checker Actions Source: https://docs.copyleaks.com/reference/actions/writing-assistant/overview > Assess and improve writing with feedback on grammar, spelling, and sentence structure. import { EndpointRow } from '/snippets/endpoint-row.mdx'; The Copyleaks Grammar Checker API allows you to get feedback on your writing. It provides suggestions for improving grammar, spelling, and sentence structure, helping you enhance the quality of your text. ## Endpoints
--- ## Submit Text Source: https://docs.copyleaks.com/reference/actions/writing-assistant/check > Generate grammar, spelling, and sentence corrections for a given text. ```bash title="cURL" icon="terminal" curl --request POST \ --url https://api.copyleaks.com/v1/writing-feedback/my-scan-123/check \ --header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "text": "Copyleaks is a comprehensive plagiarism detection platform..." }' ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks from copyleaks.models.submit.writing_assistant_document import WritingAssistantDocument auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY") submission = WritingAssistantDocument("Copyleaks is a comprehensive plagiarism detection platform...") response = Copyleaks.WritingAssistantClient.submit_text(auth_token, "my-scan-123", submission) print(response) ``` ```javascript title="JavaScript" icon="square-js" const { Copyleaks, CopyleaksWritingAssistantSubmissionModel } = require('plagiarism-checker'); const copyleaks = new Copyleaks(); const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY'); const submission = new CopyleaksWritingAssistantSubmissionModel( 'Copyleaks is a comprehensive plagiarism detection platform...' ); submission.sandbox = true; await copyleaks.writingAssistantClient.submitTextAsync(auth, 'my-scan-123', submission); ``` ```java title="Java" icon="java" import classes.Copyleaks; import models.submissions.writingassistant.CopyleaksWritingAssistantSubmissionModel; String authToken = Copyleaks.login("your@email", "API_KEY"); CopyleaksWritingAssistantSubmissionModel sub = new CopyleaksWritingAssistantSubmissionModel( "Copyleaks is a comprehensive plagiarism detection platform..." ); sub.setSandbox(true); Copyleaks.writingAssistantClient.submitText(authToken, "my-scan-123", sub); ``` ```json 200 OK { "score": { "corrections": { "grammarCorrectionsCount": 2, "grammarCorrectionsScore": 87, "mechanicsCorrectionsCount": 9, "mechanicsCorrectionsScore": 38, "overallScore": 79 }, "readability": { "score": 59, "readabilityLevel": 5, "readabilityLevelText": "10th to 12th Grader", "readabilityLevelDescription": "Fairly difficult to read" } }, "scannedDocument": { "scanId": "{scanId}", "totalWords": 61, "actualCredits": 1, "expectedCredits": 1, "creationTime": "2025-08-06T08:00:08.0429909Z" } } ``` Use Copyleaks Grammar Checker to generate grammar, spelling and sentence corrections for a given text. This endpoint will receive submitted text to be checked. The response will show the suggested corrections to the input text. **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 A unique scan id provided by you. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id). `>= 3 characters` `<= 36 characters` ### Headers ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` ### Request Body Text to produce Grammar Checker report for. `>= 1 characters` `<= 25000 characters` Use sandbox mode to test your integration with the Copyleaks API without consuming any credits. Grammar correction category weight in the overall score. `>= 0.0 <= 1.0` Mechanics correction category weight in the overall score. `>= 0.0 <= 1.0` Sentence structure correction category weight in the overall score. `>= 0.0 <= 1.0` Word choice correction category weight in the overall score. `>= 0.0 <= 1.0` The language code of your content. If not supplied, our system will automatically detect the language of the content. Example: `"en"` ## Responses **200 OK** - The command was executed. ```json { "score": { "corrections": { "grammarCorrectionsCount": 2, "grammarCorrectionsScore": 87, "overallScore": 79 } }, "scannedDocument": { "scanId": "{scanId}", "totalWords": 61, "creationTime": "2025-08-06T08:00:08.0429909Z" } } ``` **400 Bad Request** - Bad request. **401 Unauthorized** - Authorization has been denied for this request. **402 Payment Required** - User does not have enough credits. **429 Too Many Requests** - Too many requests have been sent. The request has been rejected. --- ## Get Correction Types Source: https://docs.copyleaks.com/reference/actions/writing-assistant/correction-types > Get a list of correction types supported within the Grammar Checker API. ```bash title="cURL" icon="terminal" curl --request GET \ --url https://api.copyleaks.com/v1/writing-feedback/correction-types/en ``` ```python title="Python" icon="python" from copyleaks.copyleaks import Copyleaks # Public endpoint no authentication required. correction_types = Copyleaks.WritingAssistantClient.get_correction_types("en") print(correction_types) ``` ```json 200 OK { "correctionTypes": [ { "title": "General", "description": "A general correction detected.", "message": "A general correction detected", "id": 1, "category": 2 } ] } ``` Get a list of correction types supported within the Grammar Checker API. Correction types apply to all supported languages. The supplied language code for this request is used to determine the language of the texts returned. This endpoint does not require authentication. ## Request ### Path Parameters The language for the returned texts to be in. Language codes are in ISO 639-1 standard. Supported Values: en - English ## Response **200 OK** - The command was executed. ```json { "correctionTypes": [ { "title": "General", "description": "A general correction detected.", "message": "A general correction detected", "id": 1, "category": 2 }, { "title": "Subject Verb Disagreement", "description": "The subject and verb do not agree in number.", "message": "Subject-verb disagreement detected", "id": 2, "category": 2 }, { "title": "Noun Form", "description": "Using an incorrect form of a noun (such as pluralization or possessive form) in a sentence.", "message": "Use a different noun form", "id": 3, "category": 2 }, { "title": "Verb Form", "description": "Using an incorrect form of a verb (such as tense, aspect, or agreement) in a sentence results.", "message": "Use a different verb form", "id": 4, "category": 2 }, { "title": "Article", "description": "Using the wrong article (a, an, or the) or omitting an article inappropriately in a sentence.", "message": "Use the appropriate article", "id": 5, "category": 2 }, { "title": "Preposition", "description": "Using the wrong preposition or misplacing a preposition in a sentence.", "message": "Incorrect preposition usage", "id": 6, "category": 2 }, { "title": "Pronoun", "description": "Using an incorrect pronoun or misplacing a pronoun in a sentence.", "message": "Incorrect pronoun usage", "id": 7, "category": 2 }, { "title": "Part of Speech", "description": "Misusing or misidentifying a word's grammatical category, such as confusing a noun with a verb.", "message": "Incorrect part of speech", "id": 8, "category": 2 }, { "title": "Conjunction", "description": "Misusing or misplacing conjunctions, which are words that connect words, phrases, or clauses in a sentence.", "message": "Incorrect conjunction usage", "id": 9, "category": 2 }, { "title": "Misused Word", "description": "Words that are used incorrectly or inappropriately in a given context.", "message": "Use a different word to convey the message", "id": 10, "category": 3 }, { "title": "Homophone", "description": "Confusing two words that phonetically sound similar but have a different meaning (e.g., \"their\" and \"there\" or \"to\" and \"too\").", "message": "Incorrect homophone usage detected", "id": 11, "category": 3 }, { "title": "Capitalization", "description": "Word was not capitalized correctly (e.g. “paris” should be “Paris”).", "message": "Incorrect capitalization", "id": 12, "category": 4 }, { "title": "Hyphen", "description": "Incorrect or inconsistent use of hyphens in a sentence.", "message": "Hyphen usage is incorrect", "id": 13, "category": 4 }, { "title": "Punctuation", "description": "Incorrect use of punctuation marks, such as commas, periods, semicolons, or colons.", "message": "Incorrect punctuation usage", "id": 14, "category": 4 }, { "title": "Comma", "description": "Incorrect use of commas in sentences.", "message": "Incorrect comma usage", "id": 15, "category": 4 }, { "title": "Apostrophe", "description": "Incorrect use of apostrophes in sentences.", "message": "Incorrect apostrophe usage", "id": 16, "category": 4 }, { "title": "Space", "description": "Missing or extra spaces detected in sentence.", "message": "Missing or extra spaces", "id": 17, "category": 4 }, { "title": "Spelling", "description": "Misspelling of a word.", "message": "Misspelling detected", "id": 18, "category": 4 }, { "title": "Fused Sentence", "description": "When two independent clauses are incorrectly joined without appropriate punctuation or conjunction.", "message": "Fused sentence detected", "id": 19, "category": 1 }, { "title": "Comma Splice", "description": "Two independent clauses are incorrectly joined by a comma without a coordinating conjunction or appropriate punctuation.", "message": "Comma splice detected", "id": 20, "category": 1 }, { "title": "Sentence Fragments", "description": "When a group of words appears to be a sentence but is incomplete because it lacks a subject, a predicate, or both.", "message": "Ensure your sentence has a complete subject and predicate", "id": 21, "category": 1 }, { "title": "Ineffective Construction", "description": "Refers to sentences or phrases that are poorly constructed or lack clarity, making it difficult for readers to understand the intended meaning.", "message": "Revise the sentence for better clarity and structure", "id": 22, "category": 1 }, { "title": "Extra Words", "description": "Sentences that contain unnecessary or redundant words, which can be removed for clearer and more concise writing.", "message": "Sentence contains extra words", "id": 23, "category": 1 }, { "title": "Missing Words", "description": "Identifies sentences that are missing essential words, resulting in incomplete or unclear meaning.", "message": "Sentence with missing words", "id": 24, "category": 1 }, { "title": "Adjective Gender Agreement", "description": "Detects errors in the gender agreement between adjectives and nouns.", "message": "Gender agreement mismatch in adjectives", "id": 25, "category": 2 }, { "title": "Adjective Number Agreement", "description": "Highlights discrepancies in the number agreement between adjectives and nouns for improved grammatical precision.", "message": "Number agreement error with adjectives", "id": 26, "category": 2 }, { "title": "Article Gender Agreement", "description": "Agreement between articles and nouns in terms of gender is incorrect, ensuring grammatical accuracy.", "message": "Gender agreement error in articles", "id": 27, "category": 2 }, { "title": "Article Number Agreement", "description": "Number mismatch between articles and nouns creating inconsistency in how they refer to the same or similar elements in a sentence.", "message": "Number agreement error in articles", "id": 28, "category": 2 }, { "title": "Noun Gender Agreement", "description": "Lack of agreement between nouns and their associated genders, ensuring grammatical harmony.", "message": "Gender agreement error with nouns", "id": 29, "category": 2 }, { "title": "Subjunctive Mood", "description": "Identifies the incorrect usage of the subjunctive mood in sentences, ensuring proper expression of hypothetical or unreal situations.", "message": "Subjunctive mood misuse", "id": 30, "category": 2 }, { "title": "Compound Word Error", "description": "Identifies incorrect compound word usage.", "message": "Compound word usage error", "id": 31, "category": 2 }, { "title": "Mood Inconsistency", "description": "Detects inconsistencies in the expression of mood within a sentence, ensuring cohesive writing.", "message": "Inconsistency in mood detected", "id": 32, "category": 2 }, { "title": "Accent Error", "description": "Highlights deviations in accents, promoting uniform language usage.", "message": "Incorrect or missing usage of accents", "id": 33, "category": 4 }, { "title": "Homoglyph Error", "description": "Non-standard characters that resemble standard ones have been detected.", "message": "Homoglyphs detected in text", "id": 34, "category": 2 } ] } ``` **400 Bad Request** - Bad request. Language not supported. ### Body List of correction types and corresponding user interface information. Shortened capitalized name of the correction. A short explanation of the correction. A longer, more explicit explanation of the correction. An identifier for the correction type. Unsigned integer. Category of the correction type. **Available Values:** - `1` : Sentence Structure - `2` : Grammar - `3` : Word Choice - `4` : Mechanics `>= 1` --- # Data Types ## Overview Source: https://docs.copyleaks.com/reference/data-types/overview > Explore the comprehensive Copyleaks API reference for data types, from scan results to webhook payloads. Understand the structure of the data you'll work with. Our API reference provides detailed information on every data object, from scan results to webhook payloads, ensuring you can build robust and reliable integrations. ## Explore Our Data Models Dive into the specifics of each data type to understand how to work with the Copyleaks API. Explore the data types related to authenticity, including plagiarism, AI detection, and webhooks. Explore the data types related to AI detection. Explore the data types related to Grammar Checker. Explore the data types related to content moderation. --- # Data Types → Authenticity ## Authenticity Source: https://docs.copyleaks.com/reference/data-types/authenticity/overview > Explore the data types related to authenticity, including plagiarism, AI detection, and webhooks. This section provides detailed information about the data types related to authenticity. Explore the data types related to the Private Cloud Hub. Detailed information about the results you can get from a scan. Detailed information about the webhooks you can subscribe to for asynchronous event notifications. Provides metadata and information about a scan that has been submitted to the Copyleaks API. Tags used in scan results All available alert type codes API limits, requirements, and constraints --- ## Result Tags Source: https://docs.copyleaks.com/reference/data-types/authenticity/result-tags > Tags used in scan results When scanning with Copyleaks, each result in your returned [Completion Webhook](/reference/data-types/authenticity/webhooks/scan-completed) may include one or more result tags. These tags provide additional context or metadata about the scan results. Below you can find a full list of possible tags. ### Tag Types Each tag is accompanied by a unique code, a title, and a description. Note that the title and description of these tags may be subject to change over time. The title and description of the tags may change. Code | Title | Description ---------|----------|--------- cross-language | Cross Language | Suspected cross-lingual plagiarism detected code-license | License: [Code License] | The file is licensed under [Code License] license. suspected-ai-generated | Suspected AI-Generated | This result is suspected to contain AI-generated text. ai-source-match | AI Source Match| This result contains AI-generated text, originating from an internet source. internal-ai-source-match | Internal AI Source Match | This result contains AI-generated text, originating from Copyleaks internal AI database. ## Next Steps Learn more about the completed webhook and the information it provides. Understand how AI-generated content is detected and tagged in scan results. Explore how cross-language plagiarism is identified and tagged. --- ## Scan Alerts Source: https://docs.copyleaks.com/reference/data-types/authenticity/scan-alerts > All available alert type codes When submitting documents, you may receive various types of alerts. These alerts provide important information about your scan results and any issues that occurred during processing. As an API user, you can use these alerts to improve the user experience by supporting more detection features and handling cases of failure. Alerts are triggered for different scenarios, including: - Features that failed to execute - Text manipulation attempts and suspicious behavior - Private Cloud Hub issues Scan alerts are found in the [scan completion webhook](/reference/data-types/authenticity/webhooks/scan-completed) at: ``` notifications.alerts[] ``` Alert titles and messages may change over time as we improve our system. Each alert includes a specific code, category, and detailed message to help you understand what occurred. ## Categories | id | Category | |----|---------------------| | 1 | General | | 2 | AiContentDetection | | 3 | CheatingDetection | | 4 | WritingAssistant | | 5 | CrossLanguage | | 6 | InternalDatabase | | 7 | Repository | | 8 | ExcludeTemplate | | 9 | PdfReport | ## Alerts | Code | Title | Message | Category | Additional Data | |----------------------------------|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|-------------------------------------------------------------------------| | suspected-ai-text | Suspected Cheating: AI Text Detected | We are unable to verify that the text was written by a human. | 2 | [AI Content Detection Response](/reference/data-types/authenticity/results/ai-detection) | | ai-detection-failed | AI Detection Failed | We were unable to validate that there was no AI text in the submitted document due to an internal error. | 2 | | | file-type-not-supported | AI Detection Not Executed: File Type not Supported | The submitted file type is currently not supported for AI detection. | 2 | | | ai-detection-lang-not-supported | AI Detection Not Executed: Language not Supported | The submitted language is currently not supported for AI detection. | 2 | | | ai-detection-text-too-short | AI Detection Not Executed: Text too Short | The submitted text is too short for AI content detection. | 2 | | | ai-insights-lang-unsupported | AI Insights: Unsupported Language | The submitted language is currently not supported for AI Insights. | 2 | | | ai-logic-source-code-unsupported | AI Logic: Source Code Unsupported | AI Logic does not support source code files. | 2 | | | suspected-cheating-detected | Advanced Detection: Hidden Characters | We have detected the possible use of hidden characters to cheat the plagiarism scan. | 3 | | | suspected-character-replacement | Advanced Detection: Character Replacement | We have detected possible use of special characters to cheat the plagiarism scan. | 3 | | | suspected-white-text | Suspected Cheating: Invisible Text | We have detected a possible use of invisible text, switch to the textual version of the document to see all text. | 3 | | | text-mostly-excluded | Advanced Detection: Major Text Exclusion | We have detected a possible cheating attempt to exclude the majority of text. | 3 | | | cheat-detection-failed | Advanced Detection Failed | We were unable to validate that there was no cheating in the submitted document. | 3 | | | writing-feedback-failed | Grammar Checker Failed | We were unable to produce a Grammar Checker report. | 4 | | | writing-feedback-lang-not-supported | Grammar Checker Not Executed: Language not Supported | The submitted language is currently not supported for Grammar Checker. | 4 | | | cross-language-same-as-doc-lang | Cross Language: Same Document Language | Submitted language and cross-language text are the same language. No credits were used. | 5 | | | cross-language-unsupported-doc-lang | Cross Language: Unsupported Document Language | Your submitted document language is not supported for cross-language plagiarism detection. Cross language feature has been disabled for this scan. | 5 | | | internal-db-forbidden-for-team | Shared Data Hub Team Policy Violation | Your organization does not allow scanning files against Copyleaks Shared Data Hub, this scan was not added or scanned against the Copyleaks Shared Data Hub. If you still wish to use the Shared Data Hub please contact your organization admin. | 6 | | | unable-to-index | Add to Database Failed | We were unable to add your file to the database due to an internal error. | 6 | | | repository-index-failed | Not Able to Index Against Repository | You do not have permission to index against `{RepositoryName}` or the repository does not exist. | 7 | | | repository-scan-failed | Not Able to Scan Against Repository | You do not have permission to scan against `{RepositoryName}`. | 7 | | | repository-full | This Private Cloud Hub is Full | Indexing to private cloud hub `{RepositoryName}` failed because the private cloud hub storage capacity has been reached. | 7 | | | document-template-not-found | Document Template Not Found | We were unable to find the following exclusion document template:`{ScanIds}`. | 8 | | | pdf-generation-failed | Unable to Generate PDF Report | The PDF report was not able to be generated. | 9 | | ## Next Steps Learn how to receive and process notifications from Copyleaks, including scan alerts. Review API limits and other technical details that might impact scan alerts. Understand how to detect and handle various text manipulation attempts. Learn more about detecting AI-generated text and related alerts. --- ## Scanned Document Source: https://docs.copyleaks.com/reference/data-types/authenticity/scanned-document > Detailed reference for the Scanned Document object, which contains metadata about a submitted scan. The `scannedDocument` object provides metadata and information about a scan that has been submitted to the Copyleaks API. The unique identifier for the scan that you provided during submission. The total number of words detected in the submitted content. The total number of words that were excluded from the scan based on your `exclude` settings. The number of credits consumed by the scan. This will be `0` until the scan is completed. The number of credits that are expected to be consumed by the scan upon completion. The Coordinated Universal Time (UTC) timestamp indicating when the scan was created. Format: `YYYY-MM-DDTHH:mm:ss.sssssssZ` An object containing metadata about the submitted file. For example, it can contain the `filename`. An object indicating which scan features were enabled for this scan. Indicates if plagiarism detection was enabled. Indicates if AI-generated text detection was enabled. Indicates if the AI Logic (explainable AI) feature was enabled. Indicates if the Grammar Checker feature was enabled. Indicates if the generation of a PDF report was enabled. Indicates if cheat detection was enabled. Indicates if AI source matching against internet sources was enabled. Indicates if AI Source matching against internal sources was enabled. Indicates if references validation was enabled. The language code (ISO 639-1) of the language detected in the submitted content. --- ## Technical Specifications Source: https://docs.copyleaks.com/reference/data-types/authenticity/technical-specifications > Copyleaks API technical specifications: page definition (250 words = 1 page), file size limits, and scanning constraints. This page describes the technical specifications of the Copyleaks API. ## Page Definition A page is defined as up to **250 words**. This means that every 250 words (or portion thereof) in your document counts as one page for billing purposes. How Page Counting Works: - 1-250 words = 1 page - 251-500 words = 2 pages - 501-750 words = 3 pages - etc. ## Input Limits ### Supported Plagiarism File Types | Type | File Types List | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | Textual: | `html`, `htm`, `txt`, `csv`, `rtf`, `xml`, `md` | | Non-Textual: | `pdf`, `docx`, `doc`, `pptx`, `ppt`, `odt`, `chm`, `epub`, `odp`, `ppsx`, `pages`, `xlsx`, `xls`, `LaTeX` | | Source code: | `ts`, `py`, `go`, `cs`, `c`, `h`, `idc`, `cpp`, `hpp`, `c++`, `h++`, `cc`, `hh`, `java`, `js`, `swift`, `rb`, `pl`, `php`, `sh`, `m`, `scala`, `css` | You can access this list programmatically, for more info [click here](/reference/actions/miscellaneous/supported-plagiarism-file-types). ### Supported Textual File Types All supported plagiarism file types are also supported when submitted online by URL. ### Supported Image Types (OCR) The supported image files are `pdf, docx, gif, png, bmp, jpg and jpeg` . The files must contain textual content. Upload only. You can access this list programmatically, for more info [click here](/reference/actions/miscellaneous/ocr-supported-languages). ### Supported Plagiarism Languages | Setting | Description | |------------------------------|-------------| | **Supported Languages** | All languages supported by Unicode, including English, Spanish, French, Portuguese, Arabic, Russian, German, Greek, Chinese, Japanese, and more. [More info](https://unicode.org/standard/supported.html). | | **Supported OCR Languages** | See full list [here](/reference/actions/miscellaneous/ocr-supported-languages). | | **Supported Cross Languages** | See full list [here](/reference/actions/miscellaneous/supported-cross-languages). | | **Maximum Document Length** | The maximum length allowed is **2000 pages** (500K words). | ### File Size | Description | Max Upload File Size | | ------------------------------------------------- | -------------------- | | HTML files (`html`, `htm`, ...) | 5 MB | | Text files (`txt`, `csv`) and source-code | 3 MB | | Non-Textual Documents (`pdf`, `doc`, `docx`, ...) | 50 MB | | Image Types (`jpg`, `png`, `bmp`, ...) | 25 MB | ## Rate Limit An account by default has a rate of 10 requests per second. If you still need higher rates, feel free to [contact us](https://help.copyleaks.com/s/contactsupport). Rate Limit Exceeded, If your host has reached its API limit, you will receive the HTTP error 429 (Too Many Requests) and you will be unable to authenticate with the Copyleaks API for 5 minutes. ## Maintenance Periods When our servers are under maintenance you will receive a `503` HTTP status code. Please wait a full minute and try again. For more information about the service status -[ Copyleaks System Status](https://status.copyleaks.com). ## Time | Setting | Value | |-----------------------------|---------------------| | **Time Format** | `dd/MM/yyyy HH:mm:ss` | | **Time Zone** | UTC | | **Default HTTP Request Timeout** | 110 seconds | ## Scan Expiration Your created scans using the [/v3/submit](/reference/actions/authenticity/submit-file) endpoints will be stored in Copyleaks servers for a specific duration of time. You can control the expiration of your scans in your submit request. Make sure you save your data before it expires: | Type | hours | | ------------------ | ----- | | Max Expiration | 2880 | | Default Expiration | 2880 | ## Frequently asked questions ### How does Copyleaks count pages for billing? A page is defined as up to 250 words. Every 250 words (or portion thereof) counts as one page, so 1-250 words is 1 page, 251-500 words is 2 pages, and so on. ### What is the maximum file size I can submit? It depends on the file type: 50 MB for non-textual documents (PDF, DOC, DOCX), 25 MB for images submitted to OCR, 5 MB for HTML files, and 3 MB for text and source-code files. ### What is the maximum document length? 2000 pages, which is approximately 500,000 words. ### What is the Copyleaks API rate limit? 10 requests per second by default. Exceeding it returns HTTP 429 (Too Many Requests) and blocks authentication for 5 minutes. Contact Copyleaks if you need a higher rate. ### How long are scans stored before they expire? Scans are stored for 2880 hours (120 days) by default, which is also the maximum. You can set a shorter expiration in the submit request, so save your results before they expire. --- # Data Types → Authenticity → Results ## Results Data Types Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/overview > Explore the various data structures for scan results, including plagiarism, AI detection, and writing feedback. This section provides detailed information about the different types of results you can receive from a Copyleaks scan. Each result type has a specific data structure, which is detailed in the pages below. A snapshot of AI Detection results, providing data from the matched results. A summary of the scan's findings, generated by our AI. A snapshot of the submitted document as viewed by Copyleaks. A snapshot of specific plagiarism results detected by Copyleaks. A snapshot of writing feedback and corrections. Response structure and field definitions for the Image Plagiarism Detection API. --- ## New Result Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/new-result > A new result was found during the scan process. import Results from '/snippets/results.mdx'; The new results webhook is triggered when a new plagiarism result is found during the scan process. __When you receive this webhook, the scan is still in progress.__ The current score of the scan up to this point. The developer payload that was provided in the submit method. ## Example ```json { "score": 0, "developerPayload": "string", "internet": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "url": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "database": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "batch": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "repositories": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "repositoryId": "string", "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string", "submittedBy": "string" } } ] } ``` ## Next Steps Learn about the different types of webhooks and how to handle them. Learn how to export scan results, including new plagiarism results. Understand how to present new results to your users effectively. --- ## New Plagiarism Result Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/new-plagiarism-result > A snapshot of specific results detected by Copyleaks. It provides the data from the matched results. import NewPlagiarismResult from '/snippets/new-plagiarism-result.mdx'; A snapshot of specific results detected by Copyleaks. It provides the data from the matched results. ## Webhook HTTP verb The HTTP verb for this webhook is upon developer request. You need to specify your verb while executing the [Export method](/reference/actions/downloads/export) See `results.verb` field. We recommend you use the HTTP verb `PUT`. It will allow Copyleaks to override an existing file as needed. ## Example ```json { "statistics": { "identical": 0, "minorChanges": 0, "relatedMeaning": 0 }, "text": { "value": "Hello world!", "pages": { "startPosition": [ 0 ] }, "comparison": { "identical": { "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } }, "minorChanges": { "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } }, "relatedMeaning": { "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } } } }, "html": { "value": "

Hello world!

", "comparison": { "identical": { "groupId": [ 0 ], "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } }, "minorChanges": { "groupId": [ 0 ], "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } }, "relatedMeaning": { "groupId": [ 0 ], "source": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } }, "suspected": { "chars": { "starts": [ 0 ], "lengths": [ 1 ] }, "words": { "starts": [ 0 ], "lengths": [ 1 ] } } } } } } ``` ## Next Steps Learn how to use the export method to retrieve detailed scan results. Understand how to present plagiarism results to your users effectively. --- ## AI Overview Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/ai-overview > The Gen-AI Overview field: a markdown summary of each scan with central themes, key insights, and context drawn from historical data. Copyleaks’ Gen AI thoroughly analyzes each scan, summarizing content, identifying central themes, pinpointing key insights, and leveraging historical data to provide a richer, context-driven perspective. A markdown-formatted string containing the Gen-AI overview of the scan. The version of the model used for the Overview generation. ## Example ```json { "overview": "### Historical Author Data:\n- Four scans analyzed with an average plagiarism similarity of 13.18%\n- 4 instances of AI-generated content detected\n\n### Current Plagiarism Detection:\n- 0% overall plagiarism\n- Main sources: \n - yard.com (3.0%, 74 words)\n - brainly.com (3.2%, 45 words)\n - llcattorney.com (1.3%, 29 words)\n - montrosedemocrats.org (3.0%, 12 words)\n\n### AI Content Detection:\n- 100% AI-written content detected\n\n### Grammar Checker:\n- 100% writing quality with no errors in grammar, sentence structure, word choice, and mechanics.", "modelVersion": "v1" } ``` ## Next Steps Learn more about the GenAI Scan feature and its capabilities. Understand how AI logic can help you interpret the results of AI text detection. Learn how to export scan results, including the AI Overview. --- ## AI Text Detection Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/ai-detection > A snapshot of AI Text Detection results detected by Copyleaks. It provides the data from the matched results. import AiDetectionModelVersion from '/snippets/ai-detection-model-version.mdx'; import ResultAiDetection from '/snippets/result-ai-detection.mdx'; import SummaryAiDetection from '/snippets/summary-ai-detection.mdx'; import Explain from '/snippets/explain.mdx'; ## Example ```json { "modelVersion": "v7.1", "results": [ { "classification": 2, "probability": 1, "matches": [ { "text": { "chars": { "starts": [ 0 ], "lengths": [ 1509 ] }, "words": { "starts": [ 0 ], "lengths": [ 221 ] } } } ] } ], "summary": { "human": 0, "ai": 1 }, "explain": { "patterns": { "statistics": { "aiCount": [ 15.9636, 39.5495, 84.7079, 119.8710, 9.9233, 185.6670, 14.4536, 19.1995 ], "humanCount": [ 0.8076, 1.5076, 3.8228, 8.5071, 0.3769, 4.2536, 0.3231, 1.1845 ] }, "text": { "chars": { "starts": [31, 55, 303, 909, 961, 987, 1129, 1775], "lengths": [23, 32, 23, 33, 25, 30, 30, 19] }, "words": { "starts": [5, 9, 45, 135, 144, 148, 169, 257], "lengths": [4, 6, 3, 6, 4, 5, 5, 3] } } } } } ``` ## Next Steps Learn how to use the AI Detection API to check if content was written by a human or generated by an AI. Understand how AI logic can help you interpret the results of AI text detection. Learn how to export scan results, including AI detection data. --- ## Crawled Version Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/crawled-version > A snapshot of the submitted document. It shows how Copyleaks viewed your submitted file. import CrawledVersion from '/snippets/crawled-version.mdx'; import SummaryReferencesValidation from '/snippets/summary-references-validation.mdx'; import ResultsReferencesValidation from '/snippets/results-references-validation.mdx'; A snapshot of the submitted document. It shows how Copyleaks viewed your submitted file. ## Webhook HTTP verb The HTTP verb for this webhook is upon developer request. You need to specify your verb while executing the [Export method](/reference/actions/downloads/export) See `crawledVersion.verb` field. We recommend you use the HTTP verb `PUT`. It will allow Copyleaks to override an existing file as needed. The crawled version is available in textual format, and if the `properties.includeHtml` field (in the `submit` method) is set to `true`, it is also in HTML format. ## Example ```json { "metadata": { "words": 30, "excluded": 2 }, "html": { "value": "

Example Domain

This domain is established to be used for illustrative examples in documents.", "exclude": { "starts": [ 16 ], "lengths": [ 14 ], "reasons": [ 3 ], "groupIds": [ 1 ] } }, "text": { "value": "Example Domain This domain is established to be used for illustrative examples in documents.", "exclude": { "starts": [ 0 ], "lengths": [ 14 ], "reasons": [ 3 ] }, "pages": { "startPosition": [ 0 ] } } } ``` ## References Validation When `references.validate` is enabled, the crawled version includes a `referencesValidation` object with the validation `summary` and a `results` array (one entry per detected reference). ### Validation semantics A reference is counted in `academicValidated` or `nonAcademicValidated` only when it is fully corroborated: the top suggestion matched the title and no checked signal is `false`. A signal that is absent or null is ignored, not held against the reference. - A suggestion with `signals` of `{ "title": true }` only, with no year or authors checked, counts as validated. - A suggestion with `{ "title": true, "year": false, "authors": false }` does not count as validated. ### References validation example ```json { "referencesValidation": { "summary": { "total": 2, "academic": 1, "academicValidated": 1, "nonAcademicValidated": 0 }, "results": [ { "type": "academic", "textRanges": { "starts": [131], "lengths": [131] }, "htmlRanges": { "starts": [240], "lengths": [131], "groupIds": [0] }, "parsed": { "title": "Attention Is All You Need", "authors": ["Vaswani, A.", "Shazeer, N.", "Parmar, N."], "year": 2017, "journal": "Advances in Neural Information Processing Systems" }, "suggestions": [ { "url": "https://doi.org/10.48550/arXiv.1706.03762", "doi": "10.48550/arXiv.1706.03762", "title": "Attention Is All You Need", "authors": ["Vaswani, A.", "Shazeer, N.", "Parmar, N.", "Uszkoreit, J."], "publishedYear": 2017, "modifiedYear": 2023, "journal": "Advances in Neural Information Processing Systems", "signals": { "title": true, "year": true, "authors": true } } ] }, { "type": "nonAcademic", "textRanges": { "starts": [500], "lengths": [100] }, "htmlRanges": { "starts": [620], "lengths": [100], "groupIds": [1] }, "parsed": { "url": "https://en.wikipedia.org/wiki/Artificial_intelligence", "title": "Artificial intelligence", "authors": ["Wikipedia"], "year": 2024, "journal": "" }, "suggestions": [ { "url": "https://en.wikipedia.org/wiki/Artificial_intelligence", "doi": "", "title": "Artificial intelligence - Wikipedia", "authors": ["Contributors to Wikimedia projects"], "publishedYear": 2001, "modifiedYear": 2026, "journal": "", "signals": { "title": true, "year": false, "authors": false } } ] } ] } } ``` ## Next Steps Learn how to use the export method to retrieve detailed scan results. Understand how to present crawled versions and other scan data to your users. --- ## Image Plagiarism Response Source: https://docs.copyleaks.com/reference/data-types/authenticity/results/image-plagiarism-response > Response structure and field definitions for the Copyleaks Image Plagiarism Detection API. The Copyleaks Image Plagiarism Detection API returns a synchronous response containing scan metadata and a categorized list of web locations where the submitted image was found. ## Response Properties The custom string provided in the request, echoed back unchanged. `null` if not provided. Metadata about the submitted image and the scan. The scan ID provided in the request path. The number of credits expected to be charged for this scan. The number of credits actually charged for this scan. UTC timestamp of when the scan was created (ISO 8601). Example: `"2026-05-24T10:00:00Z"` Width of the submitted image in pixels. Height of the submitted image in pixels. The filename provided in the request. The detection results. All matching images found on the web, with full matches ordered first, then partial matches. Each image URL appears at most once. The URL of the matching image. The type of match: - `0` - **Full**: Exact or near-exact copy of the submitted image. - `1` - **Partial**: Cropped, resized, recolored, or otherwise modified version. The web pages where this image was found. Omitted when the image was not located on any page. The URL of the web page containing the matching image. A summary of match counts. Total number of matching images found. Number of full matches (matchType `0`). Number of partial matches (matchType `1`). ## Example Response ```json { "developerPayload": "my-custom-data", "scannedImage": { "scanId": "my-scan-1", "expectedCredits": 1, "actualCredits": 1, "creationTime": "2026-05-24T10:00:00Z", "width": 1920, "height": 1080, "filename": "my-photo.jpg" }, "matches": { "internet": [ { "url": "https://example.com/images/photo.jpg", "matchType": 0, "webPages": [ { "url": "https://example.com/blog/my-post" }, { "url": "https://example.org/news/article" } ] }, { "url": "https://example.com/thumbs/photo-thumb.jpg", "matchType": 1, "webPages": [ { "url": "https://example.org/gallery" } ] }, { "url": "https://example.org/gallery/photo-sm.jpg", "matchType": 1 } ], "score": { "totalMatches": 3, "fullMatches": 1, "partialMatches": 2 } } } ``` An empty `matches.internet` array with all-zero scores means no matching content was found on the web. ## Next Steps Step-by-step guide to submitting images and interpreting results. Full API reference for the Image Plagiarism Detection endpoint. --- # Data Types → Authenticity → Webhooks ## Webhooks Overview Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/overview > Get notified immediately when your scan status changes, without having to call any other methods. import { EndpointRow } from '/snippets/endpoint-row.mdx'; A webhook is an automated message sent from an application when a specific event occurs. Think of it as a push notification for your server. Instead of your application repeatedly asking the Copyleaks API, "Is the scan finished yet?" (a process known as polling), a webhook lets our servers notify you automatically as soon as an event happens. This approach is far more efficient and provides real-time updates. Since authenticity scans can take time to complete, webhooks are essential for building a responsive and scalable integration. By using them, you can get immediate notifications for key events-like when a scan is completed, an error occurs, or the credit cost is calculated - without writing complex polling logic. This page explains how to configure your endpoints to receive these events and what to expect from our system. ## System Events Copyleaks system is able to notify you about a few different event types related to your scan. These events are critical for the scan success. To allow us to fire your webhook, you will need to provide us with a valid HTTP(s) endpoint. You can do this by populating the `properties.webhooks.status` field in the submit method (URL, file, or OCR). ### Webhooks
### Suggested Endpoint Format The recommended format for your webhook endpoint is: ```http https://yoursite.com/copyleaks/{status}/SCAN_ID ``` The endpoint contains two dynamic parts: 1. **`{status}`** - This token is replaced by the Copyleaks server with the relevant event. Possible values include: - ([**completed**](/reference/data-types/authenticity/webhooks/scan-completed)) - The scan completed successfully. - **([error](/reference/data-types/authenticity/webhooks/error))** - The scan ended with an error. - **([creditsChecked](/reference/data-types/authenticity/webhooks/credits-checked))** - Copyleaks inspected the submitted file and provides a cost for the scan. - **([indexed](/reference/data-types/authenticity/webhooks/indexed))** - Copyleaks indexed the submitted file in its Shared Data Hub or repository. 2. **`SCAN_ID`** - This segment should be replaced with your actual process ID. ### Example If your scan ID is `hello123`, your webhook endpoints would be: - `https://yoursite.com/copyleaks/completed/hello123` - `https://yoursite.com/copyleaks/error/hello123` - `https://yoursite.com/copyleaks/creditsChecked/hello123` Including the `SCAN_ID` in the webhook URL allows you to quickly identify and track the scan. While optional, it is highly recommended. ## New-Result Webhook In addition to the `{status}` webhooks, there is a **new-result webhook** that reports newly found results as they are identified. This is useful for time-sensitive applications, providing a live stream of results without waiting for the scan to complete. To use this webhook, populate the `properties.webhooks.newResult` field in the submit method (URL, file, or OCR).
## Client Requirements To use the asynchronous model, your system must meet the following requirements: - A web server connected to the internet. - The ability to respond to webhook calls within **70 seconds** with an HTTP success code (2xx). - Once a success code is received, the webhook will not be fired again for the same scan. ## Retry Policy To ensure reliable delivery, Copyleaks implements an **automatic retry mechanism** in case of communication failures (e.g., server downtime, network instability). If your server fails to respond or returns a **5xx error**, the webhook will be retried **up to 17 times**, following an **exponential backoff** strategy: 1, 2, 4, 8, 16, ..., **up to 65,535 seconds** between attempts. To manually resend a webhook for a specific scan, use the [resend webhook](/reference/actions/authenticity/resend-webhook) endpoint. ## At-Least-Once Delivery Guarantee Copyleaks follows an **"at-least-once"** delivery approach, ensuring that webhooks are always sent, even in cases of temporary failures. While a webhook is guaranteed to be sent, it **may be delivered more than once** in rare cases. Your system should be designed to handle duplicate webhook notifications gracefully. By implementing these best practices, you can ensure seamless integration with Copyleaks' asynchronous webhook system while maintaining the security and reliability of your application. ## Next Steps Learn about the completed webhook and its contents. Understand how to handle error webhooks and troubleshoot issues. Learn about the webhook for checking credit costs before a scan. Understand the webhook for documents indexed in the Copyleaks database. Learn about the webhook that reports newly found results as they are identified. Learn how to secure your webhook endpoints against unauthorized access. --- ## Scan Completed Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/scan-completed > The scan completed successfully. import ScannedDocument from '/snippets/scanned-document.mdx'; import Results from '/snippets/results.mdx'; import Score from '/snippets/score.mdx'; import Notifications from '/snippets/notifications.mdx'; The `completed` event occurs once the scan process has been completed and the scan finished successfully. Successful scans provide you all the output information from the scan process.
The current status of the scan. Possible values: `0` (Success), `1` (Error), `2` (CreditsChecked), `3` (Indexed) The developer payload that was provided in the submit method.
`<= 512 characters`
General information about the scanned document. A list of all the results that were found. The aggregated score of all results. A summary of the reference validation results, returned when `references.validate` was enabled for the scan. The webhook contains the summary only. The per-reference results, including the parsed citations and corroborating sources, are available in the [crawled version](/reference/data-types/authenticity/results/crawled-version#references-validation). An aggregated count of the references that were detected and validated. The total number of references detected in the scanned content. The number of detected references that were identified as academic. The number of academic references that were fully corroborated against the Copyleaks academic citation index. The number of non-academic references that were fully corroborated against their cited source. A list of all the notifications that were found. ## Example ```json { "status": 0, "developerPayload": "Custom developer payload", "scannedDocument": { "scanId": "string", "totalWords": 0, "totalExcluded": 0, "credits": 0, "creationTime": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } }, "results": { "internet": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "url": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "database": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "batch": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string" } } ], "repositories": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "repositoryId": "string", "scanId": "string", "metadata": { "finalUrl": "string", "canonicalUrl": "string", "author": "string", "organization": "string", "filename": "string", "publishDate": "string", "creationDate": "string", "lastModificationDate": "string", "submittedBy": "string" } } ], "internalAIData": [ { "id": "string", "title": "string", "introduction": "string", "matchedWords": 0, "identicalWords": 0, "similarWords": 0, "paraphrasedWords": 0, "totalWords": 0 } ], "score": { "identicalWords": 0, "minorChangedWords": 0, "relatedMeaningWords": 0, "aggregatedScore": 0 } }, "referencesValidation": { "summary": { "total": 0, "academic": 0, "academicValidated": 0, "nonAcademicValidated": 0 } }, "downloadableReport": { "status": "Success = 0", "report": "string" }, "notifications": { "alerts": [ { "category": 2, "code": "string", "title": "string", "message": "string", "helpLink": "string", "severity": 0, "additionalData": "string" } ] } } ``` ## Next Steps Learn about the different types of webhooks and how to handle them. Learn how to export scan results, including new plagiarism results. Understand how to present new results to your users effectively. Explore the full list of scan alerts and their meanings. --- ## Credits Checked Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/credits-checked > Copyleaks inspected the submitted file and provides a cost for the scan. import ScannedDocument from '/snippets/scanned-document.mdx'; Copyleaks supports a price check operation. In some cases, you won't know the exact length of your document, so using the price check will be helpful to understand how many credits are necessary. Copyleaks allows you to send your document and receive back the amount of credits that the system will require to complete a scan __(1 credit = 250 words)__. To proceed with scanning the document after checking the credits needed, you should call the Start method. Scans that are not triggered by calling the Start method within 48 hours will be deleted and will no longer be available.
The current status of the scan. Possible values: 0 (Success), 1 (Error), 2 (CreditsChecked), 3 (Indexed) The developer payload that was provided in the submit method. `<= 512` characters The price of the scan. If you will continue scanning, this is the price you will pay. General information about the scanned document. ## Example ```json { "status": 2, "developerPayload": "Custom developer payload", "credits": 1 } ``` ## Next Steps Learn how to initiate a scan after checking the credit cost. Explore strategies for managing your Copyleaks credits effectively. Learn about the different types of webhooks and how to handle them. --- ## Error Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/error > The scan ended with an error. The `error` event happens as soon as the scan process reaches an end due to an error. The current status of the scan. Possible values: 0 (Success), 1 (Error), 2 (CreditsChecked), 3 (Indexed) The error type (e.g., `authentication_error`, `payment_error`, `invalid_request_error`, `api_error`). The machine-readable error identifier (e.g., `invalid_credentials`, `insufficient_credits`). Error code that represents the reason for failure. See below the full error table. Human-readable error message that describes the reason for failure. A URL to the documentation page for this error. Additional details about specific parameters that caused the error. The parameter name that caused the error. A message describing the issue with this parameter. The developer payload that was provided in the submit method. `<= 512` characters Copyleaks provides you with the specific error message describing the reason for the error. Some of the failures are related to incorrect configuration on your side. Others are related to Copyleaks server-side errors. We are doing our best to successfully respond to all of your requests. Still, sometimes we encounter an internal error. In that case, we will fix the problem as soon as possible. You will also get a unique ticket ID that will help identify the problem when contacting Copyleaks customer support. For a complete reference of all the error codes and how to handle them, see [API Errors](/using-the-apis/api-errors). ## Example ```json { "status": 1, "error": { "type": "invalid_request_error", "id": "missing_parameter", "code": 1, "message": "Bad request. One or several required parameters are missing or incorrect." }, "developerPayload": "Custom developer payload" } ``` ## Next Steps Complete reference of all API error codes and how to resolve them. Learn about the different types of webhooks and how to handle them. Understand how to implement an exponential backoff strategy for retrying requests. Explore the full list of scan alerts and their meanings. --- ## Export Completed Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/export-completed > The export request is done. Once the export request is done, a completion webhook is fired. When the webhook reaches your servers, please verify that all the requested data was copied correctly. To check that the commands finished successfully, check: 1. The `completed` flag should be equal to `true`. 2. Each `task.isHealthy` should be equal to `true`. 3. Each `task.httpStatusCode` should be equal to `2xx` (200, 204, …). This flag gives an indication of whether the scan was completed without internal errors on the Copyleaks side. Possible values: true (Completed successfully), false (Error) The developer payload that was provided in the submit method. A List of completed tasks. The endpoint address of the export task. This flag gives an indication whether the scan was completed without internal errors on the Copyleaks side. The status code reported by the customer servers. If the `tasks.isHealthy` is equal to false - this field will be null. ## Example ```json { "completed": true, "developerPayload": "This is my payload", "tasks": [ { "endpoint": "https://yourserver.com/export/export-id/results/my-result-id", "httpStatusCode": 200, "isHealthy": true }, { "endpoint": "https://yourserver.com/export/export-id/pdf-report", "httpStatusCode": 200, "isHealthy": true }, { "endpoint": "https://yourserver.com/export/export-id/crawled-version", "httpStatusCode": 200, "isHealthy": true } ] } ``` ## Next Steps Learn how to initiate export requests for various scan artifacts. Understand the different types of webhooks and how to handle them. Learn how to present exported scan data to your users. --- ## Indexed Source: https://docs.copyleaks.com/reference/data-types/authenticity/webhooks/indexed > Copyleaks indexed the submitted file in its Shared Data Hub or repository. Copyleaks allows users to upload and index their existing documents into the Copyleaks Shared Data Hub without performing a scan. This feature enables future submissions to be compared against these stored documents for enhanced plagiarism detection. To activate the indexing mode, submit your content with the `properties.action=2` parameter. Indexing documents to the Copyleaks Shared Data Hub is free of charge. Once the document is processed, a webhook will notify you of the indexing status: - __Success:__ A webhook will confirm that your document has been indexed successfully. - __Error:__ If indexing fails, an error webhook will be triggered, providing details about the reason for the failure.
The current status of the scan. Possible values: 0 (Success), 1 (Error), 2 (CreditsChecked), 3 (Indexed) The developer payload that was provided in the submit method. `<= 512` characters ## Example ```json { "status": 3, "developerPayload": "Custom developer payload" } ``` ## Next Steps Learn about the different types of webhooks and how to handle them. Learn how to submit files for scanning, including enabling indexing. Understand how to compare documents within your Private Cloud Hub and against other sources. --- # Data Types → Authenticity → Private Cloud Hub ## Private Cloud Hub Source: https://docs.copyleaks.com/reference/data-types/authenticity/private-cloud-hub/overview > Explore the data types related to the Private Cloud Hub. This section provides detailed information about the data types related to the Private Cloud Hub. Data masking and privacy controls. User roles and permissions. Private Cloud Hub status codes and meanings. --- ## Masking Policy Source: https://docs.copyleaks.com/reference/data-types/authenticity/private-cloud-hub/masking-policy > Data masking and privacy controls Copyleaks Private Cloud Hub allows the user to choose how to share data in Private Cloud Hubs between its users. The Masking Policy determines how data will be shown to users when a document from the Private Cloud Hub is matched against in a scan. ## Available Values | ID | Masking Level | Description | |----|----------------------------|-------------| | **0** | **No Masking** | Users will be able to see the entire document. | | **1** | **Mask Other User Documents** | If the user who initiated the scan is also the contributor of the document to the Private Cloud Hub - No masking will be applied. Otherwise, all document characters and words that do not match identically will be replaced and masked with a sequence of hashtags. | | **2** | **Mask All Documents** | All document characters that do not match identically will be replaced with a sequence of hashtags. | ## Next Steps Understand user roles and permissions within the Private Cloud Hub. Check the status of your Private Cloud Hub, including storage capacity and usage. Learn how to compare documents within your Private Cloud Hub and against other sources. --- ## Roles Source: https://docs.copyleaks.com/reference/data-types/authenticity/private-cloud-hub/roles > User roles and permissions Private Cloud Hub provides a set of roles to control user access to your Hub. This is handy when having multiple users working with the same Private Cloud Hub. ## Available Roles | ID | Role | Permissions | |----|-------------|--------------| | **1** | **Viewer** | - Access partial info of the repository metadata
- Scan against the repository documents | | **2** | **Contributor** | - Full "Viewer" permissions
- Insert new documents to the repository
- Delete their submitted documents from the repository | | **3** | **Admin** | - Full "Contributor" permissions
- Invite other users to use the repository
- Delete documents from the repository | | **4** | **Super Admin** | - Full "Admin" permissions
- Delete all documents, including the entire repository
- Control and view billing information | ## Next Steps Check the status of your Private Cloud Hub, including storage capacity and usage. Learn about configuring masking policies for sensitive data within your Private Cloud Hub. Understand how to compare documents within your Private Cloud Hub and against other sources. --- ## Status Source: https://docs.copyleaks.com/reference/data-types/authenticity/private-cloud-hub/status > Private Cloud Hub status codes and meanings Each Private Cloud Hub maintains a status that can be used to know its state. This value can be used to identify issues with your Copyleaks Private Cloud Hubs. ## Available Values | ID | Status | Description | |----|-------------------------|-------------| | **0** | **Running** | Private Cloud Hub is healthy. | | **1** | **Pending For Deletion** | Private Cloud Hub is pending for deletion with all its documents and metadata. Private Cloud Hub is not available for use. | | **2** | **Error** | Private Cloud Hub is not healthy. It's recommended to contact [**Copyleaks Support**](https://api.copyleaks.com/support/contactus) for help. | | **3** | **Updating** | Maintenance processes are taking place. The Private Cloud Hub may not be available. | | **4** | **Payment Required** | Private Cloud Hub is suspended because of missing or failed payment. | ## Next Steps Understand user roles and permissions within the Private Cloud Hub. Learn about configuring masking policies for sensitive data within your Private Cloud Hub. Understand how to compare documents within your Private Cloud Hub and against other sources. --- # Data Types → AI Detector ## AI Detection Data Types Source: https://docs.copyleaks.com/reference/data-types/ai-detector/overview > Explore the data types related to AI content detection for text and images. This section provides detailed information about the data types returned by the AI Detection APIs. Response structure for the AI Content Detection API, including classification results and detailed explanations. Response structure for the AI Image Detection API, including summary scores and RLE mask data. Webhook response structure for the AI Video Detection API, including audio/visual analysis and overall AI ratio. --- ## AI Text Detection Response Source: https://docs.copyleaks.com/reference/data-types/ai-detector/ai-text-detector-response > Response structure and field definitions for the Copyleaks AI Content Detection API, including classification results and detailed explanations. import ResultAiDetection from '/snippets/result-ai-detection.mdx'; import SummaryAiDetection from '/snippets/summary-ai-detection.mdx'; import ScannedDocument from '/snippets/scanned-document.mdx'; The Copyleaks AI Content Detection API returns a comprehensive response that includes classification results, per-section `probability` values, and detailed explanations of the AI detection analysis. This response structure provides both high-level insights and granular details about detected AI-generated content patterns. ## Response Properties The version of the AI detection model used (e.g., "v9.0"). An array of classification results for different sections of the text. Metadata about the scan. ## Example Response ```json { "modelVersion": "v9.0", "results": [ { "classification": 2, "probability": 0.7316979, "matches": [ { "text": { "chars": { "starts": [0], "lengths": [554] }, "words": { "starts": [0], "lengths": [73] } } } ] } ], "summary": { "human": 0.0, "ai": 1.0 }, "scannedDocument": { "scanId": "scan-id", "totalWords": 73, "totalExcluded": 0, "credits": 1, "expectedCredits": 1, "creationTime": "2025-08-10T08:33:05.22225Z" }, "explain": { "patterns": { "statistics": { "aiCount": [1.2066389, 9.673915, 34.41001], "humanCount": [0.18481831, 0.13894142, 0.33555666], "proportion": [6.5287843, 69.625854, 102.54607], "source": [1, 1, 1] }, "text": { "chars": { "starts": [10, 96, 136], "lengths": [25, 33, 33] }, "words": { "starts": [1, 12, 17], "lengths": [4, 4, 5] } } } } } ``` ## Classification Codes | Code | Classification | Description | | ---- | -------------- | ----------------------------------------------------------------------- | | 1 | Human | Content is likely written by a human | | 2 | AI-generated | Content is likely generated by artificial intelligence | ## Next Steps Learn how to use the AI Content Detection API to identify AI-generated text. Explore the complete API reference for AI content detection. Understand how AI Logic provides transparency in AI detection results. --- ## AI Image Detection Response Source: https://docs.copyleaks.com/reference/data-types/ai-detector/ai-image-detection-response > Response structure and field definitions for the Copyleaks AI Image Detection API, including summary scores and RLE mask data. The Copyleaks AI Image Detection API returns a detailed response containing the analysis summary, image information, and a Run-Length Encoded (RLE) mask to identify AI-generated regions. ## Response Properties The version of the AI detection model used for the analysis. Contains the Run-Length Encoded (RLE) mask data. This can be used to visualize the AI-detected regions of the image. An array of starting positions for each AI-detected segment in the flattened 1D image array. An array of lengths for each AI-detected segment, corresponding to the `starts` array. An object containing the overall proportion of human vs. AI-generated pixels. The proportion of the image determined to be human-created. The value ranges from `0.0` to `1.0`. The proportion of the image determined to be AI-generated. The value ranges from `0.0` to `1.0`. Indicates whether the image was determined to be AI-generated. An object containing metadata about the analyzed image. The dimensions of the image. The height of the image in pixels. The width of the image in pixels. Optional metadata extracted from the image file. The timestamp (if available in EXIF data) indicating when the image was created. The AI service or tool that created the image, if this information is present in the metadata. The application or device used to create the image, if available in the metadata. A summary of how the image was generated., if available in the metadata. Metadata about the scan operation itself. The unique identifier for this scan, provided by you in the request. The actual number of credits consumed by the scan. The expected number of credits for the scan. The ISO 8601 timestamp indicating when the scan was created. ## Example Response ```json { "model": "ai-image-1-ultra", "result": { "starts": [0, 512, 1536, 2560], "lengths": [256, 512, 768, 1024] }, "summary": { "human": 0.3, "ai": 0.7 }, "isAiDetected": true, "imageInfo": { "shape": { "height": 1024, "width": 768 }, "metadata": { "issuedTime": "2025-07-23T12:44:05", "issuedBy": "OpenAI", "appOrDeviceUsed": "OpenAI-API", "contentSummary": "Created using generative AI" } }, "scannedDocument": { "scanId": "my-scan-id-1", "credits": 1, "expectedCredits": 1, "creationTime": "2023-01-10T10:07:58.9459512Z" } } ``` ## Next Steps Learn how to submit an image for AI detection and interpret the results. Explore the complete API reference for the AI Image Detection endpoint. --- ## AI Video Detection Response Source: https://docs.copyleaks.com/reference/data-types/ai-detector/ai-video-detection-response > Webhook response structure and field definitions for the Copyleaks AI Video Detection API. The Copyleaks AI Video Detection API delivers results asynchronously via webhook. The payload contains time-based detection data for the audio and visual tracks, overall AI ratios, video metadata, and scan details. ## Response properties The version of the AI detection model used for the analysis. Time-based AI detection results for the audio track. Positions and lengths are in milliseconds. Start positions (in ms) of AI-detected audio segments. Durations (in ms) of AI-detected audio segments, corresponding to each value in `starts`. Segments of the audio track that were not scored and are excluded from the AI ratio calculations. Start positions (in ms) of excluded audio ranges. Durations (in ms) of excluded audio ranges. Time-based AI detection results for the visual track. Positions and lengths are in milliseconds. Start positions (in ms) of AI-detected visual segments. Durations (in ms) of AI-detected visual segments, corresponding to each value in `starts`. Segments of the visual track that were not scored and are excluded from the AI ratio calculations. Start positions (in ms) of excluded visual ranges. Durations (in ms) of excluded visual ranges. Overall AI detection ratios calculated from the scored segments only. Segments listed in `exclude` are not included in any of these calculations. Ratio of AI-detected audio duration to total audible duration. Excluded audio ranges are not counted. Range: 0.0-1.0. Ratio of AI-detected visual duration to total visible duration. Excluded visual ranges are not counted. Range: 0.0-1.0. Combined AI ratio across both audio and visual tracks, relative to the total video duration. Range: 0.0-1.0. Information about the analyzed video. Total duration of the video in seconds. Optional metadata extracted from the video file (e.g. C2PA provenance data). Timestamp (if available) indicating when the video was created. The AI service or tool that created the video, if present in the metadata. The application or device used to create the video, if available in the metadata. A summary of how the video was generated, if available in the metadata. Metadata about the scan operation itself. The unique identifier for this scan, provided by you in the request. The actual number of credits consumed by the scan. The expected number of credits for the scan. The ISO 8601 timestamp indicating when the scan was created. ## Example response ```json { "model": "ai-video-1-pro", "audioResult": { "starts": [13000, 45000, 47000], "lengths": [14000, 1000, 8700], "exclude": { "starts": [0, 3250, 5400, 7600, 10500], "lengths": [2950, 1500, 1200, 650, 1050] } }, "visualResult": { "starts": [11566, 29433], "lengths": [6134, 26267], "exclude": { "starts": [], "lengths": [] } }, "summary": { "audioAIRatio": 0.4902, "visualAIRatio": 0.5817, "overallAIRatio": 0.7487 }, "videoInfo": { "metadata": { "issuedTime": "2026-03-17T13:14:57+00:00", "issuedBy": "OpenAI", "appOrDeviceUsed": "Sora", "contentSummary": "Created using generative AI" }, "duration": 55.7 }, "scannedVideo": { "scanId": "my-video-scan-1", "actualCredits": 1, "expectedCredits": 1, "creationTime": "2026-05-05T12:37:50Z" } } ``` ## Next steps Submit a video for AI detection and interpret the webhook results. The complete API reference for the AI Video Detection endpoint. --- # Data Types → Moderation ## Moderation Source: https://docs.copyleaks.com/reference/data-types/moderation/overview > Explore the data types related to content moderation. This section provides detailed information about the data types related to content moderation. A comprehensive list of the content categories supported by the Copyleaks Text Moderation API. --- ## Text Moderation Labels Source: https://docs.copyleaks.com/reference/data-types/moderation/text-moderation-labels > A comprehensive list of the content categories supported by the Copyleaks Text Moderation API. The Copyleaks Text Moderation API provides a flexible and powerful solution for identifying and managing a wide range of harmful or risky content. Our API supports a comprehensive set of moderation labels, allowing you to tailor the moderation process to your specific community standards. ## Supported Labels | Label ID | Description | | ------------------ | ------------------------------------------------------------------------------------ | | `toxic-v1` | Harmful language that insults, demeans, or degrades in a general way, not necessarily aimed at a specific person. This category is reserved for language intended to cause emotional harm, not for references to illegal or toxic substances. | | `profanity-v1` | Use of strong or offensive swear words. | | `hate-speech-v1` | Language that demonizes or incites harm toward a group or individual based on inherent traits, often calling for violence or systemic discrimination. | | `harassment-v1` | Targeted abuse that insults or degrades a specific person or group, focusing on personal traits or beliefs. This language aimed at a specific person or group that attacks their character or reputation, this can include defamatory or accusatory statements meant to harm someone’s standing. | | `self-harm-v1` | References that encourage or normalize self-injurious behavior. | | `adult-v1` | Explicit descriptions, references, or portrayals of sexual acts or behavior intended to evoke sexual arousal. This excludes non-sexual explicit content. | | `violent-v1` | Language that incites or glorifies physical harm or injury. | | `drugs-v1` | References, descriptions, or endorsements of the use, abuse, or distribution of drugs, including illegal substances or the misuse of legal drugs. | | `firearms-v1` | Content discussing the use, possession, or distribution of guns and other weapons, especially when such discussions could promote or cause violence or unsafe practices. | | `cybersecurity-v1` | Content related to computer security, including discussions on hacking, data breaches, and measures to hack digital systems or gain unauthorized access. | ## Usage When submitting text for moderation, include the desired labels in your request. You can specify all labels or only the ones relevant to your use case: **Request** ```http POST https://api.copyleaks.com/v1/text-moderation/{scanId}/check ``` **Headers** ```http Content-Type: application/json Authorization: Bearer YOUR_LOGIN_TOKEN ``` **Body** ```json { "text": "Your text content to be moderated goes here.", "language": "en", "labels": [ { "id": "toxic-v1" }, { "id": "profanity-v1" }, { "id": "hate-speech-v1" }, { "id": "harassment-v1" }, { "id": "self-harm-v1" }, { "id": "adult-v1" }, { "id": "violent-v1" }, { "id": "drugs-v1" }, { "id": "firearms-v1" }, { "id": "cybersecurity-v1" } ] } ``` Full details about the request and response structure can be found in the [Text Moderation API Reference](/reference/actions/text-moderation/check/). ## Next Steps Learn how to use the Text Moderation API to scan and moderate text content. Explore the complete API reference for text moderation, including request and response details. --- # Data Types → Writing ## Writing Source: https://docs.copyleaks.com/reference/data-types/writing/overview > Explore the data types related to Grammar Checker. This section provides detailed information about the data types related to Grammar Checker. Grammar Checker correction categories A snapshot of Grammar Checker results detected by Copyleaks. --- ## Grammar Checker Object Source: https://docs.copyleaks.com/reference/data-types/writing/writing-assistant > A snapshot of Grammar Checker results detected by Copyleaks. It provides detailed data on writing quality, corrections, and readability. import ScoreWritingFeedback from '/snippets/score-writing-feedback.mdx'; import CorrectionsWritingFeedbackResponse from '/snippets/corrections-writing-feedback-response.mdx'; import ScannedDocument from '/snippets/scanned-document.mdx'; The Grammar Checker object provides a comprehensive analysis of a submitted text, including scores, readability metrics, and detailed corrections. An object containing the overall score, readability, and text statistics. An object containing the detailed corrections for the text. Metadata about the scan. ## Example ```json { "score": { "corrections": { "grammarCorrectionsCount": 2, "grammarCorrectionsScore": 87, "grammarScoreWeight": 1.0, "mechanicsCorrectionsCount": 9, "mechanicsCorrectionsScore": 38, "mechanicsScoreWeight": 1.0, "sentenceStructureCorrectionsCount": 0, "sentenceStructureCorrectionsScore": 100, "sentenceStructureScoreWeight": 1.0, "wordChoiceCorrectionsCount": 1, "wordChoiceCorrectionsScore": 93, "wordChoiceScoreWeight": 1.0, "overallScore": 79 }, "readability": { "score": 59, "readabilityLevel": 5, "readabilityLevelText": "10th to 12th Grader", "readabilityLevelDescription": "Fairly difficult to read" }, "statistics": { "sentenceCount": 5, "averageSentenceLength": 12.2, "averageWordLength": 5.5, "readingTimeSeconds": 16.0, "speakingTimeSeconds": 28.2 } }, "corrections": { "text": { "chars": { "types": [ 5, 18, 3, 18, 18, 18, 18, 10, 18, 16, 18, 18 ], "starts": [ 13, 22, 61, 104, 118, 136, 179, 233, 288, 347, 353, 374 ], "lengths": [ 2, 10, 9, 6, 8, 35, 13, 9, 12, 4, 8, 11 ], "operationTexts": [ "an ", "plagiarism ", "businesses ", "their ", "original.", "texts from the internet and data bases ", "similarities.", "multilingual ", "positives, ", "it's ", "useful ", "maintaining " ] } } }, "scannedDocument": { "scanId": "{scanId}", "totalWords": 61, "totalExcluded": 0, "credits": 1, "expectedCredits": 1, "creationTime": "2025-08-11T06:46:01.2886658Z" } } ``` ## Next Steps Learn how to use the Grammar Checker API to detect and correct writing issues. See a detailed list of all supported correction types and languages. Learn how to export scan results, including Grammar Checker data. --- ## Correction Types Source: https://docs.copyleaks.com/reference/data-types/writing/correction-types > Grammar Checker correction categories Each detected correction has an attached type. These types may be used to understand what error was detected and show it in the user interface. You are able to fetch the list of correction types programmatically using the following [endpoint](/reference/actions/writing-assistant/correction-types). ## Categories | id | Category| |----|----------------| | 1 | Sentence Structure| | 2 | Grammar| | 3 | Word Choice| | 4 | Mechanics| ## Types | ID | Title | Message | Description | Category | |------|-------------------------|---------------------------------------|-------------------------------------------------------------------------------------------------------------------|----------| | `1` | General | A general correction detected | A general correction detected. | 2 | | `2` | Subject Verb Disagreement| Subject-verb disagreement detected | The subject and verb do not agree in number. | 2 | | `3` | Noun Form | Use a different noun form | Using an incorrect form of a noun (such as pluralization or possessive form) in a sentence. | 2 | | `4` | Verb Form | Use a different verb form | Using an incorrect form of a verb (such as tense, aspect, or agreement) in a sentence results. | 2 | | `5` | Article | Use the appropriate article | Using the wrong article (a, an, or the) or omitting an article inappropriately in a sentence. | 2 | | `6` | Preposition | Incorrect preposition usage | Using the wrong preposition or misplacing a preposition in a sentence. | 2 | | `7` | Pronoun | Incorrect pronoun usage | Using an incorrect pronoun or misplacing a pronoun in a sentence. | 2 | | `8` | Part of Speech | Incorrect part of speech | Misusing or misidentifying a word's grammatical category, such as confusing a noun with a verb. | 2 | | `9` | Conjunction | Incorrect conjunction usage | Misusing or misplacing conjunctions, which are words that connect words, phrases, or clauses in a sentence. | 2 | | `10` | Misused Word | Use a different word to convey the message | Words that are used incorrectly or inappropriately in a given context. | 3 | | `11` | Homophone | Incorrect homophone usage detected | Confusing two words that phonetically sound similar but have a different meaning (e.g., "their" and "there" or "to" and "too"). | 3 | | `12` | Capitalization | Incorrect capitalization | Word was not capitalized correctly (e.g., “paris” should be “Paris”). | 4 | | `13` | Hyphen | Hyphen usage is incorrect | Incorrect or inconsistent use of hyphens in a sentence. | 4 | | `14` | Punctuation | Incorrect punctuation usage | Incorrect use of punctuation marks, such as commas, periods, semicolons, or colons. | 4 | | `15` | Comma | Incorrect comma usage | Incorrect use of commas in sentences. | 4 | | `16` | Apostrophe | Incorrect apostrophe usage | Incorrect use of apostrophes in sentences. | 4 | | `17` | Space | Missing or extra spaces | Missing or extra spaces detected in sentence. | 4 | | `18` | Spelling | Misspelling detected | Misspelling of a word. | 4 | | `19` | Fused Sentence | Fused sentence detected | When two independent clauses are incorrectly joined without appropriate punctuation or conjunction. | 1 | | `20` | Comma Splice | Comma splice detected | Two independent clauses are incorrectly joined by a comma without a coordinating conjunction or appropriate punctuation. | 1 | | `21` | Sentence Fragments | Ensure your sentence has a complete subject and predicate | When a group of words appears to be a sentence but is incomplete because it lacks a subject, a predicate, or both. | 1 | | `22` | Ineffective Construction| Revise the sentence for better clarity and structure | Refers to sentences or phrases that are poorly constructed or lack clarity, making it difficult for readers to understand the intended meaning. | 1 | | `23` | Extra Words | Sentence contains extra words | Sentences that contain unnecessary or redundant words, which can be removed for clearer and more concise writing. | 1 | | `24` | Missing Words | Sentence with missing words | Identifies sentences that are missing essential words, resulting in incomplete or unclear meaning. | 1 | | `25` | Adjective Gender Agreement | Gender agreement mismatch in adjectives | Detects errors in the gender agreement between adjectives and nouns. | 2 | | `26` | Adjective Number Agreement | Number agreement error with adjectives | Highlights discrepancies in the number agreement between adjectives and nouns for improved grammatical precision. | 2 | | `27` | Article Gender Agreement | Gender agreement error in articles | Agreement between articles and nouns in terms of gender is incorrect , ensuring grammatical accuracy. | 2 | | `28` | Article Number Agreement | Number agreement error in articles | Number mismatch between articles and nouns creating inconsistency in how they refer to the same or similar elements in a sentence. | 2 | | `29` | Noun Gender Agreement | Gender agreement error with nouns | Lack of agreement between nouns and their associated genders, ensuring grammatical harmony. | 2 | | `30` | Subjunctive Mood | Subjunctive mood misuse | Identifies the incorrect usage of the subjunctive mood in sentences, ensuring proper expression of hypothetical or unreal situations. | 2 | | `31` | Compound Word Error | Compound word usage error | Identifies incorrect compound word usage. | 2 | | `32` | Mood Inconsistency | Inconsistency in mood detected | Detects inconsistencies in the expression of mood within a sentence, ensuring cohesive writing. | 2 | | `33` | Accent Error | Incorrect or missing usage of accents | Highlights deviations in accents, promoting uniform language usage. | 4 | | `34` | Homoglyph Error | Homoglyphs detected in text | Non-standard characters that appear identical or very similar but have a different meaning have been detected. | 2 | ## Next Steps Learn how to use the Grammar Checker API to detect and correct writing issues. Explore the complete API reference for Grammar Checker, including request and response details. ---