Get All Users Info

This route is restricted to Super Admin access only.

Get All Users

This endpoint retrieves a comprehensive list of all users who have subscribed to the platform's newsletter or updates. This is an administrative endpoint and requires an Admin API key for access.

🚧

This route is restricted to Super Admin access only.

Endpoint

GET /api/v1/users

Authentication

TypeRequiredLocationDescription
API KeytrueHeaderThe key must be sent as x-api-key: Super_ADMIN_KEY.

This endpoint is restricted to administrators. You must provide the master ADMIN_KEY to successfully authenticate the request.


Request

This endpoint does not require a request body or any URL parameters.

Example Request

Here is an example of how to call this endpoint using cURL. Replace YOUR_ADMIN_KEY with your actual Super admin API key.

curl -X GET 'https://offers.dataoorts.com/api/v1/users' \
-H 'x-api-key: YOUR_ADMIN_KEY'

Responses

✅ Success Response (200 OK)

A successful request will return an HTTP 200 OK status code and a JSON array of user objects.

Body

The body will be an array, where each object represents a single subscribed user.

[
  {
    "_id": "CUS_07022024222001729",
    "name": "Srinivasa Ramanujan",
    "email": "[email protected]",
    "phone": "+919876543210",
    "registered_at": "2024-05-20T14:30:00.123Z"
  },
  {
    "_id": "CUS_08032024101555890",
    "name": "Richard Phillips Feynman",
    "email": "[email protected]",
    "registered_at": "2024-05-19T09:00:00.456Z"
  }
]

Field Descriptions:

FieldTypeDescription
_idstringThe unique identifier for the user.
namestringThe full name provided by the user.
emailstringThe user's email address.
phonestringThe user's phone number. This field may be absent.
registered_atstringThe ISO 8601 timestamp of when the user subscribed.

❌ Error Response (401 Unauthorized)

This response is returned if the x-api-key header is missing, invalid, or does not belong to an administrator.

Body

{
  "error": "Unauthorized"
}
❗️

More than three failed attempts will result in a permanent IP block.


❌ Error Response (500 Internal Server Error)

This response indicates a problem on the server, such as a database connection error or an unexpected exception during processing.

Body

{
  "error": "A database error occurred",
  "details": "Specific error message from the database driver."
}