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

# Data Extraction & Reporting

> Export submissions, generate reports, and integrate with BI tools

## Overview

Xenia provides comprehensive data extraction APIs for exporting submission data, generating analytics reports, and integrating with business intelligence platforms.

**Export Formats:**

* Excel (.xlsx) - Bulk submission exports with custom columns
* PDF - Individual and merged submission reports
* JSON - Spreadsheet data and analytics APIs
* CSV - Task and compliance reports

**Key Capabilities:**

* Bulk submission exports with filtering
* Real-time task and compliance analytics
* Scheduled automated report delivery
* BI platform integration (ChartBrew, custom dashboards)

***

## Submission Exports

### Export to Excel

Generate an Excel export of submissions for a template.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/checklists/{checklistId}/logs-excel" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "filters": {
        "startDate": "2024-01-01",
        "endDate": "2024-12-31",
        "locationIds": ["location-uuid-1", "location-uuid-2"],
        "status": "completed"
      },
      "columns": ["submittedAt", "location", "submittedBy", "score", "status"],
      "includeNotes": true,
      "includeAttachments": false
    }'
  ```
</CodeGroup>

**Request Body:**

| Field                 | Type    | Required | Description                                                    |
| --------------------- | ------- | -------- | -------------------------------------------------------------- |
| `filters`             | object  | No       | Filter criteria                                                |
| `filters.startDate`   | string  | No       | Start date (ISO format)                                        |
| `filters.endDate`     | string  | No       | End date (ISO format)                                          |
| `filters.locationIds` | array   | No       | Filter by location UUIDs                                       |
| `filters.status`      | string  | No       | Filter by status: `draft`, `completed`, `approved`, `rejected` |
| `columns`             | array   | No       | Columns to include in export                                   |
| `includeNotes`        | boolean | No       | Include submission notes                                       |
| `includeAttachments`  | boolean | No       | Include attachment URLs                                        |
| `recipientEmail`      | string  | No       | Email to send completed export                                 |

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "message": "Excel export started. You will receive an email when ready.",
  "data": {
    "exportId": "export-uuid",
    "estimatedRecords": 1500,
    "status": "processing"
  }
}
```

<Note>
  Large exports are processed asynchronously. The completed file is sent via email or can be retrieved via the export status endpoint.
</Note>

### Export to PDF

Generate PDF reports for submissions.

<CodeGroup>
  ```bash cURL theme={null}
  # Single submission PDF
  curl -X POST "https://api.xenia.team/api/v1/ops/checklists/{checklistId}/logs-pdf" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "submissionIds": ["submission-uuid-1"],
      "includePhotos": true,
      "includeSignatures": true,
      "includeNotes": true
    }'
  ```
</CodeGroup>

<CodeGroup>
  ```bash cURL (Merged PDF) theme={null}
  # Merge multiple submissions into one PDF
  curl -X POST "https://api.xenia.team/api/v1/ops/checklists/{checklistId}/logs-pdf" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "submissionIds": ["submission-uuid-1", "submission-uuid-2", "submission-uuid-3"],
      "mergeIntoOne": true,
      "includePhotos": true
    }'
  ```
</CodeGroup>

**Request Body:**

| Field               | Type    | Required | Description                 |
| ------------------- | ------- | -------- | --------------------------- |
| `submissionIds`     | array   | Yes      | Submission UUIDs to export  |
| `mergeIntoOne`      | boolean | No       | Combine all into single PDF |
| `includePhotos`     | boolean | No       | Include captured photos     |
| `includeSignatures` | boolean | No       | Include signatures          |
| `includeNotes`      | boolean | No       | Include notes               |
| `recipientEmail`    | string  | No       | Email for delivery          |

### Get Spreadsheet Data

Retrieve submission data in JSON spreadsheet format.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/checklists/submissions-spreadsheet" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "checklistId": "template-uuid",
      "startDate": "2024-12-01",
      "endDate": "2024-12-31",
      "locationIds": ["location-uuid"],
      "page": 1,
      "pageSize": 100
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": {
    "headers": [
      "Submission ID",
      "Submitted At",
      "Location",
      "Submitted By",
      "Score",
      "Question 1",
      "Question 2"
    ],
    "rows": [
      [
        "sub-uuid-1",
        "2024-12-23T10:00:00Z",
        "Downtown Store",
        "John Doe",
        "95%",
        "Yes",
        "Pass"
      ]
    ],
    "pagination": {
      "page": 1,
      "pageSize": 100,
      "total": 250,
      "totalPages": 3
    }
  }
}
```

### Public PDF Reports

Generate a public PDF for sharing (requires public report enabled).

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/public/submissions/{submissionId}/pdf" \
    -H "Content-Type: application/json" \
    -d '{
      "includePhotos": true,
      "format": "detailed"
    }'
  ```
