---
title: "Get User Memory Stats"
method: GET
path: "/api/v1/users/memory-stats"
tags: ["Users"]
---

# Get User Memory Stats

`GET /api/v1/users/memory-stats`

Get memory statistics for all users in the organization.

Returns per user: name, user_id, total hours of memory duration,
number of memories, last online timestamp, and device status.

Only non-archived, non-deleted memories are counted.

**Filter Options:**
- `today` - current day's data
- `week` - past 7 days (default)
- `month` - past 30 days
- `all_time` - complete historical data
- `custom` - user-defined date range (requires start_date and end_date)

**Sorting:**
- `sort_by`: total_hours (default), name, memory_count, last_online
- `sort_order`: desc (default) or asc

**Pagination:**
- `page`: Page number, 1-based (default: 1)
- `per_page`: Items per page, 1-100 (default: 10)

## Query parameters

- `time_range` 'today' | 'week' | 'month' | 'all_time' | 'custom'
- `start_date` string, nullable — Start date for custom range (ISO 8601)
- `end_date` string, nullable — End date for custom range (ISO 8601)
- `sort_by` 'name' | 'total_hours' | 'memory_count' | 'last_online'
- `sort_order` string — Sort direction: asc or desc
- `page` integer — Page number (1-based)
- `per_page` integer — Items per page (1-100)
- `tz_info` string, nullable — User's IANA timezone (e.g. Asia/Kolkata). Used to align date boundaries to the user's local midnight.

## Response `200`

Successful Response

- UserMemoryStatsResponse — Response model for user memory stats endpoint.
  - `items` UserMemoryStats[], required
    - `name` string, required
    - `user_id` string, required
    - `total_hours` number, required — Total memory duration in hours
    - `memory_count` integer, required — Number of non-archived memories
    - `last_online` string, nullable — Last online timestamp (ISO 8601)
    - `device_status` string — Device status: online or offline
  - `pagination` StatsPaginationInfo, required — Pagination metadata for memory stats.
    - `total` integer, required — Total number of users
    - `page` integer, required — Current page number (1-based)
    - `per_page` integer, required — Items per page
    - `total_pages` integer, required — Total number of pages
    - `has_next` boolean, required — Whether there is a next page
    - `has_prev` boolean, required — Whether there is a previous page
  - `time_range` string, required
  - `start_date` string, nullable — Filter start date (ISO 8601)
  - `end_date` string, nullable — Filter end date (ISO 8601)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/neosapien/apis/neocore.md) · [All operations](https://skmtc.dev/neosapien/apis/neocore/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/neosapien/neocore/revisions/8b94ef58f2cf/schema)
