POST
/
v3
/
downloads
/
{scanId}
/
export
/
{exportId}
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
  }'
{}
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
  }'
{}
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

exportId
string
required
A new Id for the export process.>= 3 characters <= 36 characters
scanId
string
required
The scan ID of the specific scan to export. Learn more about the criteria for creating a Scan ID.>= 3 characters <= 36 characters

Headers

Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN

Request Body

The request body is a JSON object containing the export configuration.
completionWebhook
string
required
This webhook event is triggered once the export is completed.
completionWebhookHeaders
array[array]
Adds headers to the webhook.Example: [ [ "header-key", "header-value" ], ... ]
maxRetries
integer
default:"3"
How many retries to send before giving up. Using high value (12) may lead to a longer time until the completionWebhook being executed. A low value (1) may lead to errors while your service is temporary having problems.>= 1 <= 12
developerPayload
string
Add a custom developer payload that will then be provided on the Export-Completed webhook.
results
array[object]
An array of results to be exported. Learn more about Result Webhook.<= 1000 items
pdfReport
object
Download the PDF report. Allowed only when properties.pdf.create was set to true on the scan submission.
aiDetection
object
Export the AI Content detection report. Allowed only when properties.aiGeneratedText.detect was set to true on the scan submission. Learn more about AI Content Detection Webhook.
writingFeedback
object
Export the Grammar Checker report. Allowed only when properties.writingFeedback.enable was set to true on the scan submission. Learn more about Grammar Checker Webhook.
overview
object
Export the Overview report. Allowed only when properties.overview.enable was set to true on the scan submission. Learn more about Overview Webhook.
crawledVersion
object
Download the crawled version of the submitted text. Learn more about Crawled-Version Webhook.

Responses

204 No Content The command was executed. The export started.

Next Steps

Webhooks Overview

Learn about the different types of webhooks and how to handle them, including export completion webhooks.

Export Completed Webhook

Understand the details provided in the export completed webhook.

How to Display Scan Reports

Learn how to present exported scan data to your users.