curl -X GET "https://api.example.com/api/v2/admin/announcements/active" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements/active', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"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_public": false,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"attachment_type": null,
"attachment_url": null,
"attachment_metadata": null,
"created_at": "2024-12-11T09:30:00Z",
"is_read": false,
"is_dismissed": false
},
{
"id": 2,
"tenant_id": "tenant-123",
"title": "New Feature Release",
"summary": "We have released exciting new features!",
"content": "Check out our new dashboard improvements and enhanced reporting capabilities.",
"type": "success",
"priority": 0,
"status": "published",
"is_public": false,
"expires_at": null,
"topic": "FEATURES",
"attachment_type": "link",
"attachment_url": "https://example.com/features",
"attachment_metadata": {
"button_text": "Learn More"
},
"created_at": "2024-12-11T14:30:00Z",
"is_read": true,
"is_dismissed": false
}
]
}
Announcements
Get Active Announcements
Retrieve all active (published and not expired) announcements for the current tenant with read status
GET
/
api
/
v2
/
admin
/
announcements
/
active
curl -X GET "https://api.example.com/api/v2/admin/announcements/active" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements/active', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"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_public": false,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"attachment_type": null,
"attachment_url": null,
"attachment_metadata": null,
"created_at": "2024-12-11T09:30:00Z",
"is_read": false,
"is_dismissed": false
},
{
"id": 2,
"tenant_id": "tenant-123",
"title": "New Feature Release",
"summary": "We have released exciting new features!",
"content": "Check out our new dashboard improvements and enhanced reporting capabilities.",
"type": "success",
"priority": 0,
"status": "published",
"is_public": false,
"expires_at": null,
"topic": "FEATURES",
"attachment_type": "link",
"attachment_url": "https://example.com/features",
"attachment_metadata": {
"button_text": "Learn More"
},
"created_at": "2024-12-11T14:30:00Z",
"is_read": true,
"is_dismissed": false
}
]
}
Headers
string
required
Bearer token for authentication
string
required
The tenant ID to scope the announcements
Response
boolean
Indicates if the request was successful
array
Array of active announcement objects with read status
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 (will always be
published for active announcements)boolean
Whether the announcement is public
string
ISO timestamp when the announcement expires
string
Topic category (e.g., PROMOTIONS, SYSTEM, MAINTENANCE)
string
Type of attachment:
image, link, buttonstring
URL of the attachment
object
Additional metadata for the attachment
string
ISO timestamp when the announcement was created
boolean
Whether the current user has read this announcement
boolean
Whether the current user has dismissed this announcement
curl -X GET "https://api.example.com/api/v2/admin/announcements/active" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-ID: your-tenant-id"
const response = await fetch('/api/v2/admin/announcements/active', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Tenant-ID': 'your-tenant-id'
}
});
const data = await response.json();
{
"success": true,
"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_public": false,
"expires_at": "2024-12-16T00:00:00Z",
"topic": "SYSTEM",
"attachment_type": null,
"attachment_url": null,
"attachment_metadata": null,
"created_at": "2024-12-11T09:30:00Z",
"is_read": false,
"is_dismissed": false
},
{
"id": 2,
"tenant_id": "tenant-123",
"title": "New Feature Release",
"summary": "We have released exciting new features!",
"content": "Check out our new dashboard improvements and enhanced reporting capabilities.",
"type": "success",
"priority": 0,
"status": "published",
"is_public": false,
"expires_at": null,
"topic": "FEATURES",
"attachment_type": "link",
"attachment_url": "https://example.com/features",
"attachment_metadata": {
"button_text": "Learn More"
},
"created_at": "2024-12-11T14:30:00Z",
"is_read": true,
"is_dismissed": false
}
]
}
Notes
- Only returns announcements that are:
- Status is
published - Not scheduled in the future (scheduled_at is null or in the past)
- Not expired (expires_at is null or in the future)
- Status is
- Results are ordered by priority (high first) then by creation date (newest first)
- The
is_readandis_dismissedfields are specific to the authenticated user - Dismissed announcements are excluded from the results
⌘I