---
title: "Project metrics for a period"
method: GET
path: "/api/projects/{id}/analytics"
tags: ["Analytics"]
---

# Project metrics for a period

`GET /api/projects/{id}/analytics`

## Request

- Base URL: `https://dosai.pro`
- URL: `https://dosai.pro/api/projects/{id}/analytics`
- Auth: HTTP bearer

Dialogs, leads, conversion, response time and daily series. A dialog counts only when the assistant actually replied.

## Query parameters

- `from` string, date
- `to` string, date

## Response `200`

Metrics.

- Analytics: Metrics for the requested period. Money-related members (`spending`) are present only for the project owner. `*Incomplete` flags mean a section could not be computed in full and must not be read as zeros.
  - `role` string: Caller's role on the project.
  - `isOwner` boolean
  - `stats` object
    - `periodConversations` integer: Dialogs in the period; a dialog counts only once the assistant replied.
    - `periodLeads` integer
    - `conversionRate` number, nullable: Percent, leads over dialogs.
    - `todayConversations` integer
    - `todayLeads` integer
  - `avgResponseTimeSec` number, nullable
  - `timeToConvert` number, nullable: Seconds from first message to lead.
  - `dailyData` object[]: Daily series for the period.
    - `date` string: Short day label D.MM.
    - `day` string, date: Calendar day YYYY-MM-DD in the project's time zone.
    - `conversations` integer
    - `leads` integer
  - `leadsByStatus` object[]
  - `leadsBySource` object[]
  - `leadsByTag` object[]
  - `statusFunnel` object[]
  - `dialogsByChannel` object
  - `sourceBreakdowns` object
  - `adCreatives` object[]
  - `campaigns` object[]
  - `quality` object
  - `hourlyHeatmap` object[]
  - `topUnanswered` object[]
  - `spending` object: Owner only.
  - `spendingUnavailable` boolean: Owner only: spend could not be read, which is not the same as zero spend.
  - `dataIncomplete` boolean
  - `heatmapDataIncomplete` boolean
  - `funnelDataIncomplete` boolean

## Other responses

- `400`: Validation failed.
- `401`: Missing, invalid, expired or revoked key.
- `403`: Not allowed. Distinguish by `code`: `INSUFFICIENT_SCOPE` (read-only key attempted a mutation), `API_KEY_PROJECT_SCOPE` (project-scoped key reached outside its project), `FORBIDDEN` (the user's role on this project is too low), `ACCOUNT_BANNED`.
- `404`: No such resource, or it belongs to another account.
- `429`: Too many requests. 120/min per key overall, plus a stricter per-endpoint budget. Retry after the number of seconds in Retry-After.

---

[API](https://skmtc.dev/dosai/apis/dos-ai-public-api.md) · [All operations](https://skmtc.dev/dosai/apis/dos-ai-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dosai/apis/dos-ai-public-api/revisions/38ce5f4e8f50?raw)
