Update Announcement
Update an existing announcement.
Endpoint
INFO
PUT /api/v1/dashboard/announcements/{announcement}
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
announcement | integer | Announcement ID |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Announcement title |
message | string | No | Announcement content |
type | string | No | Type: info, warning, promo |
status | string | No | Status: draft, published, archived |
ends_at | string | No | End datetime |
Example Request
bash
curl -X PUT https://api.daakey.com/api/v1/dashboard/announcements/1 \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"ends_at": "2024-02-15T23:59:59Z"
}'Response
Success (200)
json
{
"success": true,
"message": "Announcement updated",
"data": {
"id": 1,
"title": "New Electric Vehicle Fleet",
"ends_at": "2024-02-15T23:59:59Z",
"updated_at": "2024-01-15T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}