Skip to main content
Reports are generated from alerts and contain the regulatory output files (e.g., XML for Mexico). Reports are read-only — they are created automatically when you generate an alert.

Report Workflow

  1. Create an alert and add items (see Alerts)
  2. Validate and generate the alert
  3. A Report is created automatically with the output file
  4. Retrieve and download the report

Retrieving Reports

const report = await sdk.reports.retrieve("report_123");

console.log(report.id);
console.log(report.status); // "completed"
console.log(report.createdAt);

Listing Reports

// List all reports
const { data: reports } = await sdk.reports.list({
  filter: { status: "completed" },
  sort: { field: "createdAt", order: "desc" },
  limit: 20,
});

// Async iteration
for await (const report of sdk.reports.iterate()) {
  console.log(report.id, report.status);
}

Reports for a Specific Alert

const { data: alertReports } = await sdk.reports.listByAlert("alert_123", {
  currentOnly: true, // Only the latest version
});

Downloading Reports

Reports contain generated files (XML, etc.) stored in cloud storage. Use getDownloadUrl to get a temporary presigned URL:
const { url, expiresAt } = await sdk.reports.getDownloadUrl("report_123");

// Download the file
const response = await fetch(url);
const xml = await response.text();
Download URLs are temporary. Use them immediately or within the expiry window.

Counting Reports

const count = await sdk.reports.count({ status: "completed" });
console.log(`${count} completed reports`);

Report Status

StatusDescription
completedReport generated successfully
failedReport generation failed
processingReport is being generated

Available Methods

MethodDescription
retrieveGet a report by ID
listList reports with filters
listByAlertList reports for a specific alert
countCount reports matching a filter
getDownloadUrlGet presigned download URL
iterateAsync iterate over all reports
See the SDK reference for full details on parameters and return types.