Aggregate Entries
aggregate_entriesCalculate totals without paging: count, sum, average, min or max of a field, optionally grouped by date or another field. Answers how many, how much, average, top N, per month.
Instructions
Totals without paging rows: count, sum, average (ave), min or max of a field over the entries list_entries would list, optionally grouped by a field (a date by day, week or month) and broken down by a second field. Use it for 'how many / how much / total / average / top N / per month' questions instead of adding up list_entries pages.
The query parameters (module, listing, state, search, filters) ARE list_entries' — same names, same meaning, same access — so pass exactly what you would pass list_entries to read those entries.
The answer: groups [{key, count, value}] (with a breakdown, values [{key, value}] per group), total {count, value} over EVERY matching entry, complete (false: the module's engine read only its first 501 entries, so the figures are partial — narrow the filters, or say they are partial) and groupsTruncated (only the largest top groups, or the latest periods, are listed; total is still whole).
Filter or group by state when Cancelled or Draft entries must not count. What a figure means — signs, which entries belong in it — comes from the module's description and get_module_schema.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The metric | |
| top | No | Most groups returned, 1–500. Default 100. | |
| field | No | Field the metric reads (a number for sum/ave; a number or date for min/max). Not needed for count. | |
| state | No | ||
| module | Yes | Module name from list_modules | |
| search | No | Free-text search across document ID, state, and text-like fields; supports * and ? wildcards | |
| filters | No | ||
| groupBy | No | Field to group by: a display name, or state, date, createdBy, assignees … | |
| listing | No | Listing (saved view) name to query, case-insensitive; 'archive' targets archived entries. Defaults to the unfiltered 'Everything' view, which is admin-only on modules with listings — non-admins must name an accessible listing (an access-denied response lists them). | |
| interval | No | Only when groupBy is a date field. Default day. | |
| breakdown | No | Second field, splitting each group | |
| workspaceId | No | Workspace ID. Omit if set via env or set_workspace; required in stateless/remote mode. |