Aggregate call volume, talk time, and spend over one or more date windows

Aggregation runs in SQL over the whole call history for the organization/project, not just a bounded list page, so the figures stay exact however long that history grows. Pass organization_id (and optionally project_id) as query parameters the same way GET /v1/calls does. window is repeated, each in the form <key>:<since-timestamp> (an RFC3339 UTC timestamp); at least one is required and at most 8 may be requested in one call. until is an optional exclusive upper bound (RFC3339 UTC, defaults to now) shared by every window. Pass agent_window naming one of the requested window keys to additionally receive a per-agent breakdown over that one window. That breakdown is a bounded page ordered by agent_id: check agents_has_more and continue with agent_after=<agents_next_cursor> rather than reading one page as the organization's whole agent list. The window totals themselves are never truncated -- they are aggregated in SQL over the entire history in scope.

get/v1/calls/stats

Request

  • Base URL: https://api.skysay.ai
  • URL: https://api.skysay.ai/v1/calls/stats
  • Auth: HTTP bearer

Query parameters

organization_idstring required

The authenticated organization; must match the bearer's own workspace.

project_idstring

Optional project in the authenticated organization. Omit to aggregate the whole organization.

untilstring date-time

Exclusive upper bound shared by every window. Defaults to the current time.

windowstring[] required

Repeated '<key>:<since>' pairs, e.g. window=today:2026-08-27T00:00:00Z. key is 1-32 characters of [A-Za-z0-9_-] and must not repeat across the request. At least one is required.

agent_windowstring

One of the window keys already requested. When set, the response also includes a per-agent breakdown over that window.

agent_limitinteger

Maximum agents in the agent_window breakdown. Validated whenever it is sent -- a non-numeric value is a 400 either way -- but it only changes the response when agent_window is set.

agent_afterstring

Continue the agent breakdown after this agent_id -- pass agents_next_cursor from the previous response. Only changes the response when agent_window is set.

Response

Call stats

agent_windowstring

Present only when you requested one.

agents_has_moreboolean

Present only when agent_window was requested. True when the organization has more agents than this page holds; the page is NOT the whole set unless this is false.

agents_limitinteger

Present only when agent_window was requested: the page size actually applied, after clamping.

agents_next_cursorstring

Present only when agent_window was requested. Non-empty only when agents_has_more is true: pass it as agent_after to continue. Empty string on the last page.

agents_returnedinteger

Present only when agent_window was requested: agents in this page.

organization_idstring required
project_idstring required

Empty string when the request was not scoped to one project.

untilstring date-time required
windowsobject required

Keyed by the window key you supplied in the repeated window=<key>:<since> query parameter.

Changes

No recorded changes to this operation across all 1 revision of this API.