Retrieve all users, update their plan, and activate or deactivate accounts. Admin role required.
All endpoints on this page require both a valid Bearer token and the admin role. Requests from non-admin accounts return 403 Forbidden.
These endpoints let administrators inspect and manage user accounts across the platform. They are protected by two middleware layers: authenticate (validates the JWT) and isAdmin (checks role === "admin").
POST /api/auth/admin-loginAdministrators authenticate through a dedicated login endpoint. The returned token carries the admin role and is required to call any of the endpoints below.
GET /api/admin/get-all-usersReturns a list of all registered users. Each record includes the user’s profile, subscription plan, account status, and usage data.
PATCH /api/admin/update-user-plan/:idOverrides the plan for a specific user. Use this to manually upgrade or downgrade an account outside of the normal Stripe checkout flow.
Changing a user’s plan via this endpoint does not create or modify any Stripe subscription. It only updates the database record. Use with care to avoid billing and access discrepancies.
PATCH /api/admin/update-user-activity/:idActivates or deactivates a user account. Deactivated accounts (isDisabled: true) cannot log in or access the platform.