> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agribackup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a Bulk Compliance Archive Report

> Trigger an asynchronous job to compile all DDS XML payloads, Hedera state proofs, and land tenure document hashes into a single cryptographic ZIP archive.

When you need to produce a complete compliance package — for an annual regulatory submission, a third-party audit, or internal records retention — this endpoint lets you trigger the asynchronous compilation of all your EUDR compliance assets into a single, cryptographically sealed ZIP archive. The archive bundles DDS XML payloads, Hedera state proofs, Merkle evidence, and land tenure document hashes for a defined date range. Because archive generation is computationally intensive, the endpoint returns a `202 Accepted` with a `reportId` immediately, and fires a `report.ready` webhook once the ZIP is available for download.

## Endpoint

`POST /api/v1/enterprise/eudr/reports/archive`

## Request Parameters

<ParamField body="startDate" type="string" required>
  The start date of the reporting range in `YYYY-MM-DD` format (e.g., `2026-01-01`). Records created on or after this date will be included in the archive.
</ParamField>

<ParamField body="endDate" type="string" required>
  The end date of the reporting range in `YYYY-MM-DD` format (e.g., `2026-03-31`). Records created on or before this date will be included in the archive.
</ParamField>

## Response Fields

<ResponseField name="reportId" type="string">
  The unique identifier for the archive report job. Use this ID with the Download Archive endpoint once the `report.ready` webhook is received.
</ResponseField>

<ResponseField name="status" type="string">
  The initial status of the archive job. Will be `ACCEPTED` immediately after the request is received and processing begins.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message confirming the asynchronous job has started and describing the expected completion mechanism.
</ResponseField>

## Code Examples

<CodeGroup>
  ```python Python theme={null}
  import agribackup
  from agribackup.rest import ApiException

  configuration = agribackup.Configuration(host="https://live.agribackup.com/api/v1")
  configuration.api_key['ApiKeyAuth'] = 'sk_live_YOUR_API_KEY'

  with agribackup.ApiClient(configuration) as api_client:
      try:
          archival_api = agribackup.EnterpriseArchivalApi(api_client)

          request = agribackup.ArchiveReportRequest(
              start_date="2026-01-01",
              end_date="2026-03-31"
          )

          response = archival_api.trigger_archive_report(archive_report_request=request)

          print("Report ID:", response.report_id)
          print("Status:", response.status)
          print("Message:", response.message)

      except ApiException as e:
          print("Exception when calling EnterpriseArchivalApi: %s\n" % e)
  ```

  ```javascript Node.js theme={null}
  import { AgriBackupClient } from '@agribackup/sdk';

  const client = new AgriBackupClient({
    apiKey: 'sk_live_YOUR_API_KEY',
    baseUrl: 'https://live.agribackup.com/api/v1'
  });

  async function generateArchiveReport() {
    try {
      const response = await client.archival.triggerArchiveReport({
        startDate: '2026-01-01',
        endDate: '2026-03-31'
      });

      console.log('Report ID:', response.reportId);
      console.log('Status:', response.status);
      console.log('Message:', response.message);
    } catch (error) {
      console.error('Error generating archive report:', error.message);
    }
  }

  generateArchiveReport();
  ```

  ```bash cURL theme={null}
  curl --request POST \
    --url https://live.agribackup.com/api/v1/enterprise/eudr/reports/archive \
    --header 'X-API-Key: sk_live_YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "startDate": "2026-01-01",
      "endDate": "2026-03-31"
    }'
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "reportId": "rep_9a8b7c",
  "status": "ACCEPTED",
  "message": "Bulk report generation started. A 'report.ready' webhook will be fired upon completion."
}
```

<Note>
  This endpoint operates asynchronously. Your application should listen for the `report.ready` webhook event, which delivers the `reportId` you need to call the Download Archive endpoint. You can also poll the Jobs API to track progress if webhooks are not configured.
</Note>

<Warning>
  Archive generation for large date ranges covering many batches may take several minutes. Avoid submitting duplicate archive requests for the same date range in quick succession, as each request triggers a separate compilation job.
</Warning>
