Skip to main content
POST
/
api
/
v2
/
admin
/
announcements
curl -X POST "https://api.example.com/api/v2/admin/announcements" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Tenant-ID: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "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_push_enabled": true,
    "is_public": false,
    "topic": "FEATURES",
    "push_title": "New Features Available!",
    "push_body": "Discover the latest improvements to your dashboard",
    "target_type": "all"
  }'
{
  "success": true,
  "message": "Announcement created successfully",
  "data": {
    "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_push_enabled": true,
    "is_public": false,
    "scheduled_at": null,
    "expires_at": null,
    "topic": "FEATURES",
    "push_title": "New Features Available!",
    "push_body": "Discover the latest improvements to your dashboard",
    "push_data": null,
    "target_type": "all",
    "target_value": null,
    "push_status": "pending",
    "push_error": null,
    "sent_at": null,
    "attachment_type": null,
    "attachment_url": null,
    "attachment_metadata": null,
    "created_by": 1,
    "creator": {
      "id": 1,
      "name": "Admin User",
      "email": "[email protected]"
    },
    "created_at": "2024-12-11T14:30:00Z",
    "updated_at": "2024-12-11T14:30:00Z"
  }
}

Headers

Authorization
string
required
Bearer token for authentication
X-Tenant-ID
string
required
The tenant ID to create the announcement for
Content-Type
string
required
Must be application/json

Body Parameters

title
string
required
The announcement title (max 255 characters)
summary
string
Brief summary of the announcement (max 500 characters)
content
string
Detailed content of the announcement
type
string
required
Type of announcement. Must be one of: info, warning, success, alert
priority
integer
default:"0"
Priority level. 0 for normal, 1 for high priority
status
string
required
Current status. Must be one of: draft, scheduled, published, archived
is_push_enabled
boolean
default:"false"
Whether to enable push notifications for this announcement
is_public
boolean
default:"false"
Whether the announcement is public
scheduled_at
string
ISO timestamp when the announcement should be published (required if status is scheduled)
expires_at
string
ISO timestamp when the announcement expires
topic
string
Topic category (e.g., PROMOTIONS, SYSTEM, MAINTENANCE) - max 100 characters

Push Notification Parameters

push_title
string
Custom push notification title (max 100 characters)
push_body
string
Custom push notification message (max 200 characters)
push_data
object
Additional data to include in push notification payload
target_type
string
default:"all"
Push notification target type. Must be one of: topic, all, users
target_value
string
Target value based on target_type:
  • For topic: topic name
  • For users: comma-separated user IDs
  • For all: leave empty

Attachment Parameters

attachment_type
string
Type of attachment. Must be one of: image, link, button
attachment_url
string
URL of the attachment (must be valid URL if attachment_type is provided)
attachment_metadata
object
Additional metadata for the attachment

Response

success
boolean
Indicates if the request was successful
message
string
Success message
data
object
The created announcement object (same structure as in list response)
curl -X POST "https://api.example.com/api/v2/admin/announcements" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Tenant-ID: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "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_push_enabled": true,
    "is_public": false,
    "topic": "FEATURES",
    "push_title": "New Features Available!",
    "push_body": "Discover the latest improvements to your dashboard",
    "target_type": "all"
  }'
{
  "success": true,
  "message": "Announcement created successfully",
  "data": {
    "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_push_enabled": true,
    "is_public": false,
    "scheduled_at": null,
    "expires_at": null,
    "topic": "FEATURES",
    "push_title": "New Features Available!",
    "push_body": "Discover the latest improvements to your dashboard",
    "push_data": null,
    "target_type": "all",
    "target_value": null,
    "push_status": "pending",
    "push_error": null,
    "sent_at": null,
    "attachment_type": null,
    "attachment_url": null,
    "attachment_metadata": null,
    "created_by": 1,
    "creator": {
      "id": 1,
      "name": "Admin User",
      "email": "[email protected]"
    },
    "created_at": "2024-12-11T14:30:00Z",
    "updated_at": "2024-12-11T14:30:00Z"
  }
}