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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Query analytics report

> Run a synchronous Apollo analytics report.

`apollo.queryAnalyticsReport` runs an Apollo report with explicit metrics, dimensions, filters, and date range.

```ts automations/query-apollo-analytics.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { apollo } from "automate.ax/apollo"

export default automation("Report email volume", () => {
  onDashboardRun({ title: "Report email volume" })
  apollo.queryAnalyticsReport({
    dateRange: "last_30_days",
    metrics: [
      {
        value: "num_emails_sent",
        smartDatetimeReference: "activity_datetime",
        smartUserIdReference: "user_id",
      },
    ],
    groupBy: { name: "smart_user_id" },
  })
})
```

Metric, dimension, and filter identifiers come from Apollo's report contract. `groupBy` and `pivotGroupBy` each accept at most one dimension. Returns `{ report }` with every provider key converted recursively to camel case. Apollo limits this endpoint to five requests per hour.
