TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Priyanshu471/ad-management/llms.txt
Use this file to discover all available pages before exploring further.
/api/users endpoint provides a single GET route that returns every user document stored in the MongoDB users collection. It is used primarily by the Admin panel to populate the advertisers and creators management tables, but it can be called by any client that needs a full list of registered accounts. No request body or query parameters are required.
GET /api/users
Fetches all user documents from MongoDB and returns them as an array under theusers key. The response includes each user’s profile fields as stored in the database.
Request
No request body is required. Simply issue aGET request to the endpoint.
Response 200
Error Response
| Status | Body | Cause |
|---|---|---|
500 | { "error": { ... } } | Unexpected server or MongoDB error |
cURL Example
This endpoint currently returns all fields on every user document, which includes the This ensures sensitive credentials are never exposed over the network, even on internal admin routes.
password field stored in plain text. Before deploying to production, strip the password from the response by adding .select("-password") to the Mongoose query: