> For the complete documentation index, see [llms.txt](https://docs.tiny.plus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tiny.plus/api/endpoints/stats.md).

# Pipeline statistics

<mark style="color:blue;">`GET`</mark> `https://api.tiny.plus/v2/stats/projects`

Totals for your project pipeline: a count, and value and fee totals, for each status and phase. The figures cover the same projects a [project list](/api/endpoints/projects.md) would return for the same filters, grouped for you so you don't have to add them up.

Statistics are available for projects only.

## Your projects, or the whole account

| Request                      | Covers                                   |
| ---------------------------- | ---------------------------------------- |
| `GET /v2/stats/projects`     | The projects linked to the token's user. |
| `GET /v2/stats/projects/all` | Every project in the account.            |

Seeing the whole account needs permission: the token's user must be able to see the company-wide pipeline. That's the `all_records.projects` flag in [`/me`](/api/endpoints/me.md#permissions) (a records admin has it; a standard user has it only if the account grants it). Without it, `/all` is refused:

```json
{
    "message": "Permission denied"
}
```

{% hint style="info" %}
This is the one v2 endpoint whose error uses `message` rather than `error`. It answers `403`.
{% endhint %}

## Narrowing the figures

| Parameter     | Description                                                                                                                                                                                           |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `me`          | `me=1` counts only the token user's projects, even under `/all`. `me=0` counts the whole account (and needs the same permission as `/all`).                                                           |
| `staff`       | A team member id. Counts the projects linked to that person. Naming someone else needs the company-wide permission.                                                                                   |
| Field filters | Any projects field, with the [filter grammar](/api/concepts/listing.md#filtering). `record_status=won,proposal`, `fee_value=>100000` and `created_date=2026-01-01..2026-12-31` all work, and combine. |
| `use_cache`   | `use_cache=0` reads past the cache after a write.                                                                                                                                                     |

There's no paging or sorting: you get every group. An unknown filter name is ignored.

## The response

An object keyed by `record_status`. Projects with no status are under the key `""`. Each status carries its totals and a `phases` object, keyed by phase id, with `"0"` for projects in no phase.

```bash
curl "https://api.tiny.plus/v2/stats/projects/all" \
  -H "Authorization: Bearer {{user_access_token}}"
```

```json
{
    "active": {
        "record_status": "active",
        "total_count": 163,
        "total_project_value": "24455000.00",
        "avg_project_value": "1746785.714286",
        "total_fee_value": "6674945.00",
        "avg_fee_value": "208592.031250",
        "avg_age": 2638,
        "phases": {
            "0":     { "record_status": "active", "record_phase": 0, "total_count": 155, "total_fee_value": "2404390.00", "...": "..." },
            "62133": { "record_status": "active", "record_phase": 62133, "total_count": 8, "total_fee_value": "4270555.00", "...": "..." }
        }
    },
    "won": { "record_status": "won", "total_count": 42, "...": "..." },
    "": { "record_status": "", "total_count": 8, "...": "..." }
}
```

| Field                                    | Meaning                                                                       |
| ---------------------------------------- | ----------------------------------------------------------------------------- |
| `total_count`                            | The number of projects in the group. A whole number.                          |
| `total_project_value`, `total_fee_value` | The summed project value and fee, as strings with two decimal places.         |
| `avg_project_value`, `avg_fee_value`     | The averages, as strings, or `null` when no project in the group has a value. |
| `avg_age`                                | The average age in days, from each project's created date.                    |
| `phases`                                 | The same figures again, split by phase. `record_phase` is `0` for no phase.   |

No projects match returns `{}`. The order of the status keys isn't fixed, so read them by key, not by position.

{% hint style="info" %}
Amounts are whole units of the account's currency, with two decimal places — not cents. They're converted from each project's own currency to the account's. The [Projects](/api/endpoints/projects.md) page covers how project values are stored.
{% endhint %}

{% hint style="warning" %}
On accounts that use stages, the figures are per stage: a project with several stages contributes to each of them, so summing `total_project_value` across every group can count a project's value more than once. Use the per-status and per-phase figures as they are, rather than adding them into an account-wide total.
{% endhint %}

## Fees

When the token's user can't see fees (`show_fees` is `false` in [`/me`](/api/endpoints/me.md#permissions)), `total_fee_value` and `avg_fee_value` come back `null`, though the keys stay. The counts and project values are unaffected.
