Create Announcement
Create a new announcement.
Endpoint
INFO
POST /api/v1/dashboard/announcements
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Announcement title |
message | string | Yes | Announcement content |
type | string | Yes | Type: info, warning, promo |
target | string | No | Target: all, new_users, active_users |
starts_at | string | No | Start datetime |
ends_at | string | No | End datetime |
status | string | No | Status: draft, published |
Example Request
bash
curl -X POST https://api.daakey.com/api/v1/dashboard/announcements \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"title": "Weekend Special",
"message": "Get 20% off on all bookings this weekend!",
"type": "promo",
"target": "all",
"starts_at": "2024-01-20T00:00:00Z",
"ends_at": "2024-01-21T23:59:59Z",
"status": "published"
}'Response
Success (201)
json
{
"success": true,
"message": "Announcement created",
"data": {
"id": 2,
"title": "Weekend Special",
"message": "Get 20% off on all bookings this weekend!",
"type": "promo",
"target": "all",
"status": "published",
"starts_at": "2024-01-20T00:00:00Z",
"ends_at": "2024-01-21T23:59:59Z",
"created_at": "2024-01-18T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}