Feature Request: REST API to Mark Mail Messages as Read/Unread
Description
The Mail app REST API currently supports reading messages and their metadata, but does not expose an endpoint to change the \Seen flag (mark as read/unread) via REST. Users must either:
- Use the web UI (click the envelope icon or swipe in the app)
- Use IMAP
STORE \Seen directly (requires IMAP access to the mail server)
For integrations, automation pipelines, and MCP servers that operate via REST API, the absence of a read/unread mutation endpoint is a significant gap.
Proposed API
Add a new endpoint (or extend an existing one) following Nextcloud's API conventions:
POST /apps/mail/api/v{version}/folders/{folderId}/messages/{messageId}/flags
Body:
{
"flags": ["\\Seen"] // mark as read
// or
"flags": [] // mark as unread
}
Alternatively, a PATCH on the message resource:
PATCH /apps/mail/api/v{version}/folders/{folderId}/messages/{messageId}
Body:
{
"flagSeen": true
}
Response
200 OK — flag updated successfully
404 — message not found
403 — insufficient permissions
Rationale
- Enables MCP servers and third-party integrations to properly manage email state after processing
- Consistent with existing
POST-based mutations in the Mail API (e.g., creating messages, moving to folders)
- Parity with IMAP
STORE command — the underlying implementation would do exactly this
- The
nc_mail_mark_as_read tool in cbcoutinho/nextcloud-mcp-server depends on this endpoint
Impact
- MCP ecosystem: Enables proper email processing workflows where messages are automatically marked as read after being handled
- Automation: Allows pipelines to clean up after processing emails without requiring IMAP access
- Consistency: The Mail app already tracks read state internally; the REST API just needs to expose mutation
Priority
Medium-High — blocks full email automation for API-driven clients (MCP, n8n, custom integrations).
Feature Request: REST API to Mark Mail Messages as Read/Unread
Description
The Mail app REST API currently supports reading messages and their metadata, but does not expose an endpoint to change the
\Seenflag (mark as read/unread) via REST. Users must either:STORE \Seendirectly (requires IMAP access to the mail server)For integrations, automation pipelines, and MCP servers that operate via REST API, the absence of a read/unread mutation endpoint is a significant gap.
Proposed API
Add a new endpoint (or extend an existing one) following Nextcloud's API conventions:
Alternatively, a
PATCHon the message resource:Response
200 OK— flag updated successfully404— message not found403— insufficient permissionsRationale
POST-based mutations in the Mail API (e.g., creating messages, moving to folders)STOREcommand — the underlying implementation would do exactly thisnc_mail_mark_as_readtool incbcoutinho/nextcloud-mcp-serverdepends on this endpointImpact
Priority
Medium-High — blocks full email automation for API-driven clients (MCP, n8n, custom integrations).