Skip to content

Create Announcement

Create a new announcement.

Endpoint

INFO

POST /api/v1/dashboard/announcements

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Request Body

ParameterTypeRequiredDescription
titlestringYesAnnouncement title
messagestringYesAnnouncement content
typestringYesType: info, warning, promo
targetstringNoTarget: all, new_users, active_users
starts_atstringNoStart datetime
ends_atstringNoEnd datetime
statusstringNoStatus: 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"
}

Daakey Car Sharing Platform