Administrator User Management API
Base URL: http://localhost:8000/api/v1
Prefix: /accounts/admins
Auth: Bearer access token with the admin role
Headers: Content-Type: application/json
1. List Users
Returns a paginated list of EstateHub users. Supports searching and filtering by account, role, and verification criteria.
/accounts/admins/users/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "Users retrieved successfully.",
"data": {
"users": {
"count": 42,
"next": "http://localhost:8000/api/v1/accounts/admins/users/?page=2",
"previous": null,
"results": [
{
"id": "f4f99de2-462b-4c42-8708-72c4bbb51fcc",
"full_name": "Emily Wilson",
"email": "ayesha.james@example.com",
"avatar_url": "https://example.com/avatars/ayesha.jpg",
"roles": [
"buyer",
"investor"
],
"status": "active",
"is_active": true,
"is_staff": false,
"is_email_verified": true,
"is_phone_verified": false,
"date_joined": "2026-08-21T09:30:00Z",
"created_at": "2026-08-21T09:30:00Z",
"updated_at": "2026-09-08T15:10:00Z"
}
]
}
}
}Notes
-
Supported search parameters:
-
search: searchesfull_name,email, andphone. -
q: alias forsearch.
-
-
Search is case-insensitive and performs a partial match.
-
Supported account filters:
-
role:buyer,renter,seller_owner,investor,agent, oradmin. -
status:active,blocked, ordeleted. -
is_active:trueorfalse. -
is_staff:trueorfalse. -
is_email_verified:trueorfalse. -
is_phone_verified:trueorfalse.
-
-
Supported verification filters:
-
verification_type:kyc,kyb,agent_verification, orbidder_verification. -
verification_status:not_submitted,pending,approved,rejected, orexpired.
-
-
Pagination parameters:
-
page: requested page number. -
page_size: number of users per page, up to 50.
-
-
Example:
GET /accounts/admins/users/?search=ayesha&role=buyer&status=active&page=1-
Phone numbers, biographies, notification preferences, social-account information, passwords, tokens, verification documents, and verification-submission data are not returned in list results.
-
Returns
401 Unauthorizedwhen authentication is missing or invalid. -
Returns
403 Forbiddenwhen the authenticated user does not have theadminrole. -
Returns
400 Bad Requestfor unsupported filter values.
2. Get User Details
Returns detailed account information and safe verification summaries for one user.
/accounts/admins/users/{user_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "User details retrieved successfully.",
"data": {
"user": {
"id": "f4f99de2-462b-4c42-8708-72c4bbb51fcc",
"full_name": "Emily Wilson",
"email": "ayesha.james@example.com",
"phone": "+15125550106",
"avatar_url": "https://example.com/avatars/ayesha.jpg",
"bio": "Property investor based in Austin.",
"roles": [
"buyer",
"investor"
],
"status": "active",
"is_active": true,
"is_staff": false,
"is_superuser": false,
"is_email_verified": true,
"is_phone_verified": false,
"email_verified_at": "2026-08-21T10:15:00Z",
"phone_verified_at": null,
"last_login": "2026-09-08T14:00:00Z",
"date_joined": "2026-08-21T09:30:00Z",
"created_at": "2026-08-21T09:30:00Z",
"updated_at": "2026-09-08T15:10:00Z",
"verifications": [
{
"id": "026a4ccb-bcc7-4953-803e-1b5bfabeb6c4",
"type": "kyc",
"status": "approved",
"rejection_reason": "",
"reviewed_at": "2026-08-22T11:45:00Z",
"created_at": "2026-08-21T11:00:00Z",
"updated_at": "2026-08-22T11:45:00Z"
}
]
}
}
}Notes
-
Contact and profile details are available only through this admin-protected endpoint.
-
Verification entries are summaries only.
-
Verification
submitted_data, documents, passwords, authentication tokens, notification preferences, and social-provider payloads are never returned. -
Use the existing KYC or KYB detail endpoint when an admin needs to review a verification submission.
-
Returns
401 Unauthorizedwhen authentication is missing or invalid. -
Returns
403 Forbiddenwhen the authenticated user does not have theadminrole. -
Returns
404 Not Foundwhen the user does not exist.
3. Update User
Updates the supported account-management fields for one user.
/accounts/admins/users/{user_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"status": "blocked",
"roles": [
"buyer",
"investor"
],
"is_active": false
}Success Example
{
"success": true,
"message": "User updated successfully.",
"data": {
"user": {
"id": "f4f99de2-462b-4c42-8708-72c4bbb51fcc",
"full_name": "Emily Wilson",
"email": "ayesha.james@example.com",
"phone": "+15125550106",
"avatar_url": "https://example.com/avatars/ayesha.jpg",
"bio": "Property investor based in Austin.",
"roles": [
"buyer",
"investor"
],
"status": "blocked",
"is_active": false,
"is_staff": false,
"is_superuser": false,
"is_email_verified": true,
"is_phone_verified": false,
"email_verified_at": "2026-08-21T10:15:00Z",
"phone_verified_at": null,
"last_login": "2026-09-08T14:00:00Z",
"date_joined": "2026-08-21T09:30:00Z",
"created_at": "2026-08-21T09:30:00Z",
"updated_at": "2026-09-09T08:20:00Z",
"verifications": [
{
"id": "026a4ccb-bcc7-4953-803e-1b5bfabeb6c4",
"type": "kyc",
"status": "approved",
"rejection_reason": "",
"reviewed_at": "2026-08-22T11:45:00Z",
"created_at": "2026-08-21T11:00:00Z",
"updated_at": "2026-08-22T11:45:00Z"
}
]
}
}
}Notes
-
Every supported request-body field is optional, but at least one supported field must be supplied.
-
Supported fields:
-
status:active,blocked, ordeleted. -
roles: A non-empty array of unique roles. Valid values arebuyer,renter,seller_owner,investor,agent, andadmin. -
is_active:trueorfalse.
-
-
Unsupported and read-only fields are not modified.
-
deletedis a soft-delete status; it does not remove the user record from the database. -
When setting
statustoblockedordeleted, also set"is_active": falseto prevent authentication. -
An admin cannot block, soft-delete, or deactivate their own account.
-
An admin cannot remove the
adminrole from their own account. -
Password changes and verification approvals use dedicated APIs.
-
Returns
400 Bad Requestfor invalid roles, duplicate or empty roles, invalid statuses, empty updates, or unsafe self-updates. -
Returns
401 Unauthorizedwhen authentication is missing or invalid. -
Returns
403 Forbiddenwhen the authenticated user does not have theadminrole. -
Returns
404 Not Foundwhen the specified user does not exist.
4. Get User KPIs
Returns account and verification totals for administrator dashboards.
/accounts/admins/users/kpis/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "User management KPIs retrieved successfully.",
"data": {
"kpis": {
"total_users": 120,
"active_accounts": 108,
"blocked_users": 3,
"new_users_this_month": 14,
"pending_kyc": 6,
"pending_kyb": 2,
"users_by_role": {
"buyer": 70,
"renter": 38,
"seller": 24,
"admin": 3
}
}
}
}Notes
- Deleted accounts are excluded from the aggregate totals.
Common Success Format
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}Common Error Format
{
"success": false,
"message": "Validation failed.",
"errors": {
"field_name": [
"Error description."
]
}
}