---
title: "Signup reason"
method: GET
path: "/api/analytics/signup-reason"
tags: ["analytics"]
---

# Signup reason

`GET /api/analytics/signup-reason`

Returns per signup_reason: total users, users with CALL_CONOSCITIVA FATTO/DA_FARE, comparative stats, reason-to-patients map, and pie chart data. Optional filter by patient registration date range.

## Query parameters

- `from_date` string, date, nullable — Start date for patient registration filter (YYYY-MM-DD). If both from_date/to_date are set, only patients created in range are included.
- `to_date` string, date, nullable — End date for patient registration filter (YYYY-MM-DD).

## Response `200`

Successful Response

- SignupReasonResponse — Signup reason response model.
  - `rows` SignupReasonRow[], required — Rows per signup_reason (non-empty reason only)
    - `signup_reason` string, required — Signup reason
    - `total_users` integer, required — Total users (patients) with this reason
    - `users_with_call` integer, required — Users who have at least one intro (FATTO/DA_FARE)
    - `patients_with_call` SignupReasonUserInfo[] — User info for patients with intro
      - `id` string, uuid, required — User UUID
      - `first_name` string, nullable — First name
      - `last_name` string, nullable — Last name
      - `email` string, nullable — Email
      - `phone` string, nullable — Phone
    - `patients_without_call` SignupReasonUserInfo[] — User info for patients without intro
      - `id` string, uuid, required — User UUID
      - `first_name` string, nullable — First name
      - `last_name` string, nullable — Last name
      - `email` string, nullable — Email
      - `phone` string, nullable — Phone
  - `comparative` SignupReasonComparativeRow[], required — Comparative stats with pct_call, sorted by total_users desc
    - `signup_reason` string, required — Signup reason
    - `total_users` integer, required — Total users with this reason
    - `users_with_call` integer, required — Users with intro
    - `pct_call` number, required — Percentage with intro (0-100)
  - `reason_to_patients` object, required — Map signup_reason -> { patients_with_call, patients_without_call }
  - `calls_by_reason_pie` SignupReasonPieRow[], required — Pie chart data: reason and share of total patients
    - `signup_reason` string, required — Signup reason (segment label)
    - `num_patients` integer, required — Number of patients for this reason
    - `pct_patients` number, required — Percentage of total (0-100)
  - `distinct_signup_reasons` string[], required — List of distinct signup reasons (ordered by total_users desc)

## 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)
