Skip to main content

Endpoint

GET /api/v1/users
Retrieves all users registered in the notification system. This endpoint returns the complete user list including their notification preferences.

Response

success
boolean
Indicates if the request was successful
data
array
Array of user objects

Example request

cURL
curl -X GET http://localhost:8001/api/v1/users
JavaScript
const response = await fetch('http://localhost:8001/api/v1/users', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});

const users = await response.json();
Python
import requests

response = requests.get('http://localhost:8001/api/v1/users')
users = response.json()

Example response

[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "John Doe",
    "email": "[email protected]",
    "push_token": "fcm_token_abc123",
    "preferences": {
      "email": true,
      "push": true
    },
    "created_at": "2024-03-01T10:00:00Z",
    "updated_at": "2024-03-01T10:00:00Z"
  },
  {
    "id": "987f6543-e21b-45d6-a789-123456789abc",
    "name": "Jane Smith",
    "email": "[email protected]",
    "push_token": null,
    "preferences": {
      "email": true,
      "push": false
    },
    "created_at": "2024-03-02T14:30:00Z",
    "updated_at": "2024-03-02T14:30:00Z"
  }
]

Use cases

  • Display user management dashboard
  • Export user data for analytics
  • Verify user registrations
  • Audit notification preferences across all users
This endpoint returns all users without pagination. For production systems with many users, consider implementing pagination to improve performance.

Build docs developers (and LLMs) love