Version 2.1.1792967583 · latest Download OpenAPI Markdown

Messages

In-app messages and announcements; admins publish announcements and tenants read and mark them as read.

messagesMessagesAuthentication: User8 endpoints

List messages

GET/api/v2/messages
Authentication: User (some parameters admin only)

Query parameters

FieldTypeRequiredDescription
pageinteger— Page number, starting from 1
Default 1
page_sizeinteger— Items per page
Default 20
sortstring— Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id`
tenant_idinteger— Admin only: filter by tenant. Ignored for tenant credentials, which only see their own tenant's data
typestring— Message type, such as announcement or cert-expire.
site_idinteger— Site ID

Publish announcement

POST/api/v2/messages
Authentication: Admin only

Request body application/json

FieldTypeRequiredDescription
contentstring— Message body.
is_boldboolean— Whether to show the title in bold.
is_externalboolean— When true, clicking jumps to url and url is required; otherwise content is required.
is_popupboolean— Whether to show it as a pop-up.
is_redboolean— Whether to show the title in red.
is_showboolean— Whether the message is visible.
sortinteger— Display order (smaller first).
titlestringRequired Message title.
urlstring— Link opened on click when is_external is true.

Mark messages as read

POST/api/v2/messages/read
Authentication: User

Request body application/json

FieldTypeRequiredDescription
idsinteger[]— Empty means all messages sent to you.

Recent unread messages

GET/api/v2/messages/recent
Authentication: User

Query parameters

FieldTypeRequiredDescription
daysinteger— Only messages from the last this many days.
Default 30
limitinteger— Maximum number of messages to return.
Default 8

Unread message count

GET/api/v2/messages/unread-count
Authentication: 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

FieldTypeRequiredDescription
contentstring— Message body.
is_boldboolean— Whether to show the title in bold.
is_externalboolean— When true, clicking jumps to url and url is required; otherwise content is required.
is_popupboolean— Whether to show it as a pop-up.
is_redboolean— Whether to show the title in red.
is_showboolean— Whether the message is visible.
sortinteger— Display order (smaller first).
titlestring— Message title.
urlstring— Link opened on click when is_external is true.

Delete message

DELETE/api/v2/messages/{id}
Authentication: Admin only

Messages object

FieldTypeRequiredDescription
contentstring— Message body.
countinteger— Number of unread messages.
created_atstring— Created at
read-only
idinteger— Record ID
read-only
idsinteger[]— Empty means all messages sent to you.
is_boldboolean— Whether to show the title in bold.
is_externalboolean— When true, clicking jumps to url and url is required; otherwise content is required.
is_popupboolean— Whether to show it as a pop-up.
is_redboolean— Whether to show the title in red.
is_showboolean— Whether the message is visible.
itemsMessage[]— Items on this page
readboolean— Whether the message has been read.
read-only
site_idinteger— Site ID
read-only
sortinteger— Display order (smaller first).
tenant_idinteger— Recipient tenant; empty for announcements.
read-only
titlestring— Message title.
title_argsobject— 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).
read-only
title_keystring— 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.
read-only
typestring— announcement = announcement; others are notification types (such as cert-expire, package-expire).
read-only
updated_atstring— Updated at
read-only
urlstring— Link opened on click when is_external is true.