Skip to content

User Management

User Management

Manage your pharmacy team — add staff members, assign roles, and control access permissions. Keep your operations secure with role-based access.

List Provider Users

View all users associated with your pharmacy.

Terminal window
# Get all team members
getProviderProfiles()

Response:

{
"users": [
{
"id": "USER-123",
"name": "Dr. Sarah Johnson",
"email": "sarah@greencrosspharmacy.com",
"phone": "+2348012345678",
"role": "admin",
"permissions": ["all"],
"status": "active",
"lastLogin": "2026-04-18T08:30:00Z",
"createdAt": "2025-01-15T10:00:00Z"
},
{
"id": "USER-124",
"name": "Michael Adeyemi",
"email": "michael@greencrosspharmacy.com",
"phone": "+2348098765432",
"role": "pharmacist",
"permissions": ["orders", "customers", "formulary"],
"status": "active",
"lastLogin": "2026-04-18T09:15:00Z",
"createdAt": "2025-03-20T11:00:00Z"
},
{
"id": "USER-125",
"name": "Grace Okonkwo",
"email": "grace@greencrosspharmacy.com",
"phone": "+2348055555555",
"role": "staff",
"permissions": ["orders", "customers"],
"status": "active",
"lastLogin": "2026-04-17T16:45:00Z",
"createdAt": "2025-06-10T09:30:00Z"
}
],
"total": 5,
"roles": {
"admin": 1,
"pharmacist": 2,
"staff": 2
}
}

Create New User

Add a new team member to your pharmacy.

Terminal window
# Create new staff account
createProviderUser({
name: "Emmanuel Chukwu",
email: "emmanuel@greencrosspharmacy.com",
phone: "+2348077777777",
role: "pharmacist",
branchId: "BR-123"
})

Parameters:

ParameterTypeRequiredDescription
namestringYesFull name
emailstringYesEmail address
phonestringYesPhone number
rolestringYesUser role (see below)
branchIdstringNoAssigned branch

Response:

{
"success": true,
"userId": "USER-126",
"message": "User created successfully",
"tempPassword": "TempPass123!",
"inviteSent": true,
"createdAt": "2026-04-18T14:00:00Z"
}

User Roles

RolePermissionsBest For
adminFull accessPharmacy owners, managers
pharmacistOrders, customers, formularyLicensed pharmacists
staffOrders, customersSales assistants
accountantAnalytics, wallet, reportsFinance team
viewerRead-only accessAuditors, consultants

Update User

Modify user details or change roles.

Terminal window
# Update user information
updateProviderUser({
userId: "USER-124",
role: "admin",
branchId: "BR-124",
status: "active"
})

Deactivate User

Disable a user’s access without deleting their account.

Terminal window
# Deactivate user account
deactivateProviderUser({
userId: "USER-125",
reason: "Employment ended"
})

Reactivate User

Re-enable a deactivated user.

Terminal window
# Reactivate user account
reactivateProviderUser({
userId: "USER-125"
})

Delete User

Permanently remove a user from your pharmacy.

Terminal window
# Delete user account
deleteProviderUser({
userId: "USER-125",
transferDataTo: "USER-123" // optional: transfer orders/data
})

Reset Password

Reset a user’s password.

Terminal window
# Reset user password
resetProviderUserPassword({
userId: "USER-124",
notifyUser: true
})

Response:

{
"success": true,
"tempPassword": "NewTemp456!",
"userNotified": true
}

Custom Permissions

Assign specific permissions beyond role defaults:

Terminal window
# Set custom permissions
setProviderUserPermissions({
userId: "USER-124",
permissions: [
"orders",
"customers",
"formulary",
"analytics:read"
]
})

Available Permissions:

PermissionDescription
allFull system access
ordersCreate, view, update orders
customersManage customer records
formularyManage product catalog
analytics:readView reports (read-only)
analytics:writeCreate and export reports
walletView and manage finances
usersManage team members
settingsChange pharmacy settings

Activity Logs

Track user actions for audit purposes.

Terminal window
# Get user activity logs
getProviderUserActivity({
userId: "USER-124",
startDate: "2026-04-01",
endDate: "2026-04-30"
})

Response:

{
"activities": [
{
"action": "order_created",
"details": "Created order ORD-789 for customer CUST-123",
"timestamp": "2026-04-18T10:30:00Z",
"ip": "192.168.1.100"
},
{
"action": "customer_updated",
"details": "Updated customer CUST-124 phone number",
"timestamp": "2026-04-18T09:15:00Z",
"ip": "192.168.1.100"
}
]
}

Example: Team Management

Terminal window
# Step 1: View current team
getProviderProfiles()
# → Shows all users and their roles
# Step 2: Add new pharmacist
createProviderUser({
name: "Emmanuel Chukwu",
email: "emmanuel@greencrosspharmacy.com",
phone: "+2348077777777",
role: "pharmacist",
branchId: "BR-123"
})
# → User created with temp password
# Step 3: Update permissions
setProviderUserPermissions({
userId: "USER-126",
permissions: ["orders", "customers", "formulary", "analytics:read"]
})
# Step 4: Check activity
getProviderUserActivity({ userId: "USER-126", startDate: "2026-04-01" })
# → Shows user's actions

Security Best Practices

  1. Principle of least privilege — Give minimum necessary permissions
  2. Regular audits — Review user access quarterly
  3. Strong passwords — Require complex passwords
  4. Two-factor authentication — Enable 2FA for admin users
  5. Deactivate promptly — Remove access when staff leave

Next steps