Skip to content
Authenticity

Export

POST https://api.copyleaks.com/v3/downloads/{scanId}/export/{exportId}

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.

exportId string required

A new Id for the export process.

>= 3 characters <= 36 characters

Match pattern: [a-z0-9] !@$^&-+%=_(){}<>';:/.",~|`

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

Match pattern: [a-z0-9] !@$^&-+%=_(){}<>';:/.",~|`

Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN

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

id string required

Result identification to be downloaded. You get these identifications from the completed webhook.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

pdfReport object

Download the PDF report. Allowed only when properties.pdf.create was set to true on the scan submission.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

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.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

writingFeedback object

Export the Writing Assistant report. Allowed only when properties.writingFeedback.enable was set to true on the scan submission. Learn more about Writing Assistant Webhook.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

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.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

crawledVersion object

Download the crawled version of the submitted text. Learn more about Crawled-Version Webhook.

endpoint string<uri> required

The HTTP url to upload the data.

verb string required

The HTTP verb (also called “HTTP Methods”) to upload the data to your specified endpoint.


Example: POST

headers array[array]

(Jagged Array)


List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as “Authorization” header.

204 No Content

The command was executed. The export started.

400 Bad Request

Bad request. One or more details in your request is wrong.

Example Response

A typical response from this endpoint:

Scan wasn't finished yet.
POST https://api.copyleaks.com/v3/downloads/my-scan-123/export/my-export-1
Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN
{
"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",
"headers": [
[
"header-key",
"header-value"
]
],
"endpoint": "https://yourserver.com/export/export-id/pdf-report"
}
],
"crawledVersion": {
"verb": "POST",
"headers": [
[
"header-key",
"header-value"
]
],
"endpoint": "https://yourserver.com/export/export-id/crawled-version"
},
"completionWebhook": "https://yourserver.com/export/export-id/completed",
"maxRetries": 3
}