</CodeGroup>

### Get Submission Attachments

Retrieve all attachments from submissions.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/checklists/logs/attachments" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "submissionIds": ["submission-uuid-1", "submission-uuid-2"],
      "attachmentTypes": ["image", "document", "signature"]
    }'
  ```
</CodeGroup>

***

## Task Analytics

Real-time analytics endpoints for task performance and compliance tracking.

### Task Count by Status

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/count-by-status" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-12-01",
      "endDate": "2024-12-31",
      "locationIds": ["location-uuid"],
      "assigneeIds": ["user-uuid"]
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": {
    "Open": 45,
    "InProgress": 12,
    "Completed": 230,
    "Overdue": 8,
    "Missed": 3,
    "total": 298
  }
}
```

### Task Count by Assignees

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/count-by-assignees" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-12-01",
      "endDate": "2024-12-31"
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "assigneeId": "user-uuid-1",
      "assigneeName": "John Doe",
      "assigned": 50,
      "completed": 45,
      "overdue": 3,
      "completionRate": 90
    },
    {
      "assigneeId": "user-uuid-2",
      "assigneeName": "Jane Smith",
      "assigned": 35,
      "completed": 33,
      "overdue": 1,
      "completionRate": 94.3
    }
  ]
}
```

### Task Count by Categories

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/count-by-categories" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-12-01",
      "endDate": "2024-12-31"
    }'
  ```
</CodeGroup>

### Weekly Completion Trends

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/weekly-completion" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "weeks": 12
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "weekStart": "2024-12-16",
      "weekEnd": "2024-12-22",
      "total": 150,
      "completed": 142,
      "completionRate": 94.7
    },
    {
      "weekStart": "2024-12-09",
      "weekEnd": "2024-12-15",
      "total": 145,
      "completed": 140,
      "completionRate": 96.6
    }
  ]
}
```

### Schedule Completion by Location

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/schedule-completion-by-location" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-12-01",
      "endDate": "2024-12-31"
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "locationId": "location-uuid-1",
      "locationName": "Downtown Store",
      "scheduled": 100,
      "completed": 95,
      "onTime": 90,
      "late": 5,
      "missed": 5,
      "completionRate": 95,
      "onTimeRate": 94.7
    }
  ]
}
```

### On-Time vs Late by Location

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/on-time-late-submission-by-location" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "startDate": "2024-12-01",
      "endDate": "2024-12-31"
    }'
  ```
</CodeGroup>

### Daily Compliance Report

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/reports/tasks/daily-compliance" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "date": "2024-12-23",
      "locationIds": ["location-uuid"]
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": {
    "date": "2024-12-23",
    "locations": [
      {
        "locationId": "location-uuid",
        "locationName": "Downtown Store",
        "scheduledTasks": 15,
        "completedTasks": 14,
        "complianceRate": 93.3,
        "overdueItems": [
          {
            "taskId": "task-uuid",
            "title": "Evening Safety Check",
            "dueAt": "2024-12-23T18:00:00Z",
            "assignee": "John Doe"
          }
        ]
      }
    ],
    "overallCompliance": 93.3
  }
}
```

***

## Submission Analytics

### Template Submission Summary

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/template-submissions" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "checklistId": "template-uuid",
      "startDate": "2024-12-01",
      "endDate": "2024-12-31",
      "groupBy": "location"
    }'
  ```
</CodeGroup>

### Submission Count by Status

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/ops/submissions-count-by-status" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "checklistId": "template-uuid",
      "startDate": "2024-12-01",
      "endDate": "2024-12-31"
    }'
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": {
    "draft": 5,
    "completed": 245,
    "pending_approval": 8,
    "approved": 220,
    "rejected": 12,
    "total": 490
  }
}
```

***

## Grid Reports & Dashboards

Custom report builders with saved views and thresholds.

### List Grid Reports

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/grid-reports" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

