# Export

> Export the full raw scan information and push it to your servers.

<RequestExample>

```bash title="cURL" icon="terminal"
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
  }'
```

```python title="Python" icon="python"
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.export import Export, ExportResult, ExportPdf, ExportCrawledVersion

auth_token = Copyleaks.login("your@email.address", "YOUR_API_KEY")

result = ExportResult()
result.set_id("my-result-id")
result.set_endpoint("https://yourserver.com/export/export-id/results/my-result-id")
result.set_verb("POST")

pdf = ExportPdf()
pdf.set_endpoint("https://yourserver.com/export/export-id/pdf-report")
pdf.set_verb("POST")

crawled = ExportCrawledVersion()
crawled.set_endpoint("https://yourserver.com/export/export-id/crawled-version")
crawled.set_verb("POST")

export = Export()
export.set_results([result])
export.set_pdf_report(pdf)
export.set_crawled_version(crawled)
export.set_completion_webhook("https://yourserver.com/export/export-id/completed")
export.set_max_retries(3)

Copyleaks.export(auth_token, "my-scan-123", "my-export-1", export)
```

</RequestExample>

<ResponseExample>

```json 204 No Content
{}
```

</ResponseExample>

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.

<Warning>
**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 &lt;Your-Login-Token&gt;**
</Warning>

## Request

### Path Parameters

<ParamField path="exportId" type="string" required>
  A new Id for the export process.

      `>= 3 characters` `<= 36 characters`
</ParamField>
<ParamField path="scanId" type="string" required>
  The scan ID of the specific scan to export. Learn more about [the criteria for creating a Scan ID](/concepts/management/choosing-scan-id).

      `>= 3 characters` `<= 36 characters`
</ParamField>

### Headers

```http
Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN
```

### Request Body

The request body is a JSON object containing the export configuration.

<ExportRequestBody />

## Responses

<Tabs>
  <Tab title="204">
    <Check>**204 No Content** - The command was executed. The export started.</Check>
  </Tab>
  <Tab title="400">
    <Warning>**400 Bad Request** - Bad request. One or more details in your request is wrong.</Warning>
  </Tab>
  <Tab title="401">
    <Warning>**401 Unauthorized** - Authorization has been denied for this request.</Warning>
  </Tab>
  <Tab title="404">
    <Warning>**404 Not Found** - The scan id that was specified doesn't exist.</Warning>
  </Tab>
  <Tab title="409">
    <Warning>**409 Conflict** - Conflict. An export task with the same Id already exists in the system.</Warning>
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="Webhooks Overview" icon="plug" href="/reference/data-types/authenticity/webhooks/overview/">Learn about the different types of webhooks and how to handle them, including export completion webhooks.</Card>
  <Card title="Export Completed Webhook" icon="file-export" href="/reference/data-types/authenticity/webhooks/export-completed/">Understand the details provided in the export completed webhook.</Card>
  <Card title="How to Display Scan Reports" icon="list-check" href="/concepts/features/how-to-display/">Learn how to present exported scan data to your users.</Card>
</CardGroup>
