Back to KB
Difficulty
Intermediate
Read Time
4 min

GET /api/admin/users

By Codcompass TeamΒ·Β·4 min read

GET /api/admin/users

1. Overview

The GET /api/admin/users endpoint provides a comprehensive listing of all registered user accounts within the platform. It is designed primarily for platform administrators, internal dashboard tooling, and automated monitoring systems that require real-time visibility into user demographics, subscription states, and account statuses.

When to call this endpoint:

  • Auditing & Compliance: Review user registration trends, verify role assignments, or audit subscription statuses across the platform.
  • Account Management: Identify banned users, check plan types, or sync user data to external analytics or CRM systems.
  • Operational Monitoring: Feed user metrics into admin dashboards that require fresh, uncached data.

Important Implementation Note: Although endpoint metadata may indicate public access, the underlying implementation enforces strict session validation. Only authenticated users with an ADMIN role can successfully retrieve data. Unauthenticated or non-admin requests will be rejected with a 403 Forbidden response.


2. Endpoint Reference

PropertyValue
HTTP MethodGET
Path/api/admin/users
AuthenticationAdmin session required (cookie-based or token-based via @/lib/auth)
Rate LimitingNot enforced at the route level; governed by platform-wide API gateway policies
Caching Behaviorforce-dynamic (bypasses Next.js static generation; always queries the database)
Response Formatapplication/json

3. Request Format

This endpoint does not accept query parameters or a reque

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back

Sources

  • β€’ api-reference