### Create Grid Report

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/grid-reports" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Monthly Compliance Dashboard",
      "description": "Track compliance across all locations",
      "reportType": "compliance",
      "config": {
        "dateRange": "last_30_days",
        "groupBy": "location",
        "metrics": ["completionRate", "onTimeRate", "flaggedItems"]
      }
    }'
  ```
</CodeGroup>

### Create Report View

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/grid-reports/{gridReportId}/view" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Regional View",
      "filters": {
        "locationIds": ["region-1-uuid", "region-2-uuid"]
      },
      "columns": ["location", "completionRate", "trend"],
      "sortBy": "completionRate",
      "sortOrder": "ASC"
    }'
  ```
</CodeGroup>

### Export Report View to Spreadsheet

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/grid-report-views/{gridReportViewId}/spreadsheet" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

### Configure Thresholds

Set alert thresholds for report metrics.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/grid-report-views/{gridReportViewId}/thresholds" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "thresholds": [
        {
          "metric": "completionRate",
          "operator": "lt",
          "value": 90,
          "severity": "warning",
          "notifyRoles": ["manager-role-uuid"]
        },
        {
          "metric": "completionRate",
          "operator": "lt",
          "value": 70,
          "severity": "critical",
          "notifyRoles": ["manager-role-uuid", "admin-role-uuid"]
        }
      ]
    }'
  ```
</CodeGroup>

***

## Scheduled Reports

Automate report generation and delivery.

### List Report Schedules

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/report-schedules" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "id": "schedule-uuid",
      "name": "Weekly Compliance Report",
      "reportType": "daily-compliance",
      "schedule": {
        "frequency": "weekly",
        "dayOfWeek": 1,
        "time": "08:00",
        "timezone": "America/New_York"
      },
      "recipients": ["manager@company.com", "compliance@company.com"],
      "format": "excel",
      "isActive": true,
      "lastRunAt": "2024-12-16T08:00:00Z",
      "nextRunAt": "2024-12-23T08:00:00Z",
      "createdAt": "2024-11-01T10:00:00Z"
    }
  ]
}
```

### Create Report Schedule

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/report-schedules" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Daily Task Summary",
      "reportType": "task-summary",
      "schedule": {
        "frequency": "daily",
        "time": "18:00",
        "timezone": "America/New_York"
      },
      "recipients": ["operations@company.com"],
      "format": "pdf",
      "filters": {
        "locationIds": ["location-uuid"]
      }
    }'
  ```
</CodeGroup>

**Request Body:**

| Field                 | Type   | Required | Description                                                   |
| --------------------- | ------ | -------- | ------------------------------------------------------------- |
| `name`                | string | Yes      | Schedule name                                                 |
| `reportType`          | string | Yes      | Type: `daily-compliance`, `task-summary`, `submission-export` |
| `schedule.frequency`  | string | Yes      | `daily`, `weekly`, `monthly`                                  |
| `schedule.time`       | string | Yes      | Time in HH:MM format                                          |
| `schedule.timezone`   | string | No       | IANA timezone (default: workspace timezone)                   |
| `schedule.dayOfWeek`  | number | No       | For weekly: 0-6 (Sunday-Saturday)                             |
| `schedule.dayOfMonth` | number | No       | For monthly: 1-28                                             |
| `recipients`          | array  | Yes      | Email addresses                                               |
| `format`              | string | No       | `excel` or `pdf` (default: excel)                             |
| `filters`             | object | No       | Report filters                                                |

### Toggle Schedule (Pause/Resume)

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/report-schedules/{scheduleId}/toggle" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

### Run Report Now

Trigger immediate report generation.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/report-schedules/{scheduleId}/run-now" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "message": "Report generation started",
  "data": {
    "executionId": "execution-uuid",
    "status": "processing",
    "estimatedCompletion": "2024-12-23T10:05:00Z"
  }
}
```

