Administrator Notifications API
Base URL: http://localhost:8000/api/v1
Prefix: /admins/notifications
Auth: JWT Bearer token for an active admin
Headers: Content-Type: application/json
1. List Notifications
Retrieve the authenticated admin’s notification history.
/admins/notifications/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Notifications retrieved successfully.",
"data": {
"notifications": {
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "b18c23d8-7c92-492f-96a4-2c5d6d9a4d10",
"title": "Property review requested",
"body": "Downtown Apartment is awaiting review.",
"type": "property",
"reference_type": "property",
"reference_id": "8d4b6d2e-1b7f-4a4b-8f2c-1efba83f9c91",
"is_read": false,
"read_at": null,
"created_at": "2026-09-14T10:00:00Z",
"updated_at": "2026-09-14T10:00:00Z"
}
]
}
}
}Notes
-
Returns only the logged-in admin’s notifications, newest first.
-
Default page size: 20.
-
Optional query parameters:
| Parameter | Example | Purpose |
|---|---|---|
page | 2 | Pagination |
is_read | false | Read/unread filter |
type | property | Notification category |
Example:
GET {{base_url}}/accounts/admins/notifications/?is_read=false&type=property&page=1-
Valid types:
property,conversation,appointment,purchase,rental,auction,investment,payment,payout,support,system. -
Invalid filters return HTTP
400. Invalid pages return HTTP404. -
Currently generated alerts cover property review, KYC/KYB review, and purchase/rental reservation-payment verification.
-
KYC/KYB alerts use
type: "system"and distinct reference types.
reference_type | reference_id | Admin destination |
|---|---|---|
property | Property UUID | Property review/details |
kyc | Verification UUID | KYC review |
kyb | Verification UUID | KYB review |
payment | Payment UUID | Manual payment verification |
The frontend maps these references to its screens. Payment navigation requires a corresponding payment-management screen/API. Handle deleted or unavailable target records gracefully.
2. Unread Count
Retrieve the admin’s unread notification count.
/admins/notifications/unread-count/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Unread notification count retrieved successfully.",
"data": {
"unread_count": 5
}
}Notes
-
Counts only the logged-in admin’s unread notifications.
-
Independent of notification-list filters.
3. Notification Details
Retrieve one notification belonging to the admin.
/admins/notifications/{notification_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Notification retrieved successfully.",
"data": {
"notification": {
"id": "b18c23d8-7c92-492f-96a4-2c5d6d9a4d10",
"title": "Property review requested",
"body": "Downtown Apartment is awaiting review.",
"type": "property",
"reference_type": "property",
"reference_id": "8d4b6d2e-1b7f-4a4b-8f2c-1efba83f9c91",
"is_read": false,
"read_at": null,
"created_at": "2026-09-14T10:00:00Z",
"updated_at": "2026-09-14T10:00:00Z"
}
}
}Notes
-
Viewing details does not mark the notification read.
-
Missing notifications and notifications belonging to another user return HTTP
404.
4. Update Read State
Mark a notification read or unread.
/admins/notifications/{notification_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"is_read": true
}Success Example
HTTP 200 OK
{
"success": true,
"message": "Notification updated successfully.",
"data": {
"notification": {
"id": "b18c23d8-7c92-492f-96a4-2c5d6d9a4d10",
"title": "Property review requested",
"body": "Downtown Apartment is awaiting review.",
"type": "property",
"reference_type": "property",
"reference_id": "8d4b6d2e-1b7f-4a4b-8f2c-1efba83f9c91",
"is_read": true,
"read_at": "2026-09-14T10:05:00Z",
"created_at": "2026-09-14T10:00:00Z",
"updated_at": "2026-09-14T10:05:00Z"
},
"unread_count": 0
}
}Notes
-
is_readis required. -
Use
falseto mark unread and clearread_at. -
Repeating the current state preserves the timestamp and does not broadcast another event.
-
State changes broadcast
notification.updatedto this admin’s connected tabs/devices. -
Invalid or missing
is_readreturns HTTP400. -
Missing or other-user notification IDs return HTTP
404.
5. Mark All Read
Mark all currently unread notifications belonging to the admin as read.
/admins/notifications/read-all/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Notifications marked as read successfully.",
"data": {
"updated": 5,
"unread_count": 0
}
}Notes
-
No request body is required.
-
Other admins’ read states remain independent.
-
Broadcasts
notifications.read_allwhen records change. -
New arrivals can make the returned unread count nonzero.
6. Live Notification Connection
Receive notification events through WebSockets.
ws://localhost:8000/ws/admins/notifications/?token={access_token}Auth: Required
Success Example
A new notification arrives as:
{
"type": "notification.created",
"notification": {
"id": "b18c23d8-7c92-492f-96a4-2c5d6d9a4d10",
"title": "Property review requested",
"body": "Downtown Apartment is awaiting review.",
"type": "property",
"reference_type": "property",
"reference_id": "8d4b6d2e-1b7f-4a4b-8f2c-1efba83f9c91",
"is_read": false,
"read_at": null,
"created_at": "2026-09-14T10:00:00Z",
"updated_at": "2026-09-14T10:00:00Z"
},
"unread_count": 1
}Notes
-
Use the server’s root URL, without the
/api/v1REST prefix. Usewss://with HTTPS deployments. -
The connection joins the authenticated admin’s private group automatically.
-
WebSocket events do not use the REST
success/message/dataenvelope.
| Event | Payload |
|---|---|
notification.created | notification, unread_count |
notification.updated | Updated notification, unread_count |
notifications.read_all | read_at, updated, unread_count |
Read-all event example:
{
"type": "notifications.read_all",
"read_at": "2026-09-14T10:05:00+00:00",
"updated": 5,
"unread_count": 0
}- Perform read/unread updates through REST. Sending client messages over this socket returns:
{
"type": "error",
"message": "Use REST APIs to update notifications."
}-
Invalid authentication or unavailable admin access closes the connection with code
4403. -
Admin access is rechecked on incoming messages and outgoing events.
-
Notifications persist before broadcasting. Failed live delivery does not undo the saved notification.
-
After connecting or reconnecting, fetch history and unread count through REST. Missed events are not automatically replayed.
-
Deduplicate displayed notifications by ID. Refresh visible history after
notifications.read_all. -
Announcements, payouts, and disputes are not connected in this release.
Common Success Format
REST endpoints use:
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}Common Error Format
HTTP 400 — validation error:
{
"success": false,
"message": "Validation failed.",
"errors": {
"is_read": [
"This field is required."
]
}
}HTTP 401 — missing authentication:
{
"success": false,
"message": "Authentication credentials were not provided.",
"errors": {}
}Invalid or expired tokens also return HTTP 401, with token-specific error details.
HTTP 403 — insufficient permissions:
{
"success": false,
"message": "You do not have permission to perform this action.",
"errors": {}
}Non-admin, inactive, blocked, and deleted accounts cannot access these APIs.
HTTP 404 — missing or other-user notification:
{
"success": false,
"message": "Notification not found.",
"errors": {}
}Malformed JSON returns HTTP 400. Unsupported methods return 405; unsupported request content types may return 415.