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

1

Before you begin

Before you start, ensure you have the following:
2

Installation

Choose your preferred method for making API calls.
HTTP needs no installation - call the API with any standard HTTP client, or import our Postman collection for a quicker start.
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
Save this token. It is valid for 48 hours and can be reused for subsequent API calls.
4

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.
Make sure to keep track of the scanId (in this case my-template-index) as you will need it for the next step.
5

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.
You can provide multiple template IDs in the documentTemplateIds array if you need to exclude content from multiple templates.
6

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

Check for Plagiarism

Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content.

Detect AI-Generated Content

Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async.

Assess Grammar and Writing Quality

Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs.

Moderate Text

Scan and moderate text content for unsafe or policy-relevant material across 10+ categories.