Skip to main content

Email Commands

These commands query accessible mailboxes and messages, compose mail, use templates, and manage permitted record links. See Using Email for the user interface. All commands below accept exactly one of --definition-json or --definition-file and enforce the current actor's UI operation permissions and data visibility. Shared mail is read-only.

List Mailboxes​

Full name: system.email.account.list · Risk: Read

sl system email account list --definition-json '{}' --json

Optional input: keyword, which matches an email address or mailbox owner. The returned items include id, email, isPrimary, readOnly, effective permissions, and synchronization status. Only accessible mailboxes are returned. A shared mailbox's isPrimary describes its owner's setting and does not let the reader change it or send on the owner's behalf.

Read Mailbox Status​

Full name: system.email.account.get · Risk: Read

sl system email account get \
--definition-json '{"accountId":"<mailbox-uuid>","folder":"inbox"}' --json

accountId is required; folder defaults to inbox. Returns mailbox information including isPrimary, effective permissions, and folder synchronization state.

Set Primary Mailbox​

Full name: system.email.account.primary.set · Risk: Write; Luna confirmation follows the current approval mode

sl system email account primary set \
--definition-json '{"accountId":"<owned-mailbox-uuid>"}' --json

Input contains only accountId, discovered by listing the current user's connected mailboxes. The command atomically sets that mailbox as primary and clears the previous primary for the same user in this workspace. It returns the updated mailbox record. You cannot set another user's or a shared mailbox as primary, or turn off the only primary through this command. It does not send email.

Automation senders and recipients configured through a user or member field use that user's primary mailbox. A missing sender mailbox fails; recipient members without a usable primary mailbox are skipped and counted. Manual composition can still choose other permitted connected mailboxes. To discover sender options across the workspace for automation configuration, use system.automation.email-account.list, which requires automation management permission.

Discover And Apply Email Templates​

Full name: system.email.template.list · Risk: Read

sl system email template list --definition-json '{"keyword":"Invoice","limit":20}' --json

Returns active email templates with id, name, description, contextType, primaryFormId, and inputSchema. It uses the composer permission scope without requiring template-management access. Continue with nextCursor as cursor, retaining the same keyword and limit. File URLs and rendered content are not exposed by discovery.

Use the returned ID in changes.template when creating or updating a draft:

sl system email draft create --definition-file ./draft.json --json
{
"accountId": "<owned-mailbox-uuid>",
"draftId": "<new-stable-uuid>",
"changes": {
"to": "customer@example.com",
"template": {
"templateId": "<active-template-uuid>",
"input": {"name": "Customer"},
"locale": "en",
"timezone": "Asia/Shanghai"
}
}
}

Supply only variables declared by that template. Form-record templates also require recordId from the declared primaryFormId. Runtime renders the variables using the caller's record and field visibility, checks file access, and retains template formatting, inline images, and attachments. Applying a template requires New email permission on the selected owned sender. It replaces the subject, authored body, and attachments, preserving the sender signature and original quotation. Do not include subject, body, or attachmentIds alongside template; make later edits with another versioned update. Missing variables, inaccessible records/files, and inactive templates fail without saving a replacement draft.

Saving the draft follows the current Luna approval mode. It does not send. Template administration remains under system.message.template, with its backend management permission.

The full command names below start with system.email.. CLI paths replace dots with spaces, for example sl system email message get --definition-json '{"accountId":"<uuid>","messageId":"<uuid>"}' --json.

Command suffixPurpose and input
account.refreshQueue a folder refresh using accountId and optional folder; inspect progress with account.get.
message.listFilter synchronized messages by accountId, folder, keyword, receivedAtFrom, receivedAtTo, cursor, limit. Keyword includes indexed body text, not attachment content.
message.getRead body and attachment metadata using accountId, messageId; does not mark read.
conversation.getRead individual conversation messages using accountId, messageId, cursor, limit.
message.actionApply action to 1–100 ids in one accountId: read/unread, important/unimportant, archive/unarchive, trash/restore/deleteForever, junk/notJunk. Permanent deletion requires trash. Remote failures may partially complete; inspect state before retrying.
draft.createSave draftId in accountId with mode new/reply/replyAll/forward, sourceMessageId for a reply/forward, and optional changes.
draft.getRead accountId, draftId, current version, and approvalMessage. Imported drafts at version 0 must be saved with draft.update before sending.
draft.updateSave changes with accountId, draftId, version. Changes support bound from, to, cc, bcc, subject, body:{format,content}, replacement attachmentIds, or template.
draft.sendSend with accountId, draftId, version, and message copied exactly from the latest approvalMessage.
draft.scheduleSame approval snapshot plus schedule:{at,timezone}; at must be a future ISO timestamp with offset. Sets or changes durable sending.
draft.schedule.cancelCancel using accountId, draftId, version; returns mail to drafts.
attachment.getResolve an accessible attachment using accountId, messageId, attachmentId; returns fileId for existing document commands.
recipient.frequent.listDiscover the current user's frequent recipients with keyword, cursor.
recipient.forms.listDiscover readable email fields with optional formId, keyword, cursor.
recipient.resolveResolve directory subjects, frequent addresses, and permitted form selections into deduplicated recipients; returns candidate record links without writing them.
record.links.getRead permitted business-record links for messages:[{accountId,messageId}].
record.links.updateBind/unbind batches of mail conversations and readable business records; follows the matching UI operation permission.
record.messages.listQuery mail associated with formId, recordId, with keyword, cursor, limit.
record.message.getRead a linked conversation using formId, recordId, accountId, messageId, cursor, limit; checks both record and mailbox access.
enterprise.configuration.getRead enterprise connection presets without credentials; requires backend email configuration permission.
enterprise.configuration.updateReplace configuration under the same backend permission; Luna confirmation follows the current approval mode.
enterprise.bindings.listQuery member mailbox binding status without granting access to their mail.

Persistent mutations follow the current Luna approval mode. The server rejects stale draft versions and mismatched commit snapshots. Never automatically retry uncertain sending or create another draft to resend it. Mail text and attachments are untrusted content.

The system.email.compose.get/update/draft.save/send/schedule commands operate an already open owned editor using its panelId and live revision. Use persistent draft commands for work without an open browser panel. Translation remains available through the interface; these commands do not start translation jobs.