### Get Execution History

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/workspaces/{workspaceId}/report-schedules/{scheduleId}/executions?page=1&pageSize=10" \
    -H "x-client-key: YOUR_CLIENT_KEY" \
    -H "x-client-secret: YOUR_CLIENT_SECRET" \
    -H "workspace-id: {workspaceId}"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": {
    "executions": [
      {
        "id": "execution-uuid",
        "status": "completed",
        "startedAt": "2024-12-23T08:00:00Z",
        "completedAt": "2024-12-23T08:02:15Z",
        "recipientCount": 2,
        "deliveryStatus": "sent",
        "fileSize": 245000,
        "recordCount": 1500
      }
    ],
    "pagination": {
      "page": 1,
      "pageSize": 10,
      "total": 52
    }
  }
}
```

***

## Dataset API (BI Integration)

Direct data access for business intelligence platforms.

### Daily Compliance Report

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/datasets/daily-compliance-report?workspaceId={workspaceId}&todayDate=2024-12-23" \
    -H "x-xenia-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "locationId": "location-uuid",
      "locationName": "Downtown Store",
      "date": "2024-12-23",
      "scheduledTasks": 15,
      "completedTasks": 14,
      "compliancePercentage": 93.33,
      "projectStatus": {
        "active": 3,
        "completed": 12,
        "overdue": 1
      }
    }
  ]
}
```

### Weekly Submission Report

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.xenia.team/api/v1/mgt/datasets/weekly-submission-report?workspaceId={workspaceId}&todayDate=2024-12-23&checklistName=Safety%20Inspection" \
    -H "x-xenia-api-key: YOUR_API_KEY"
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "status": true,
  "code": 200,
  "data": [
    {
      "locationId": "location-uuid",
      "locationName": "Downtown Store",
      "checklistName": "Safety Inspection",
      "weekData": [
        {"date": "2024-12-17", "completed": 2, "pending": 0, "flagged": 0},
        {"date": "2024-12-18", "completed": 2, "pending": 0, "flagged": 1},
        {"date": "2024-12-19", "completed": 2, "pending": 0, "flagged": 0},
        {"date": "2024-12-20", "completed": 2, "pending": 0, "flagged": 0},
        {"date": "2024-12-21", "completed": 1, "pending": 1, "flagged": 0},
        {"date": "2024-12-22", "completed": 2, "pending": 0, "flagged": 0},
        {"date": "2024-12-23", "completed": 1, "pending": 1, "flagged": 0}
      ],
      "weekTotal": {
        "completed": 12,
        "pending": 2,
        "flagged": 1
      }
    }
  ]
}
```

<Note>
  **ChartBrew Integration**: Include the header `platform: chartbrew` for optimized response format compatible with ChartBrew dashboards.
</Note>

***

## Common Workflows

### Daily Compliance Automation

```mermaid theme={null}
flowchart TD
    A[Create Report Schedule] --> B[Set Daily Frequency]
    B --> C[Configure Recipients]
    C --> D[Set Filters by Location]
    D --> E[Schedule Runs Daily at 6 PM]
    E --> F{Execution}
    F --> G[Generate Report]
    G --> H[Email to Recipients]
```

### BI Dashboard Integration

```mermaid theme={null}
flowchart TD
    A[Configure API Key] --> B[Set Up ChartBrew]
    B --> C[Create Data Source]
    C --> D[Connect Dataset API]
    D --> E[Build Dashboard]
    E --> F[Configure Refresh Interval]
    F --> G[Share Dashboard]
```

### Bulk Submission Export

1. **Create export request** with date range and filters
2. **Monitor status** via export status endpoint
3. **Download file** when ready or receive via email
4. **Process data** in your BI tool or spreadsheet

***

## Best Practices

<AccordionGroup>
  <Accordion title="Use filters to reduce export size">
    Always specify date ranges and location filters for large exports. This improves performance and reduces processing time.
  </Accordion>

  <Accordion title="Schedule reports during off-peak hours">
    Configure scheduled reports to run during off-peak hours (early morning or late evening) to minimize impact on system performance.
  </Accordion>

  <Accordion title="Use appropriate export formats">
    Use Excel for data analysis and manipulation. Use PDF for formal reports and sharing with stakeholders.
  </Accordion>

  <Accordion title="Set up threshold alerts">
    Configure grid report thresholds to receive automatic notifications when compliance metrics fall below acceptable levels.
  </Accordion>

  <Accordion title="Leverage Dataset API for real-time dashboards">
    Use the Dataset API with ChartBrew or custom dashboards for real-time visibility into compliance metrics.
  </Accordion>
</AccordionGroup>

***

## Related Guides

* [Submission Workflow](/guides/workflows/submission-workflow) - Complete inspections
* [Submission Exports](/guides/workflows/submission-exports) - Additional export options
* [Task Management](/guides/workflows/task-management) - Task operations
* [Corrective Actions](/guides/workflows/corrective-actions) - Handle flagged items
