Messages
In-app messages and announcements; admins publish announcements and tenants read and mark them as read.
messagesMessagesAuthentication: User8 endpointsList messages
GET
/api/v2/messagesAuthentication: User (some parameters admin only)
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | integer | — | Page number, starting from 1 |
| page_size | integer | — | Items per page |
| sort | string | — | Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id` |
| tenant_id | integer | — | Admin only: filter by tenant. Ignored for tenant credentials, which only see their own tenant's data |
| type | string | — | Message type, such as announcement or cert-expire. |
| site_id | integer | — | Site ID |
Publish announcement
POST
/api/v2/messagesAuthentication: Admin only
Request body application/json
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | — | Message body. |
| is_bold | boolean | — | Whether to show the title in bold. |
| is_external | boolean | — | When true, clicking jumps to url and url is required; otherwise content is required. |
| is_popup | boolean | — | Whether to show it as a pop-up. |
| is_red | boolean | — | Whether to show the title in red. |
| is_show | boolean | — | Whether the message is visible. |
| sort | integer | — | Display order (smaller first). |
| title | string | Required | Message title. |
| url | string | — | Link opened on click when is_external is true. |
Mark messages as read
POST
/api/v2/messages/readAuthentication: User
Request body application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ids | integer[] | — | Empty means all messages sent to you. |
Recent unread messages
GET
/api/v2/messages/recentAuthentication: User
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| days | integer | — | Only messages from the last this many days. |
| limit | integer | — | Maximum number of messages to return. |
Unread message count
GET
/api/v2/messages/unread-countAuthentication: User
Get message
GET
/api/v2/messages/{id}Authentication: User (some parameters admin only)
Update message
PUT
/api/v2/messages/{id}Authentication: Admin only
Request body application/json
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | — | Message body. |
| is_bold | boolean | — | Whether to show the title in bold. |
| is_external | boolean | — | When true, clicking jumps to url and url is required; otherwise content is required. |
| is_popup | boolean | — | Whether to show it as a pop-up. |
| is_red | boolean | — | Whether to show the title in red. |
| is_show | boolean | — | Whether the message is visible. |
| sort | integer | — | Display order (smaller first). |
| title | string | — | Message title. |
| url | string | — | Link opened on click when is_external is true. |
Delete message
DELETE
/api/v2/messages/{id}Authentication: Admin only
Messages object
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | — | Message body. |
| count | integer | — | Number of unread messages. |
| created_at | string | — | Created at |
| id | integer | — | Record ID |
| ids | integer[] | — | Empty means all messages sent to you. |
| is_bold | boolean | — | Whether to show the title in bold. |
| is_external | boolean | — | When true, clicking jumps to url and url is required; otherwise content is required. |
| is_popup | boolean | — | Whether to show it as a pop-up. |
| is_red | boolean | — | Whether to show the title in red. |
| is_show | boolean | — | Whether the message is visible. |
| items | Message[] | — | Items on this page |
| read | boolean | — | Whether the message has been read. |
| site_id | integer | — | Site ID |
| sort | integer | — | Display order (smaller first). |
| tenant_id | integer | — | Recipient tenant; empty for announcements. |
| title | string | — | Message title. |
| title_args | object | — | Arguments of the title key: name → string, number, or a clause {key, args} (a clause is looked up in the dictionary and filled the same way, and may nest). |
| title_key | string | — | Title key (the Chinese sentence with {name} placeholders). When set, the panel looks it up in the UI-language dictionary and fills the placeholders from title_args; when null (old messages, announcements, edited titles) the panel shows title as is. |
| type | string | — | announcement = announcement; others are notification types (such as cert-expire, package-expire). |
| updated_at | string | — | Updated at |
| url | string | — | Link opened on click when is_external is true. |