Notification API
Source: daemon/proto/hostcraft/v1/notification.proto
NotificationService
Section titled “NotificationService”NotificationService is the in-panel notification centre and the admin alert channels. REST: /api/v1/notifications.
| Method | REST route | Permission | Streaming |
|---|---|---|---|
ListNotifications |
GET /api/v1/notifications |
NotificationRead |
unary |
MarkNotificationRead |
POST /api/v1/notifications/read |
NotificationUpdate |
unary |
GetNotificationSettings |
GET /api/v1/notifications/settings |
SystemAdmin |
unary |
UpdateNotificationSettings |
PATCH /api/v1/notifications/settings |
SystemAdmin |
unary |
SendTestNotification |
POST /api/v1/notifications/test |
SystemAdmin |
unary |
GetSMTPSettings |
GET /api/v1/notifications/smtp |
SystemAdmin |
unary |
UpdateSMTPSettings |
PUT /api/v1/notifications/smtp |
SystemAdmin |
unary |
ClearSMTPSettings |
DELETE /api/v1/notifications/smtp |
SystemAdmin |
unary |
SendTestEmail |
POST /api/v1/notifications/smtp/test |
SystemAdmin |
unary |
ListNotifications
Section titled “ListNotifications”/hostcraft.v1.NotificationService/ListNotifications
- Request: ListNotificationsRequest
- Response: ListNotificationsResponse
MarkNotificationRead
Section titled “MarkNotificationRead”MarkNotificationRead marks one notification read, or all of them when id is empty.
/hostcraft.v1.NotificationService/MarkNotificationRead
- Request: MarkNotificationReadRequest
- Response: Empty
GetNotificationSettings
Section titled “GetNotificationSettings”/hostcraft.v1.NotificationService/GetNotificationSettings
- Request: GetNotificationSettingsRequest
- Response: NotificationSettings
UpdateNotificationSettings
Section titled “UpdateNotificationSettings”/hostcraft.v1.NotificationService/UpdateNotificationSettings
- Request: UpdateNotificationSettingsRequest
- Response: NotificationSettings
SendTestNotification
Section titled “SendTestNotification”/hostcraft.v1.NotificationService/SendTestNotification
- Request: SendTestNotificationRequest
- Response: Empty
GetSMTPSettings
Section titled “GetSMTPSettings”Outbound email transport: the panel saved SMTP relay overrides the notify.smtp_* values in config.yaml; with neither, mail goes through the local postfix sendmail. The password is never returned.
/hostcraft.v1.NotificationService/GetSMTPSettings
- Request: GetSMTPSettingsRequest
- Response: SMTPStatus
UpdateSMTPSettings
Section titled “UpdateSMTPSettings”/hostcraft.v1.NotificationService/UpdateSMTPSettings
- Request: SMTPUpdate
- Response: SMTPStatus
ClearSMTPSettings
Section titled “ClearSMTPSettings”/hostcraft.v1.NotificationService/ClearSMTPSettings
- Request: ClearSMTPSettingsRequest
- Response: SMTPStatus
SendTestEmail
Section titled “SendTestEmail”Sends a test email synchronously, through the active transport or an unsaved draft relay, and returns the delivery error.
/hostcraft.v1.NotificationService/SendTestEmail
- Request: SendTestEmailRequest
- Response: Empty
Messages
Section titled “Messages”ClearSMTPSettingsRequest
Section titled “ClearSMTPSettingsRequest”No fields.
Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.
No fields.
GetNotificationSettingsRequest
Section titled “GetNotificationSettingsRequest”No fields.
GetSMTPSettingsRequest
Section titled “GetSMTPSettingsRequest”No fields.
ListNotificationsRequest
Section titled “ListNotificationsRequest”| Field | Type | Number | Description |
|---|---|---|---|
limit |
int64 |
1 | - |
unread |
bool |
2 | - |
ListNotificationsResponse
Section titled “ListNotificationsResponse”| Field | Type | Number | Description |
|---|---|---|---|
notifications |
repeated Notification |
1 | - |
unread |
int64 |
2 | - |
MarkNotificationReadRequest
Section titled “MarkNotificationReadRequest”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
Notification
Section titled “Notification”| Field | Type | Number | Description |
|---|---|---|---|
id |
string |
1 | - |
account_id |
string |
2 | - |
severity |
string |
3 | - |
category |
string |
4 | - |
subject |
string |
5 | - |
body |
string |
6 | - |
link |
string |
7 | - |
created_at |
google.protobuf.Timestamp |
8 | - |
read |
bool |
9 | - |
NotificationSettings
Section titled “NotificationSettings”| Field | Type | Number | Description |
|---|---|---|---|
alert_email |
string |
1 | - |
email_account_owners |
bool |
2 | - |
webhook_url |
string |
3 | - |
webhook_secret |
string |
4 | - |
smtp_configured |
bool |
5 | - |
SMTPStatus
Section titled “SMTPStatus”SMTPStatus describes the active outbound email transport. source is panel, config, sendmail or none.
| Field | Type | Number | Description |
|---|---|---|---|
source |
string |
1 | - |
host |
string |
2 | - |
port |
int64 |
3 | - |
username |
string |
4 | - |
from |
string |
5 | - |
use_tls |
bool |
6 | - |
password_set |
bool |
7 | - |
sendmail_available |
bool |
8 | - |
config_smtp |
bool |
9 | - |
SMTPUpdate
Section titled “SMTPUpdate”SMTPUpdate is a relay to save or test. An empty password with keep_password reuses the stored one for the same host.
| Field | Type | Number | Description |
|---|---|---|---|
host |
string |
1 | - |
port |
int64 |
2 | - |
username |
string |
3 | - |
password |
string |
4 | - |
from |
string |
5 | - |
use_tls |
bool |
6 | - |
keep_password |
bool |
7 | - |
SendTestEmailRequest
Section titled “SendTestEmailRequest”| Field | Type | Number | Description |
|---|---|---|---|
to |
string |
1 | - |
draft |
SMTPUpdate |
2 | - |
SendTestNotificationRequest
Section titled “SendTestNotificationRequest”No fields.
UpdateNotificationSettingsRequest
Section titled “UpdateNotificationSettingsRequest”| Field | Type | Number | Description |
|---|---|---|---|
alert_email |
optional string |
1 | - |
email_account_owners |
optional bool |
2 | - |
webhook_url |
optional string |
3 | - |
rotate_webhook_secret |
bool |
4 | - |