> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-feat-user-history-moderation-detail.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# User Last Activity Report

> Export per-user last read & write timestamps to identify inactive accounts and drive re‑engagement or cleanup actions

## Overview

The User Last Activity Report provides the most recent timestamps of key actions (read + write) per user. Administrators use it to:

* Identify inactive / dormant accounts
* Drive re‑engagement campaigns (email / push)
* Plan archival or deletion workflows (e.g., GDPR cleanup)
* Validate growth & retention metrics against real interaction

<Info>
  Requires an **admin session**. These endpoints are for server / internal tooling only—never expose admin credentials to clients.
</Info>

## When To Use

Use this report when you need a lightweight snapshot of user activity recency rather than full behavioral analytics. For richer metrics (MAU/DAU, content engagement) see the broader **Analytics APIs** in the <a href="/analytics-and-moderation/social+-apis-and-services/README">API Overview</a>.

## Access & Permissions

* Admin credentials (admin token) required in Authorization header
* Scoped to your network / application only
* Rate limits apply (avoid high-frequency polling—prefer scheduled exports)
* **Minimum 5,000 users required** in your application to generate the report

<Warning>
  Do not embed admin token logic in front-end code. Generate and process reports using a secure backend or internal admin tool.
</Warning>

<Info>
  **User Count Requirement**: Your application must have at least 5,000 users to generate the User Last Activity Report. If your application has fewer users, the report generation will not be available.
</Info>

## Export Flow

<Steps>
  <Step title="Authenticate Admin Session">
    Submit credentials to obtain an authenticated admin session (token-based).
  </Step>

  <Step title="Request Report Export">
    Call the report endpoint. Response will return in CSV format.
  </Step>

  <Step title="Process & Act">
    Using the CSV output to trigger re‑engagement or cleanup workflows (bulk user delete API).
  </Step>
</Steps>

## API Contract (High-Level)

| Aspect | Value |
| - | - |
| Method | GET |
| Path | `/api/v1/reports/user-last-activity` |
| Auth | Admin token |
| Format | CSV |

<Tip>
  Prefer cursor-based pagination (if available) for large networks instead of increasing page size.
</Tip>

### Request

<Card title="View Full API Reference" icon="code" href="/api-reference/user/get-users-last-activity-report">
  See complete request/response schemas, parameters, and examples. This API only accepts admin token as authorization.
</Card>

## Interpreting Results

The report returns a CSV with the following columns:

| Column | Description |
| - | - |
| `user_id` | Internal user identifier |
| `user_public_id` | Public-facing user ID |
| `display_name` | User's display name |
| `last_active_utc` | Most recent activity timestamp (UTC) |

### Activity Patterns

| Scenario | Interpretation | Suggested Action |
| - | - | - |
| `last_active_utc` is null | Newly created / never logged in | Onboarding reminder |
| `last_active_utc` \< 30 days ago | Active user | Continue regular engagement |
| `last_active_utc` 30-90 days ago | At-risk user | Re-engagement campaign |
| `last_active_utc` ≥ 90 days ago | Dormant account | Re‑engagement or archival workflow |

## Automation Ideas

<AccordionGroup>
  <Accordion title="Re‑Engagement Campaigns">
    Export weekly, filter users with `last_active_utc` older than threshold, send personalized email or push, measure reactivation rate.
  </Accordion>

  <Accordion title="Dormant Cleanup">
    Flag accounts inactive > 180 days for soft archival. After notice period, proceed with deletion respecting compliance rules.
  </Accordion>

  <Accordion title="Bulk Delete Inactive Users">
    Use the CSV output directly with the [Bulk User Delete API](/api-reference/user/create-bulk-user-delete-job) to clean up inactive accounts. The API accepts the CSV format from this report, making it seamless to process dormant users at scale while maintaining audit trails.
  </Accordion>

  <Accordion title="Security Monitoring">
    Detect sudden stop in activity of high‑value users—trigger internal review or outreach.
  </Accordion>
</AccordionGroup>

## Troubleshooting

| Issue | Possible Cause | Fix |
| - | - | - |
| 401 / Unauthorized | Missing / expired admin cookie | Re-authenticate and resend request |
| Report not available | Application has fewer than 5,000 users | Wait until your application reaches 5,000 users minimum |
| Empty dataset | Filters defaulting to restrictive scope (if any) | Remove params / verify user activity exists |
| Missing columns | Feature disabled / retention policy | Confirm configuration; adapt parsing |
| Slow export | Large dataset without pagination | Use pagination or request CSV streaming |

<Tip>
  Always log the raw HTTP status + response headers for diagnostics. Store processed data separately from raw export for reproducibility.
</Tip>

## Related

<CardGroup cols={3}>
  <Card title="API Overview" icon="book" href="/analytics-and-moderation/social+-apis-and-services/README">All admin & analytics APIs</Card>
  <Card title="Webhook Events" icon="webhook" href="/analytics-and-moderation/social+-apis-and-services/webhook-event">Real-time notifications</Card>
  <Card title="Pre-Hook Events" icon="bolt" href="/analytics-and-moderation/social+-apis-and-services/pre-hook-event">Intercept & modify events</Card>
</CardGroup>

***

If you have questions, contact support at <a href="mailto:support@social.plus">[support@social.plus](mailto:support@social.plus)</a>.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.