Mark one of your bell messages read or archived
Code Mode: praxis.organization.notifications.messages.update
HTTP: POST /organization/v1/notifications/messages/{name}
Change the read or archived flag of one of the calling person’s own bell messages and return it. Name at least one flag. Reading a message also tells the notification still waiting on it, so it is not emailed later as unread. A message that is not theirs answers 404 like one that does not exist. No usage charge.
签名
praxis.organization.notifications.messages.update(args:{path:{/** e.g. "subscribers/usr_8a21c4/messages/msg_3f9a1c7e" */ name:string};body:{/** Mark the message read (true) or unread (false); omit to leave it. e.g. true */ read?:boolean;/** Archive the message (true) or move it back to the inbox (false); omit to leave it. e.g. true */ archived?:boolean}}):Promise<{/** The message's resource name, subscribers/{user}/messages/{id}; pass it URL-encoded as the {name} of the other message operations. e.g. "subscribers/usr_8a21c4/messages/msg_3f9a1c7e" */ name:string;/** The organization the message belongs to; empty for a message that belongs to no organization. */ organizationId:string;/** The notification group the message belongs to: members, usage, alerts, agent, or nonConfigurable. e.g. "agent" */ group:"members"|"usage"|"alerts"|"agent"|"nonConfigurable";/** The notification workflow that wrote it, as the preferences page names it. */ workflow:string;/** The message's headline, as the bell shows it. */ title:string;/** The message text. */ body:string;/** Where the bell opens this message; absent when it has no page. */ actionUrl?:string;/** Whether the bell has been opened since the message arrived. */ seen:boolean;/** Whether this person has read it. */ read:boolean;/** Whether this person archived it; archived messages are not in the inbox tab. */ archived:boolean;/** When the message arrived. */ createTime:string}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| name | path | string | 是 | The message’s `name` from the messages list, subscribers/{user}/messages/{id}, URL-encoded. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The message after the change. |
| 400 | The body is not a JSON object, names neither `read` nor `archived`, a flag is not true or false, or `name` is malformed (RFC 9457 problem). | |
| 401 | Missing or invalid credential (RFC 9457 problem). | |
| 403 | `PERMISSION_DENIED`: an agent credential has no person inbox; read its own letters instead (RFC 9457 problem). | |
| 404 | No such message of yours in this organization — `MESSAGE_NOT_FOUND` (RFC 9457 problem). | |
| 502 | The notification service did not answer, or failed in a way it did not classify (RFC 9457 problem, `UNAVAILABLE`). A refusal the service classifies is never a 502 — it reaches the caller in its own class (400, 403, 404), so a client may act on it. |