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
}
}'
import base64
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.document import FileDocument
from copyleaks.models.submit.properties.scan_properties import ScanProperties
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
with open("file.txt", "rb") as f:
b64 = base64.b64encode(f.read()).decode("utf-8")
submission = FileDocument(b64, "file.txt")
properties = ScanProperties("https://my-server.com/webhook/{STATUS}")
properties.set_sandbox(True)
submission.set_properties(properties)
Copyleaks.submit_file(auth_token, "my-scan-123", submission)
const { Copyleaks, CopyleaksFileSubmissionModel } = require('copyleaks');
const fs = require('fs');
async function main() {
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);
}
main();
import classes.Copyleaks;
import models.response.CopyleaksAuthToken;
import models.submissions.CopyleaksFileSubmissionModel;
import models.submissions.properties.*;
import java.util.Base64;
import java.nio.file.*;
CopyleaksAuthToken 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));
(no response body)
Authenticity
Submit File
Scan files to find where the content has been used elsewhere and check its originality.
PUT
/
v3
/
scans
/
submit
/
file
/
{scanId}
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
}
}'
import base64
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.document import FileDocument
from copyleaks.models.submit.properties.scan_properties import ScanProperties
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
with open("file.txt", "rb") as f:
b64 = base64.b64encode(f.read()).decode("utf-8")
submission = FileDocument(b64, "file.txt")
properties = ScanProperties("https://my-server.com/webhook/{STATUS}")
properties.set_sandbox(True)
submission.set_properties(properties)
Copyleaks.submit_file(auth_token, "my-scan-123", submission)
const { Copyleaks, CopyleaksFileSubmissionModel } = require('copyleaks');
const fs = require('fs');
async function main() {
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);
}
main();
import classes.Copyleaks;
import models.response.CopyleaksAuthToken;
import models.submissions.CopyleaksFileSubmissionModel;
import models.submissions.properties.*;
import java.util.Base64;
import java.nio.file.*;
CopyleaksAuthToken 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));
(no response body)
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
}
}'
import base64
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.document import FileDocument
from copyleaks.models.submit.properties.scan_properties import ScanProperties
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
with open("file.txt", "rb") as f:
b64 = base64.b64encode(f.read()).decode("utf-8")
submission = FileDocument(b64, "file.txt")
properties = ScanProperties("https://my-server.com/webhook/{STATUS}")
properties.set_sandbox(True)
submission.set_properties(properties)
Copyleaks.submit_file(auth_token, "my-scan-123", submission)
const { Copyleaks, CopyleaksFileSubmissionModel } = require('copyleaks');
const fs = require('fs');
async function main() {
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);
}
main();
import classes.Copyleaks;
import models.response.CopyleaksAuthToken;
import models.submissions.CopyleaksFileSubmissionModel;
import models.submissions.properties.*;
import java.util.Base64;
import java.nio.file.*;
CopyleaksAuthToken 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));
(no response body)
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.
>= 3 characters <= 36 charactersMatch pattern: [a-z0-9!@$&=_()';:.,~-]Scan IDs that contain g, then one or more o or 0, then gle (for example google, gogle, g00gle) are rejected.Headers
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.pdfConfiguration options for the scan.
Show properties
Show properties
The type of submission action.
0: Scan - Start scan immediately.1: Check Credits - Check how many credits will be used for this scan.2: Index Only - Only index the file in the Shared Data Hub or a Private Cloud Hub (depending onproperties.indexing). No credits will be used.
By default, Copyleaks will present the report in text format. If set to
true, Copyleaks will also include html format.true: results will be generated as HTML format, if possible. Otherwise, it will be generated as text format.false: results will be generated as text format.
Add custom developer payload that will then be provided on the webhooks.
<= 512 charactersYou can test the integration with the Copyleaks API for free using the sandbox mode.You will be able to submit content for a scan and get back mock results, simulating the way Copyleaks will work to make sure that you successfully integrated with the API.Turn off this feature on production environment.Rate Limiting: This method has a maximum call rate limit of 100 sandbox scans within 1 hour.
Maximum retention of the scan, in hours, on the Copyleaks servers. Once expired, the scan is removed and is no longer accessible.
>= 1 <= 2880- The retention window is measured from the moment the scan completes (successfully or with an error), not from submission. A scan that takes N hours to run stays available for
expirationhours after it finishes. - Expiry marks the scan as eligible for deletion. Deletion runs in an hourly cleanup, so removal can lag expiry by up to one hour.
- Failed scans are retained for at most
expirationhours, and never longer than 48 hours. Exception: scans submitted from the Copyleaks web app that fail for insufficient credits are kept for 14 days so they can be paid for and resubmitted. - Values below 1 hour are not supported. To remove a scan immediately after fetching its results, call Delete (
PATCH /v3.1/scans/delete).
Choose the algorithm goal. You can set this value depending on your use-case.
- 0 - MaximumCoverage: prioritize higher similarity score.
- 1 - MaximumResults: prioritize finding more sources.
Add custom properties that will be attached to your document in a Private Cloud Hub.If this document is found as a Private Cloud Hub result, your custom properties will be added to the result.Example:
[
{ "key": "Test1", "value": "Test1" }
]
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.Currently supported languages:
| Code | Language |
|---|---|
en | English |
es | Spanish |
de | German |
fr | French |
it | Italian |
pt | Portuguese |
Specify the timezone for the scan time displayed on the final PDF report. The value must be a valid, case-sensitive IANA Time Zone name (e.g., America/New_York). If unspecified, the timezone defaults to the user’s country, or UTC if their country is unknown.Available Options: see the full list of IANA Time Zones.
You can control the level of plagiarism sensitivity that will be identified according to the speed of the scan. If you prefer a faster scan with the results that contains the highest amount of plagiarism choose 1, and if a slower, more comprehensive scan, that will also detect the smallest instances choose 5.Range between 1 (faster) to 5 (slower but more comprehensive).
When set to true, the submitted document is checked for text manipulation that can affect scan results, such as look-alike character replacement, invisible or white text (PDF and DOCX only), or excluding most of the text. If any of these is detected, a scan alert is added to the completed webhook.
The
webhooks object is where you define the callback URLs for Copyleaks to send notifications to. This object is required.Show webhooks properties
Show webhooks properties
A URL that will be called when the scan status changes. Use the
{STATUS} placeholder, which will be replaced with completed, error, creditschecked, or indexed (always lowercase). Example: https://yoursite.com/webhook/{STATUS}Fine-tune what kind of results are included in the scan report.
Show filters properties
Show filters properties
Define the sources to compare your document against.
Show scanning properties
Show scanning properties
Show exclude properties
Show exclude properties
Exclude submissions from results if their ID matches the supplied pattern. Matched submissions will be excluded from both Shared Data Hub and Private Cloud Hub results.Supported pattern wildcards:
*- Matches any number of characters (including zero).- Matches exactly one non-whitespace character
abc*- Excludes submissions with IDs starting with “abc”ab..- Excludes submissions with exactly 4-character IDs starting with “ab”
Exclude results that contain backlinks to these specific domains. Maximum 10 domains. Each domain: 1-256 characters.
Specify which Private Cloud Hubs to scan the document against.
Show Private Cloud Hub properties
Show Private Cloud Hub properties
Configure scanning against the Shared Data Hub.
Show copyleaksDb properties
Show copyleaksDb properties
When true, Copyleaks also compares against content that YOU uploaded to the Shared Data Hub. If
indexing.copyleaksDb is omitted, turning this on also adds the scanned document to the Shared Data Hub.Configure cross-language plagiarism detection.
Show crossLanguages properties
Show crossLanguages properties
Cross language plagiarism detection. Choose which languages to scan your content against. For each additional language chosen, your pages will be deducted per page submitted. The language of the original document submitted is always scanned, therefore should not be included in the additional languages chosen. Supported languages list.
Configure where to index the submitted content.
Show indexing properties
Show indexing properties
Specify which Private Cloud Hubs to index the scanned document to. Each entry is an object with the hub’s repository
id, for example [{ "id": "my-repo-id" }].Add the submitted document to the Shared Data Hub. When omitted, it follows
scanning.copyleaksDb: if includeMySubmissions or includeOthersSubmissions is true, the document is added. Setting it to false while scanning against the Shared Data Hub returns 400 Bad Request unless your account is configured to allow it.Configure what content to exclude from the scan.
Show exclude properties
Show exclude properties
When the scanned document is an HTML document, exclude irrelevant text that appears across the site like the website footer or header.
Configure and request a PDF report of the scan results.
Show pdf properties
Show pdf properties
Specifies which version of the PDF report to generate (
v1, v2, v3, latest). Overrides version.Customize the highlight colors used in the PDF report.
Show colors properties
Show colors properties
Configure AI-generated text detection.
Show aiGeneratedText properties
Show aiGeneratedText properties
How strong the AI signal in a passage must be before it is flagged, from
1 (most conservative) to 3 (most sensitive). See what each level does.Show explain properties
Show explain properties
Enable AI Logic feature for AI detection. Explanations are returned for six languages only; for any other language the scan completes with the detection result, no explanations, and an
ai-insights-lang-unsupported scan alert.Mask sensitive data from the scanned document with
# characters. Available for users on a plan for 2500 pages or more.Show sensitiveDataProtection properties
Show sensitiveDataProtection properties
Mask driver’s license numbers (supports Australia, Canada, UK, USA, Japan, Spain, Germany).
Mask credentials such as authentication tokens, AWS/Azure/GCP keys, JWTs, passwords, etc.
Configure the automated Grammar Checker.
Show writingFeedback properties
Show writingFeedback properties
Configure the weighting of different categories in the overall writing score.
Show score properties
Show score properties
Enable Gen-AI Overview feature to extract key insights from the scan data.
Show overview properties
Show overview properties
The AI Source Match feature enhances plagiarism detection by identifying online sources that are suspected of containing AI-generated text.
The Internal AI Source Match feature enhances plagiarism detection by identifying sources in the Copyleaks internal AI database that contain AI-generated text.
Check the references and citations found in the submitted text with the Citation Checker feature.
Show references properties
Show references properties
Cross-check the in-text citations against the reference list: flag citations with no matching entry and entries that are never cited. Turns on
validate automatically. See Citations Cross-Check.
