Administrator Announcements API
Base URL: http://localhost:8000/api/v1
Prefix: /admins/announcements
Auth: JWT Bearer token for an active admin
Headers: Content-Type: application/json
1. List Announcements
Retrieve announcements created for platform administration.
/admins/announcements/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Announcements retrieved successfully.",
"data": {
"announcements": {
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "7e8d7f4d-5f5c-4c78-9d95-6c5308d2c9c1",
"title": "Maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "normal",
"channels": [
"in_app"
],
"status": "draft",
"scheduled_at": null,
"published_at": null,
"created_by": "f9c8f4a4-1e32-4c2b-9f5c-14c5a965c3ef",
"created_at": "2026-09-26T10:30:00Z",
"updated_at": "2026-09-26T10:30:00Z"
}
]
}
}
}Notes
Default page size: 20.
Maximum page size: 100.
Optional query parameters:
| Parameter | Example | Purpose |
|---|---|---|
page | 1 | Pagination |
page_size | 20 | Items per page |
status | draft | Filter by status |
priority | high | Filter by priority |
Example:
GET {{base_url}}/admins/announcements/?status=draft&priority=high&page=1&page_size=20Valid statuses: draft, scheduled, published, failed.
Valid priorities: low, normal, high, urgent.
2. Create Announcement
Create a new announcement.
/admins/announcements/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"title": "Maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "normal",
"channels": [
"in_app"
],
"status": "draft",
"scheduled_at": null
}Success Example
HTTP 201 Created
{
"success": true,
"message": "Announcement created successfully.",
"data": {
"announcement": {
"id": "7e8d7f4d-5f5c-4c78-9d95-6c5308d2c9c1",
"title": "Maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "normal",
"channels": [
"in_app"
],
"status": "draft",
"scheduled_at": null,
"published_at": null,
"created_by": "f9c8f4a4-1e32-4c2b-9f5c-14c5a965c3ef",
"created_at": "2026-09-26T10:30:00Z",
"updated_at": "2026-09-26T10:30:00Z"
}
}
}Notes
Valid audience roles:
buyer
renter
seller_owner
investor
agent
admin
allThe all role cannot be combined with other roles.
Valid channels:
in_app
email
push
smsstatus: "published" cannot be submitted directly. Use the publish endpoint.
If status is scheduled, scheduled_at is required.
3. Announcement Details
Retrieve one announcement.
/admins/announcements/{announcement_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
HTTP 200 OK
{
"success": true,
"message": "Announcement retrieved successfully.",
"data": {
"announcement": {
"id": "7e8d7f4d-5f5c-4c78-9d95-6c5308d2c9c1",
"title": "Maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "normal",
"channels": [
"in_app"
],
"status": "draft",
"scheduled_at": null,
"published_at": null,
"created_by": "f9c8f4a4-1e32-4c2b-9f5c-14c5a965c3ef",
"created_at": "2026-09-26T10:30:00Z",
"updated_at": "2026-09-26T10:30:00Z"
}
}
}Notes
Missing announcement IDs return HTTP 404.
4. Update Announcement
Update an existing announcement.
/admins/announcements/{announcement_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"title": "Updated maintenance notice",
"priority": "high",
"status": "scheduled",
"scheduled_at": "2026-09-30T22:00:00Z"
}Success Example
HTTP 200 OK
{
"success": true,
"message": "Announcement updated successfully.",
"data": {
"announcement": {
"id": "7e8d7f4d-5f5c-4c78-9d95-6c5308d2c9c1",
"title": "Updated maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "high",
"channels": [
"in_app"
],
"status": "scheduled",
"scheduled_at": "2026-09-30T22:00:00Z",
"published_at": null,
"created_by": "f9c8f4a4-1e32-4c2b-9f5c-14c5a965c3ef",
"created_at": "2026-09-26T10:30:00Z",
"updated_at": "2026-09-26T10:45:00Z"
}
}
}Notes
The following fields are read-only:
id
published_at
created_by
created_at
updated_atPublished status cannot be set through this endpoint.
5. Publish Announcement
Publish an announcement and deliver it through the selected channels.
/admins/announcements/{announcement_id}/publish/Auth: Required
Headers
Authorization: Bearer {{access_token}}No request body is required.
Success Example
HTTP 200 OK
{
"success": true,
"message": "Announcement published successfully.",
"data": {
"announcement": {
"id": "7e8d7f4d-5f5c-4c78-9d95-6c5308d2c9c1",
"title": "Maintenance notice",
"message": "The platform will be unavailable briefly.",
"audience": {
"roles": [
"buyer",
"renter"
]
},
"priority": "normal",
"channels": [
"in_app"
],
"status": "published",
"scheduled_at": null,
"published_at": "2026-09-26T11:00:00Z",
"created_by": "f9c8f4a4-1e32-4c2b-9f5c-14c5a965c3ef",
"created_at": "2026-09-26T10:30:00Z",
"updated_at": "2026-09-26T11:00:00Z"
},
"delivery": {
"in_app": {
"status": "sent",
"recipient_count": 25
}
}
}
}Multiple Channels Example
{
"delivery": {
"in_app": {
"status": "sent",
"recipient_count": 25
},
"email": {
"status": "coming_soon",
"message": "Email delivery coming soon."
},
"push": {
"status": "coming_soon",
"message": "Push delivery coming soon."
},
"sms": {
"status": "coming_soon",
"message": "SMS delivery coming soon."
}
}
}Notes
-
Publishing changes the announcement status to
published. -
published_atis set automatically. -
In-app notifications are created for users matching the configured audience roles.
-
An already published announcement cannot be published again.
-
A failed announcement cannot be published.
-
Email, push, and SMS delivery are currently placeholders.
Common Success Format
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}Common Error Format
HTTP 400 — Validation Error
{
"success": false,
"message": "Validation failed.",
"errors": {
"scheduled_at": [
"This field is required when scheduled."
]
}
}HTTP 401 — Missing Authentication
{
"success": false,
"message": "Authentication credentials were not provided.",
"errors": {}
}Invalid or expired tokens also return HTTP 401.
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 — Announcement Not Found
{
"success": false,
"message": "Announcement not found.",
"errors": {}
}Malformed JSON returns HTTP 400. Unsupported methods return HTTP 405.