Skip to main content
Retrieves a paginated list of union members with filtering and search capabilities.

Authorization

Requires authentication. Access is role-based:
  • Admin: Can view all union members
  • Supervisor: Can view members from unions managed by their credit officers
  • Credit Officer: Can view members from their assigned unions only

Query Parameters

page
number
default:"1"
Page number for pagination
limit
number
default:"20"
Number of records per page
unionId
string
Filter members by specific union ID
currentOfficerId
string
Filter members by their assigned credit officer ID
Search across first name, last name, email, phone, and member code

Response

success
boolean
Indicates if the request was successful
data
array
Array of union member objects
pagination
object
Pagination metadata
curl -X GET "https://api.example.com/api/union-members?page=1&limit=20&search=John" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": [
    {
      "id": "clx123abc",
      "code": "MEM000001",
      "firstName": "John",
      "lastName": "Doe",
      "email": "[email protected]",
      "phone": "+234-800-000-0000",
      "address": "123 Main Street",
      "dateOfBirth": "1990-01-15T00:00:00.000Z",
      "gender": "Male",
      "maritalStatus": "Married",
      "profession": "Potter",
      "company": "Clay Works Ltd",
      "city": "Lagos",
      "state": "Lagos",
      "country": "Nigeria",
      "zipCode": "100001",
      "note": "Active member since 2020",
      "isVerified": true,
      "unionId": "union_123",
      "union": {
        "id": "union_123",
        "name": "Lagos Potters Union",
        "location": "Ikeja, Lagos"
      },
      "currentOfficerId": "officer_456",
      "currentOfficer": {
        "id": "officer_456",
        "firstName": "Jane",
        "lastName": "Smith",
        "email": "[email protected]"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-03-10T14:20:00.000Z"
    }
  ],
  "pagination": {
    "total": 150,
    "page": 1,
    "limit": 20,
    "pages": 8
  }
}

Build docs developers (and LLMs) love