---
title: "Trend call conoscitiva"
method: GET
path: "/api/analytics/trend-call-conoscitiva"
tags: ["analytics"]
---

# Trend call conoscitiva

`GET /api/analytics/trend-call-conoscitiva`

Returns metrics (avg days reg->intro, intro->start), applied filters, paginated rows from trend_call_conoscitiva, and chart data (counts by start_type and has_started). Single endpoint replacing multiple Supabase queries.

## Query parameters

- `from_date` string, date, nullable — Filter: first_intro_datetime >= from_date (YYYY-MM-DD). Default: today minus 30 days.
- `to_date` string, date, nullable — Filter: first_intro_datetime <= to_date (YYYY-MM-DD). Default: today.
- `has_verified_consent_psi` boolean, nullable — Filter by psychologist informed consent verified (true/false).
- `has_verified_consent_nutri` boolean, nullable — Filter by nutritionist informed consent verified (true/false).
- `has_started` boolean, nullable — Filter by has_started (true/false).
- `start_type` string, nullable — Filter by start_type: None, Psychologist only, Nutritionist only, Both.
- `per_page` integer — Page size.
- `page` integer — Page number (1-based).

## Response `200`

Successful Response

- TrendCallConoscitivaResponse — Trend call conoscitiva response model.
  - `metrics` TrendCallConoscitivaMetrics, required — Trend call conoscitiva metrics model.
    - `avg_days_reg_to_call` number, nullable — Avg days from registration to first intro
    - `avg_days_call_to_start` number, nullable — Avg days from first intro to first session
  - `filters` TrendCallConoscitivaFilters, required — Trend call conoscitiva filters model.
    - `from_date` string, date, required — Filter: first_intro_datetime >= from_date
    - `to_date` string, date, required — Filter: first_intro_datetime <= to_date
    - `has_verified_consent_psi` boolean, nullable — Filter by psychologist consent verified (true/false)
    - `has_verified_consent_nutri` boolean, nullable — Filter by nutritionist consent verified (true/false)
    - `has_started` boolean, nullable
    - `start_type` string, nullable
    - `per_page` integer, required
    - `total` integer, required — Total rows matching filters (before pagination)
  - `rows` TrendCallConoscitivaRow[], required — Paginated list from view
    - `user_id` string, uuid, required — User UUID
    - `patient_id` string, uuid, required — Patient UUID
    - `nutritionist_user_id` string, uuid, nullable
    - `psychologist_user_id` string, uuid, nullable
    - `first_name` string, nullable
    - `registered_at` string, date-time, nullable
    - `date_of_birth` string, date, nullable
    - `last_name` string, nullable
    - `email` string, nullable
    - `phone` string, nullable
    - `appointment_count` integer, nullable
    - `has_verified_consent_psi` boolean, nullable
    - `has_verified_consent_nutri` boolean, nullable
    - `psychologist_assigned` string, nullable
    - `nutritionist_assigned` string, nullable
    - `first_intro_datetime` string, date-time, nullable
    - `first_psychologist_datetime` string, date-time, nullable
    - `first_nutritionist_datetime` string, date-time, nullable
    - `has_started` boolean, nullable
    - `start_type` string, nullable
    - `days_intro_to_start` number, nullable
  - `charts` TrendCallConoscitivaCharts, required — Trend call conoscitiva charts model.
    - `tipo_inizio_data` TrendCallConoscitivaChartItem[] — Counts per start_type (None, Psychologist only, etc.)
      - `key` string, required — Category key (e.g. start_type or 'true'/'false'/'null')
      - `count` integer, required — Number of rows in this category
    - `ha_iniziato_data` TrendCallConoscitivaChartItem[] — Counts per has_started (true, false, null)
      - `key` string, required — Category key (e.g. start_type or 'true'/'false'/'null')
      - `count` integer, required — Number of rows in this category

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/13c1bce1bdc4/schema)
