curl -X GET "https://api.example.com/api/v2/admin/announcements?page=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements?page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"data": {
"data": [
{
"id": 1,
"tenant_id": "tenant-123",
"title": "System Maintenance Scheduled",
"summary": "We will be performing scheduled maintenance on our servers.",
"content": "Our servers will be undergoing scheduled maintenance on Sunday, December 15th from 2:00 AM to 4:00 AM EST. During this time, you may experience brief service interruptions.",
"type": "warning",
"priority": 1,
"status": "published",
"is_push_enabled": true,
"is_public": false,
"scheduled_at": null,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"push_status": "success",
"sent_at": "2024-12-11T10:00:00Z",
"attachment_type": null,
"attachment_url": null,
"created_by": 1,
"creator": {
"id": 1,
"name": "Admin User",
"email": "admin@example.com"
},
"created_at": "2024-12-11T09:30:00Z",
"updated_at": "2024-12-11T10:00:00Z"
}
],
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 1
}
}
Announcements
List Announcements
Retrieve all announcements for the current tenant with pagination support
GET
/
api
/
v2
/
admin
/
announcements
curl -X GET "https://api.example.com/api/v2/admin/announcements?page=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements?page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"data": {
"data": [
{
"id": 1,
"tenant_id": "tenant-123",
"title": "System Maintenance Scheduled",
"summary": "We will be performing scheduled maintenance on our servers.",
"content": "Our servers will be undergoing scheduled maintenance on Sunday, December 15th from 2:00 AM to 4:00 AM EST. During this time, you may experience brief service interruptions.",
"type": "warning",
"priority": 1,
"status": "published",
"is_push_enabled": true,
"is_public": false,
"scheduled_at": null,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"push_status": "success",
"sent_at": "2024-12-11T10:00:00Z",
"attachment_type": null,
"attachment_url": null,
"created_by": 1,
"creator": {
"id": 1,
"name": "Admin User",
"email": "admin@example.com"
},
"created_at": "2024-12-11T09:30:00Z",
"updated_at": "2024-12-11T10:00:00Z"
}
],
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 1
}
}
Headers
string
required
Bearer token for authentication
string
required
The tenant ID to scope the announcements
Query Parameters
integer
default:"1"
Page number for pagination
Response
boolean
Indicates if the request was successful
object
Show data
Show data
array
Array of announcement objects
Show announcement
Show announcement
integer
Unique identifier for the announcement
string
The tenant ID this announcement belongs to
string
The announcement title
string
Brief summary of the announcement
string
Detailed content of the announcement
string
Type of announcement:
info, warning, success, alertinteger
Priority level:
0 for normal, 1 for highstring
Current status:
draft, scheduled, published, archivedboolean
Whether push notifications are enabled
boolean
Whether the announcement is public
string
ISO timestamp when the announcement is scheduled to be published
string
ISO timestamp when the announcement expires
string
Topic category (e.g., PROMOTIONS, SYSTEM, MAINTENANCE)
string
Push notification status:
pending, success, failedstring
ISO timestamp when push notification was sent
string
Type of attachment:
image, link, buttonstring
URL of the attachment
integer
ID of the user who created the announcement
string
ISO timestamp when the announcement was created
string
ISO timestamp when the announcement was last updated
integer
Current page number
integer
Total number of pages
integer
Number of items per page
integer
Total number of announcements
curl -X GET "https://api.example.com/api/v2/admin/announcements?page=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements?page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"data": {
"data": [
{
"id": 1,
"tenant_id": "tenant-123",
"title": "System Maintenance Scheduled",
"summary": "We will be performing scheduled maintenance on our servers.",
"content": "Our servers will be undergoing scheduled maintenance on Sunday, December 15th from 2:00 AM to 4:00 AM EST. During this time, you may experience brief service interruptions.",
"type": "warning",
"priority": 1,
"status": "published",
"is_push_enabled": true,
"is_public": false,
"scheduled_at": null,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"push_status": "success",
"sent_at": "2024-12-11T10:00:00Z",
"attachment_type": null,
"attachment_url": null,
"created_by": 1,
"creator": {
"id": 1,
"name": "Admin User",
"email": "admin@example.com"
},
"created_at": "2024-12-11T09:30:00Z",
"updated_at": "2024-12-11T10:00:00Z"
}
],
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 1
}
}
⌘I