---
title: "Get aggregate stats"
method: GET
path: "/v1/projects/{project_id}/stats/aggregate"
tags: ["stats"]
---

# Get aggregate stats

`GET /v1/projects/{project_id}/stats/aggregate`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/stats/aggregate`
- Auth: HTTP bearer

Returns run totals for the environment.

Includes total runs, completed, failed and cancelled counts, and the number of tool calls
for runs queued in the date range. Defaults to the last 30 days.

Required permission: `stats.view`.

## Path parameters

- `project_id` string, uuid, required

## Query parameters

- `environment_id` string, uuid, required: Environment to count runs in.
- `start_date` string, date-time, nullable: Only runs queued at or after this time. Defaults to 30 days ago; no offset means UTC.
- `end_date` string, date-time, nullable: Only runs queued at or before this time. Defaults to now; no offset means UTC.

## Response `200`

Successful Response

- PublicAggregateStatsResponse
  - `total_runs` integer, required: Runs queued in the date range.
  - `total_success` integer, required: Runs that completed.
  - `total_failed` integer, required: Runs that failed.
  - `total_cancelled` integer, required: Runs that were cancelled.
  - `total_tool_calls` integer, required: Tool calls made by those runs.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/connic/apis/connic-api.md) · [All operations](https://skmtc.dev/connic/apis/connic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/connic/apis/connic-api/revisions/482932da5fbe?raw)
