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 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 text detection, and exporting the results.

Get started

1

Before you begin

Before you start, ensure you have the following:
2

Installation

Choose your preferred method for making API calls.
3

Login

To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer <TOKEN> header. This token remains valid for 48 hours.
Response
4

Submit for scanning

File Upload

Submit documents including PDF, DOCX, TXT, and other formats for scanning.

URL Scanning

Submit webpages and online documents directly by providing their URL.

Text from Images

Extract and scan text from images, including screenshots and photos.
For this guide, we’ll demonstrate document submission. Each submission requires a unique scanId for proper tracking and identification.
5

Wait for the completed webhook

The scan times differ depending on document length. Once it’s complete, Copyleaks will send a completed webhook to the status URL you provided.
6

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 results.
7

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:
  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 Text Detection Result data type.
  2. Crawled Version: This is the plain text or HTML representation of the original scanned document. See the Crawled Version data type.
Your export request must specify a completionWebhook to be notified when the exported data is ready for download.
8

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

Next steps

Webhooks Overview

Learn how to securely receive and process notifications from Copyleaks.

Viewing AI Detection Results

Understand the AI detection result format and how to display confidence scores to your users.