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

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Query Analytics Report

> Run an analytics report and get its rows back.

Run an analytics report and get its rows back. Despite being a POST this reads rather than writes; the method reflects that the query goes in the body. Reports cover the shared workspace, so figures include other callers' activity.

> [!NOTE]
>
> **First time?** Point any MCP client at `https://mcp.aisa.one/mcp` — Claude
> Code, Codex, Cursor, VS Code and the rest. Authorization is OAuth: the client
> opens a browser, you click Allow once, and there is no key to paste. Your
> agent then reaches every endpoint through a few meta tools: `search`,
> `list_categories`, `get_details` and `batch_quote` are free, `batch_use` is
> billed per call. Setup per client is in
> [Connect via MCP](https://aisa.one/docs/agent-quickstart.md); the live tool list and what each call
> costs are on [aisa.one/mcp](https://aisa.one/mcp#connect).

[Set this endpoint up in your agent →](https://aisa.one/mcp?from=/api-reference/apollo/post_apollo-reports-sync-report)

## Request contract

* **Method and path:** POST /apis/v1/apollo/reports/sync\_report
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/apollo/reports/sync_report`

[Complete OpenAPI definition](https://aisa.one/docs/openapi/apollo.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "post_apollo_reports_sync_report",
  "method": "POST",
  "path": "/apis/v1/apollo/reports/sync_report",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "examples": {
          "Custom date range — call activity for Q1": {
            "value": {
              "date_ranges": [
                {
                  "modality": "custom_range"
                }
              ],
              "filters": {
                "smart_datetime_range": {
                  "max": "2024-03-31",
                  "min": "2024-01-01"
                }
              },
              "group_by": [
                {
                  "name": "smart_user_id"
                }
              ],
              "group_by_totals_selected": true,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_phone_calls"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_phone_calls_connect"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "percent_phone_calls_connect"
                }
              ],
              "pivot_group_by": [],
              "pivot_group_by_totals_selected": false,
              "sorts": []
            }
          },
          "Flat totals — email performance": {
            "value": {
              "date_ranges": [
                {
                  "modality": "last_30_days"
                }
              ],
              "filters": {},
              "group_by": [],
              "group_by_totals_selected": false,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_sent"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_opened"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "percent_emails_opened_tracked"
                }
              ],
              "pivot_group_by": [],
              "pivot_group_by_totals_selected": false,
              "sorts": []
            }
          },
          "Grouped — email activity by user": {
            "value": {
              "date_ranges": [
                {
                  "modality": "current_month"
                }
              ],
              "filters": {},
              "group_by": [
                {
                  "name": "smart_user_id"
                }
              ],
              "group_by_totals_selected": true,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_sent"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_replied"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "percent_emails_replied"
                }
              ],
              "pivot_group_by": [],
              "pivot_group_by_totals_selected": false,
              "sorts": [
                {
                  "asc": false,
                  "metric": {
                    "smart_datetime_reference": "activity_datetime",
                    "smart_user_id_reference": "user_id",
                    "value": "num_emails_sent"
                  }
                }
              ]
            }
          },
          "Grouped — email volume by month": {
            "value": {
              "date_ranges": [
                {
                  "modality": "last_12_months"
                }
              ],
              "filters": {},
              "group_by": [
                {
                  "name": "smart_datetime_month"
                }
              ],
              "group_by_totals_selected": false,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_sent"
                }
              ],
              "pivot_group_by": [],
              "pivot_group_by_totals_selected": false,
              "sorts": []
            }
          },
          "Pivot — emails sent by user x contact stage": {
            "value": {
              "date_ranges": [
                {
                  "modality": "last_30_days"
                }
              ],
              "filters": {},
              "group_by": [
                {
                  "name": "smart_user_id"
                }
              ],
              "group_by_totals_selected": true,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_sent"
                }
              ],
              "pivot_group_by": [
                {
                  "name": "contact_stage_id"
                }
              ],
              "pivot_group_by_totals_selected": true,
              "sorts": []
            }
          },
          "Sorted — top 5 reps by reply rate": {
            "value": {
              "date_ranges": [
                {
                  "modality": "current_quarter"
                }
              ],
              "filters": {},
              "group_by": [
                {
                  "limit": 5,
                  "name": "smart_user_id"
                }
              ],
              "group_by_totals_selected": false,
              "metrics": [
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_sent"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "num_emails_replied"
                },
                {
                  "smart_datetime_reference": "activity_datetime",
                  "smart_user_id_reference": "user_id",
                  "value": "percent_emails_replied"
                }
              ],
              "pivot_group_by": [],
              "pivot_group_by_totals_selected": false,
              "sorts": [
                {
                  "asc": false,
                  "metric": {
                    "smart_datetime_reference": "activity_datetime",
                    "smart_user_id_reference": "user_id",
                    "value": "percent_emails_replied"
                  }
                }
              ]
            }
          }
        },
        "schema": {
          "properties": {
            "date_ranges": {
              "description": "The time window for the query. Provide one object with a <code>modality</code> preset. For a custom date range, set <code>modality</code> to <code>custom_range</code> and add a <code>smart_datetime_range</code> key in <code>filters</code> with <code>{\"min\": \"YYYY-MM-DD\", \"max\": \"YYYY-MM-DD\"}</code>.",
              "items": {
                "properties": {
                  "modality": {
                    "description": "Date range preset. Valid values: <code>today</code>, <code>yesterday</code>, <code>current_week</code>, <code>current_month</code>, <code>current_quarter</code>, <code>current_year</code>, <code>last_7_days</code>, <code>last_2_weeks</code>, <code>last_30_days</code>, <code>last_3_months</code>, <code>last_6_months</code>, <code>last_12_months</code>, <code>last_4_quarters</code>, <code>last_2_years</code>, <code>previous_week</code>, <code>previous_month</code>, <code>previous_quarter</code>, <code>previous_year</code>, <code>all_time</code>, <code>custom_range</code> (requires <code>smart_datetime_range</code> in <code>filters</code>).",
                    "type": "string"
                  }
                },
                "required": [
                  "modality"
                ],
                "type": "object"
              },
              "maxItems": 1,
              "type": "array"
            },
            "filters": {
              "additionalProperties": true,
              "description": "Key/value filter map to narrow the result set. Pass an empty object <code>{}</code> for no filters. Common filter keys are documented in the <code>properties</code> below; additional dimension-based filters may also be passed using the same key names as <code>group_by[].name</code> values. Refer to the <a href=\"https://docs.apollo.io/reference/sync-report-metrics\" target=\"_blank\">Metrics and Dimensions Reference</a> for a complete list.",
              "properties": {
                "account_stage_ids": {
                  "description": "Filter to specific account stage IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "contact_stage_ids": {
                  "description": "Filter to specific contact stage IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "email_account_ids": {
                  "description": "Filter to specific sender mailbox IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "emailer_campaign_ids": {
                  "description": "Filter to specific sequence IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "opportunity_stage_ids": {
                  "description": "Filter to specific opportunity stage IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "smart_datetime_range": {
                  "description": "Required when <code>date_ranges[].modality</code> is <code>custom_range</code>. Specifies the exact date window as ISO 8601 date strings.",
                  "properties": {
                    "max": {
                      "description": "End date (inclusive). Format: <code>YYYY-MM-DD</code>. <br><br>Example: <code>2024-03-31</code>",
                      "type": "string"
                    },
                    "min": {
                      "description": "Start date (inclusive). Format: <code>YYYY-MM-DD</code>. <br><br>Example: <code>2024-01-01</code>",
                      "type": "string"
                    }
                  },
                  "required": [
                    "min",
                    "max"
                  ],
                  "type": "object"
                },
                "smart_subteam_id": {
                  "description": "Filter to specific sub-team IDs.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "smart_user_id": {
                  "description": "Filter to specific team member IDs. Use <code>\"current\"</code> for the authenticated user. <br><br>Example: <code>[\"current\"]</code>",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "group_by": {
              "description": "The dimension to group results by (row dimension). Pass one object to break results down by that dimension. Pass an empty array <code>[]</code> for flat totals with no grouping. <br><br>Only one entry is supported. Refer to the <a href=\"https://docs.apollo.io/reference/sync-report-metrics\" target=\"_blank\">Metrics and Dimensions Reference</a> for valid dimension names.",
              "items": {
                "properties": {
                  "limit": {
                    "description": "Maximum number of dimension values to return.",
                    "type": "integer"
                  },
                  "name": {
                    "description": "The dimension name. <br><br>Example: <code>smart_user_id</code>",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              },
              "maxItems": 1,
              "type": "array"
            },
            "group_by_totals_selected": {
              "description": "When <code>true</code>, the response includes an aggregated totals row in addition to the per-dimension-value rows.",
              "type": "boolean"
            },
            "metrics": {
              "description": "The metrics to query. Each object specifies which metric to measure and which date and user columns the engine should use for that metric. The <code>smart_datetime_reference</code> and <code>smart_user_id_reference</code> values are metric-specific — using the wrong values will return no data. Refer to the <a href=\"https://docs.apollo.io/reference/sync-report-metrics\" target=\"_blank\">Metrics and Dimensions Reference</a> for valid metric names and the correct reference fields for each. <br><br>Pass an empty array <code>[]</code> to return a response with no metric columns.",
              "items": {
                "properties": {
                  "display_name": {
                    "description": "Optional label override for this metric's column in the response.",
                    "type": "string"
                  },
                  "smart_datetime_reference": {
                    "description": "The date column name to use for this metric time range. Valid values depend on the metric. See the smart reference field values table for supported values by metric type. Unsupported values may cause the related date or user filter not to apply. <br><br>Example: <code>activity_datetime</code>",
                    "type": "string"
                  },
                  "smart_user_id_reference": {
                    "description": "The user column name that filters per user. Many metrics use <code>user_id</code>. See the smart reference field values table for supported values by metric family. Unsupported values may cause the related date or user filter not to apply. <br><br>Example: <code>user_id</code>",
                    "type": "string"
                  },
                  "value": {
                    "description": "The metric identifier. For built-in metrics, use the metric name (e.g. <code>num_emails_sent</code>). For team-defined custom metrics, use the format <code>custom_metric_{id}</code> where <code>{id}</code> is the custom metric's id.",
                    "type": "string"
                  }
                },
                "required": [
                  "value",
                  "smart_datetime_reference",
                  "smart_user_id_reference"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "min_ratio_denominator": {
              "default": 0,
              "description": "Minimum denominator threshold for ratio metrics. Rows where the denominator falls below this value are excluded from ratio calculations.",
              "type": "integer"
            },
            "pivot_group_by": {
              "description": "The dimension to pivot on (column dimension). Used together with <code>group_by</code> to produce a two-dimensional cross-tab table: <code>group_by</code> defines the row dimension and <code>pivot_group_by</code> defines the column dimension. Pass an empty array <code>[]</code> for non-pivot queries. <br><br>Only one entry is supported.",
              "items": {
                "properties": {
                  "limit": {
                    "description": "Maximum number of pivot column values to return.",
                    "type": "integer"
                  },
                  "name": {
                    "description": "The dimension name to pivot on. <br><br>Example: <code>emailer_campaign_id</code>",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              },
              "maxItems": 1,
              "type": "array"
            },
            "pivot_group_by_totals_selected": {
              "description": "When <code>true</code>, the pivot response includes an aggregated totals column in addition to the per-pivot-value columns.",
              "type": "boolean"
            },
            "skip_group_by_values": {
              "description": "Exclude specific dimension values from the result rows. Values must match the raw <code>key</code> field returned in bucket responses for the active <code>group_by</code> dimension (e.g. a contact stage ID string, a user ID string, or a date string for datetime dimensions). Maximum 500 entries.",
              "items": {
                "type": "string"
              },
              "maxItems": 500,
              "type": "array"
            },
            "sorts": {
              "description": "Sort order for the result rows. Only the first entry is applied. Pass an empty array <code>[]</code> to use the default order. <br><br>Sorting is supported by metric value — provide the <code>metric</code> field with the same structure as an entry in the <code>metrics</code> array. The <code>asc</code> field controls direction (<code>true</code> = ascending, <code>false</code> = descending). <br><br>Sorting by dimension value (e.g. alphabetically by user name) is not supported via the API.",
              "items": {
                "properties": {
                  "asc": {
                    "description": "Sort ascending (<code>true</code>) or descending (<code>false</code>).",
                    "type": "boolean"
                  },
                  "metric": {
                    "description": "Sort by a metric column. Provide the same structure as a metric entry in the <code>metrics</code> array.",
                    "properties": {
                      "smart_datetime_reference": {
                        "type": "string"
                      },
                      "smart_user_id_reference": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "asc"
                ],
                "type": "object"
              },
              "type": "array"
            }
          },
          "required": [
            "metrics",
            "group_by",
            "sorts",
            "filters",
            "group_by_totals_selected",
            "pivot_group_by_totals_selected",
            "date_ranges"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## Cost and request rules

Published reference price: \$0.012 USD per successful request. Your account price may differ; use a request quote where supported.


## OpenAPI

````yaml openapi/apollo.json POST /apis/v1/apollo/reports/sync_report
openapi: 3.1.0
info:
  description: ''
  title: Apollo
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    apollo:
      description: ''
      title: Apollo
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 9ab7612cf2d53be794cbf1d65d4a257f986ac6783e53c7c3a5d868e4593061c3
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/apollo/account_stages
    - /apis/v1/apollo/accounts
    - /apis/v1/apollo/accounts/bulk_create
    - /apis/v1/apollo/accounts/bulk_update
    - /apis/v1/apollo/accounts/search
    - /apis/v1/apollo/accounts/update_owners
    - /apis/v1/apollo/accounts/{account_id}
    - /apis/v1/apollo/accounts/{id}
    - /apis/v1/apollo/contact_stages
    - /apis/v1/apollo/contacts
    - /apis/v1/apollo/contacts/bulk_create
    - /apis/v1/apollo/contacts/bulk_update
    - /apis/v1/apollo/contacts/search
    - /apis/v1/apollo/contacts/update_owners
    - /apis/v1/apollo/contacts/update_stages
    - /apis/v1/apollo/contacts/{contact_id}
    - /apis/v1/apollo/email_accounts
    - /apis/v1/apollo/emailer_campaigns/remove_or_stop_contact_ids
    - /apis/v1/apollo/emailer_campaigns/search
    - /apis/v1/apollo/emailer_campaigns/{sequence_id}/abort
    - /apis/v1/apollo/emailer_campaigns/{sequence_id}/add_contact_ids
    - /apis/v1/apollo/emailer_campaigns/{sequence_id}/approve
    - /apis/v1/apollo/emailer_campaigns/{sequence_id}/archive
    - /apis/v1/apollo/emailer_messages/search
    - /apis/v1/apollo/emailer_messages/{id}/activities
    - /apis/v1/apollo/fields
    - /apis/v1/apollo/labels
    - /apis/v1/apollo/mixed_companies/search
    - /apis/v1/apollo/mixed_people/api_search
    - /apis/v1/apollo/news_articles/search
    - /apis/v1/apollo/notes
    - /apis/v1/apollo/opportunities
    - /apis/v1/apollo/opportunities/search
    - /apis/v1/apollo/opportunities/{opportunity_id}
    - /apis/v1/apollo/opportunity_stages
    - /apis/v1/apollo/organizations/bulk_enrich
    - /apis/v1/apollo/organizations/enrich
    - /apis/v1/apollo/organizations/{id}
    - /apis/v1/apollo/organizations/{organization_id}/job_postings
    - /apis/v1/apollo/people/bulk_match
    - /apis/v1/apollo/people/match
    - /apis/v1/apollo/phone_calls
    - /apis/v1/apollo/phone_calls/search
    - /apis/v1/apollo/phone_calls/{id}
    - /apis/v1/apollo/reports/sync_report
    - /apis/v1/apollo/tasks
    - /apis/v1/apollo/tasks/bulk_create
    - /apis/v1/apollo/tasks/search
    - /apis/v1/apollo/typed_custom_fields
    - /apis/v1/apollo/usage_stats/api_usage_stats
    - /apis/v1/apollo/users/search
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:cadc6c94ad9ee45934c75643991b1373378c2edbf1eb13bebd3f0f5019762f72
    facts_hash: 9ab7612cf2d53be794cbf1d65d4a257f986ac6783e53c7c3a5d868e4593061c3
    generator_version: '3'
    identity_base_document_hash: sha256:25cc6bf335978cfe70694f2688fff160a70228967dd3c543257ec629bcb08bcc
    identity_compatibility_hash: sha256:3bc28cb12b6a6f37411c3d96a19e68e7ef629e36d32c2e39fa51f0c423aa0fa2
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: apollo
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/apollo/reports/sync_report:
    post:
      tags:
        - default
      summary: Query Analytics Report
      description: >-
        Run an analytics report and get its rows back. Despite being a POST this
        reads rather than writes; the method reflects that the query goes in the
        body. Reports cover the shared workspace, so figures include other
        callers' activity.


        Query analytics report. Requires a master API key.
      operationId: post_apollo_reports_sync_report
      requestBody:
        content:
          application/json:
            examples:
              Custom date range — call activity for Q1:
                value:
                  date_ranges:
                    - modality: custom_range
                  filters:
                    smart_datetime_range:
                      max: '2024-03-31'
                      min: '2024-01-01'
                  group_by:
                    - name: smart_user_id
                  group_by_totals_selected: true
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_phone_calls
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_phone_calls_connect
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: percent_phone_calls_connect
                  pivot_group_by: []
                  pivot_group_by_totals_selected: false
                  sorts: []
              Flat totals — email performance:
                value:
                  date_ranges:
                    - modality: last_30_days
                  filters: {}
                  group_by: []
                  group_by_totals_selected: false
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_sent
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_opened
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: percent_emails_opened_tracked
                  pivot_group_by: []
                  pivot_group_by_totals_selected: false
                  sorts: []
              Grouped — email activity by user:
                value:
                  date_ranges:
                    - modality: current_month
                  filters: {}
                  group_by:
                    - name: smart_user_id
                  group_by_totals_selected: true
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_sent
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_replied
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: percent_emails_replied
                  pivot_group_by: []
                  pivot_group_by_totals_selected: false
                  sorts:
                    - asc: false
                      metric:
                        smart_datetime_reference: activity_datetime
                        smart_user_id_reference: user_id
                        value: num_emails_sent
              Grouped — email volume by month:
                value:
                  date_ranges:
                    - modality: last_12_months
                  filters: {}
                  group_by:
                    - name: smart_datetime_month
                  group_by_totals_selected: false
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_sent
                  pivot_group_by: []
                  pivot_group_by_totals_selected: false
                  sorts: []
              Pivot — emails sent by user x contact stage:
                value:
                  date_ranges:
                    - modality: last_30_days
                  filters: {}
                  group_by:
                    - name: smart_user_id
                  group_by_totals_selected: true
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_sent
                  pivot_group_by:
                    - name: contact_stage_id
                  pivot_group_by_totals_selected: true
                  sorts: []
              Sorted — top 5 reps by reply rate:
                value:
                  date_ranges:
                    - modality: current_quarter
                  filters: {}
                  group_by:
                    - limit: 5
                      name: smart_user_id
                  group_by_totals_selected: false
                  metrics:
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_sent
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: num_emails_replied
                    - smart_datetime_reference: activity_datetime
                      smart_user_id_reference: user_id
                      value: percent_emails_replied
                  pivot_group_by: []
                  pivot_group_by_totals_selected: false
                  sorts:
                    - asc: false
                      metric:
                        smart_datetime_reference: activity_datetime
                        smart_user_id_reference: user_id
                        value: percent_emails_replied
            schema:
              properties:
                date_ranges:
                  description: >-
                    The time window for the query. Provide one object with a
                    <code>modality</code> preset. For a custom date range, set
                    <code>modality</code> to <code>custom_range</code> and add a
                    <code>smart_datetime_range</code> key in
                    <code>filters</code> with <code>{"min": "YYYY-MM-DD", "max":
                    "YYYY-MM-DD"}</code>.
                  items:
                    properties:
                      modality:
                        description: >-
                          Date range preset. Valid values: <code>today</code>,
                          <code>yesterday</code>, <code>current_week</code>,
                          <code>current_month</code>,
                          <code>current_quarter</code>,
                          <code>current_year</code>, <code>last_7_days</code>,
                          <code>last_2_weeks</code>, <code>last_30_days</code>,
                          <code>last_3_months</code>,
                          <code>last_6_months</code>,
                          <code>last_12_months</code>,
                          <code>last_4_quarters</code>,
                          <code>last_2_years</code>, <code>previous_week</code>,
                          <code>previous_month</code>,
                          <code>previous_quarter</code>,
                          <code>previous_year</code>, <code>all_time</code>,
                          <code>custom_range</code> (requires
                          <code>smart_datetime_range</code> in
                          <code>filters</code>).
                        type: string
                    required:
                      - modality
                    type: object
                  maxItems: 1
                  type: array
                filters:
                  additionalProperties: true
                  description: >-
                    Key/value filter map to narrow the result set. Pass an empty
                    object <code>{}</code> for no filters. Common filter keys
                    are documented in the <code>properties</code> below;
                    additional dimension-based filters may also be passed using
                    the same key names as <code>group_by[].name</code> values.
                    Refer to the <a
                    href="https://docs.apollo.io/reference/sync-report-metrics"
                    target="_blank">Metrics and Dimensions Reference</a> for a
                    complete list.
                  properties:
                    account_stage_ids:
                      description: Filter to specific account stage IDs.
                      items:
                        type: string
                      type: array
                    contact_stage_ids:
                      description: Filter to specific contact stage IDs.
                      items:
                        type: string
                      type: array
                    email_account_ids:
                      description: Filter to specific sender mailbox IDs.
                      items:
                        type: string
                      type: array
                    emailer_campaign_ids:
                      description: Filter to specific sequence IDs.
                      items:
                        type: string
                      type: array
                    opportunity_stage_ids:
                      description: Filter to specific opportunity stage IDs.
                      items:
                        type: string
                      type: array
                    smart_datetime_range:
                      description: >-
                        Required when <code>date_ranges[].modality</code> is
                        <code>custom_range</code>. Specifies the exact date
                        window as ISO 8601 date strings.
                      properties:
                        max:
                          description: >-
                            End date (inclusive). Format:
                            <code>YYYY-MM-DD</code>. <br><br>Example:
                            <code>2024-03-31</code>
                          type: string
                        min:
                          description: >-
                            Start date (inclusive). Format:
                            <code>YYYY-MM-DD</code>. <br><br>Example:
                            <code>2024-01-01</code>
                          type: string
                      required:
                        - min
                        - max
                      type: object
                    smart_subteam_id:
                      description: Filter to specific sub-team IDs.
                      items:
                        type: string
                      type: array
                    smart_user_id:
                      description: >-
                        Filter to specific team member IDs. Use
                        <code>"current"</code> for the authenticated user.
                        <br><br>Example: <code>["current"]</code>
                      items:
                        type: string
                      type: array
                  type: object
                group_by:
                  description: >-
                    The dimension to group results by (row dimension). Pass one
                    object to break results down by that dimension. Pass an
                    empty array <code>[]</code> for flat totals with no
                    grouping. <br><br>Only one entry is supported. Refer to the
                    <a
                    href="https://docs.apollo.io/reference/sync-report-metrics"
                    target="_blank">Metrics and Dimensions Reference</a> for
                    valid dimension names.
                  items:
                    properties:
                      limit:
                        description: Maximum number of dimension values to return.
                        type: integer
                      name:
                        description: >-
                          The dimension name. <br><br>Example:
                          <code>smart_user_id</code>
                        type: string
                    required:
                      - name
                    type: object
                  maxItems: 1
                  type: array
                group_by_totals_selected:
                  description: >-
                    When <code>true</code>, the response includes an aggregated
                    totals row in addition to the per-dimension-value rows.
                  type: boolean
                metrics:
                  description: >-
                    The metrics to query. Each object specifies which metric to
                    measure and which date and user columns the engine should
                    use for that metric. The
                    <code>smart_datetime_reference</code> and
                    <code>smart_user_id_reference</code> values are
                    metric-specific — using the wrong values will return no
                    data. Refer to the <a
                    href="https://docs.apollo.io/reference/sync-report-metrics"
                    target="_blank">Metrics and Dimensions Reference</a> for
                    valid metric names and the correct reference fields for
                    each. <br><br>Pass an empty array <code>[]</code> to return
                    a response with no metric columns.
                  items:
                    properties:
                      display_name:
                        description: >-
                          Optional label override for this metric's column in
                          the response.
                        type: string
                      smart_datetime_reference:
                        description: >-
                          The date column name to use for this metric time
                          range. Valid values depend on the metric. See the
                          smart reference field values table for supported
                          values by metric type. Unsupported values may cause
                          the related date or user filter not to apply.
                          <br><br>Example: <code>activity_datetime</code>
                        type: string
                      smart_user_id_reference:
                        description: >-
                          The user column name that filters per user. Many
                          metrics use <code>user_id</code>. See the smart
                          reference field values table for supported values by
                          metric family. Unsupported values may cause the
                          related date or user filter not to apply.
                          <br><br>Example: <code>user_id</code>
                        type: string
                      value:
                        description: >-
                          The metric identifier. For built-in metrics, use the
                          metric name (e.g. <code>num_emails_sent</code>). For
                          team-defined custom metrics, use the format
                          <code>custom_metric_{id}</code> where
                          <code>{id}</code> is the custom metric's id.
                        type: string
                    required:
                      - value
                      - smart_datetime_reference
                      - smart_user_id_reference
                    type: object
                  type: array
                min_ratio_denominator:
                  default: 0
                  description: >-
                    Minimum denominator threshold for ratio metrics. Rows where
                    the denominator falls below this value are excluded from
                    ratio calculations.
                  type: integer
                pivot_group_by:
                  description: >-
                    The dimension to pivot on (column dimension). Used together
                    with <code>group_by</code> to produce a two-dimensional
                    cross-tab table: <code>group_by</code> defines the row
                    dimension and <code>pivot_group_by</code> defines the column
                    dimension. Pass an empty array <code>[]</code> for non-pivot
                    queries. <br><br>Only one entry is supported.
                  items:
                    properties:
                      limit:
                        description: Maximum number of pivot column values to return.
                        type: integer
                      name:
                        description: >-
                          The dimension name to pivot on. <br><br>Example:
                          <code>emailer_campaign_id</code>
                        type: string
                    required:
                      - name
                    type: object
                  maxItems: 1
                  type: array
                pivot_group_by_totals_selected:
                  description: >-
                    When <code>true</code>, the pivot response includes an
                    aggregated totals column in addition to the per-pivot-value
                    columns.
                  type: boolean
                skip_group_by_values:
                  description: >-
                    Exclude specific dimension values from the result rows.
                    Values must match the raw <code>key</code> field returned in
                    bucket responses for the active <code>group_by</code>
                    dimension (e.g. a contact stage ID string, a user ID string,
                    or a date string for datetime dimensions). Maximum 500
                    entries.
                  items:
                    type: string
                  maxItems: 500
                  type: array
                sorts:
                  description: >-
                    Sort order for the result rows. Only the first entry is
                    applied. Pass an empty array <code>[]</code> to use the
                    default order. <br><br>Sorting is supported by metric value
                    — provide the <code>metric</code> field with the same
                    structure as an entry in the <code>metrics</code> array. The
                    <code>asc</code> field controls direction (<code>true</code>
                    = ascending, <code>false</code> = descending).
                    <br><br>Sorting by dimension value (e.g. alphabetically by
                    user name) is not supported via the API.
                  items:
                    properties:
                      asc:
                        description: >-
                          Sort ascending (<code>true</code>) or descending
                          (<code>false</code>).
                        type: boolean
                      metric:
                        description: >-
                          Sort by a metric column. Provide the same structure as
                          a metric entry in the <code>metrics</code> array.
                        properties:
                          smart_datetime_reference:
                            type: string
                          smart_user_id_reference:
                            type: string
                          value:
                            type: string
                        type: object
                    required:
                      - asc
                    type: object
                  type: array
              required:
                - metrics
                - group_by
                - sorts
                - filters
                - group_by_totals_selected
                - pivot_group_by_totals_selected
                - date_ranges
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  report:
                    description: Report result (shape depends on request).
                    type: object
                type: object
          description: Successful response
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.