Download OpenAPI specification:
A self-hosted IMAP/SMTP middleware designed for developers
RustMailer is a self-hosted IMAP/SMTP middleware platform designed for developers and businesses seeking a robust, scalable, and secure email solution.
- Provides seamless IMAP synchronization and reliable SMTP sending via blazing-fast REST and gRPC APIs.
- Supports programmable email workflows, customizable filters, and webhook notifications.
- Offers multi-account synchronization, license-based access control, and a built-in web UI for easy management.
Whether you're building SaaS platforms, CRM systems, or customer support tools, RustMailer delivers high performance and full control over your email infrastructure.
[- {
- "token": "string",
- "accounts": [
- {
- "id": 0,
- "email": "string"
}
], - "created_at": 0,
- "updated_at": 0,
- "description": "string",
- "access_scopes": [
- "Api"
], - "last_access_at": 0,
- "acl": {
- "ip_whitelist": [
- "string"
], - "rate_limit": {
- "interval": 0,
- "quota": 0
}
}
}
]Requires root privileges.
| account_id required | integer <uint64> The ID of the account whose tokens are to be retrieved. |
[- {
- "token": "string",
- "accounts": [
- {
- "id": 0,
- "email": "string"
}
], - "created_at": 0,
- "updated_at": 0,
- "description": "string",
- "access_scopes": [
- "Api"
], - "last_access_at": 0,
- "acl": {
- "ip_whitelist": [
- "string"
], - "rate_limit": {
- "interval": 0,
- "quota": 0
}
}
}
]Requires root privileges.
| token required | string The access token to be updated. |
The request payload.
| accounts | Array of integers <uint64> [ items <uint64 > ] A set of account information associated with the token. |
| description | string <= 255 characters An optional description of the token's purpose or usage. |
| access_scopes | Array of strings (AccessTokenScope) Items Enum: "Api" "Metrics" A set of scopes defining the token's access permissions. |
object (AccessControl) Optional access control settings |
{- "accounts": [
- 0
], - "description": "string",
- "access_scopes": [
- "Api"
], - "acl": {
- "ip_whitelist": [
- "string"
], - "rate_limit": {
- "interval": 0,
- "quota": 0
}
}
}{- "message": "string",
- "code": 0
}Requires root privileges.
The request payload
| accounts required | Array of integers <uint64> [ items <uint64 > ] A set of account information associated with the token. |
| description | string <= 255 characters An optional description of the token's purpose or usage. |
| access_scopes required | Array of strings (AccessTokenScope) Items Enum: "Api" "Metrics" A set of scopes defining the token's access permissions. |
object (AccessControl) Optional access control settings |
{- "accounts": [
- 0
], - "description": "string",
- "access_scopes": [
- "Api"
], - "acl": {
- "ip_whitelist": [
- "string"
], - "rate_limit": {
- "interval": 0,
- "quota": 0
}
}
}{- "message": "string",
- "code": 0
}Only callable by an already authenticated Root user.
This endpoint updates the Root password to password_str
and regenerates the root_token, invalidating any previous token.
{- "message": "string",
- "code": 0
}{- "id": 0,
- "imap": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "smtp": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "enabled": true,
- "mailer_type": "ImapSmtp",
- "email": "string",
- "name": "string",
- "minimal_sync": true,
- "capabilities": [
- "string"
], - "dsn_capable": true,
- "date_since": {
- "fixed": "string",
- "relative": {
- "unit": "Days",
- "value": 1
}
}, - "folder_limit": 0,
- "sync_folders": [
- "string"
], - "full_sync_interval_min": 0,
- "incremental_sync_interval_sec": 0,
- "known_folders": [
- "string"
], - "created_at": 0,
- "updated_at": 0,
- "use_proxy": 0
}Account update request payload
| enabled | boolean Represents the account activation status. If this value is |
| name | string Display name for the account (optional) |
object (ImapConfig) IMAP server configuration | |
object (SmtpConfig) SMTP server configuration | |
object (DateSince) Controls initial synchronization time range When dealing with large mailboxes, this restricts scanning to:
Use Cases
| |
| folder_limit | integer <uint32> >= 100 Max emails to sync for this folder.
If not set, sync all emails.
otherwise sync up to |
| sync_folders | Array of strings Configuration for selective folder (mailbox/label) synchronization
Defaults to standard folders ( |
| full_sync_interval_min | integer <int64> [ 10 .. 10080 ] Full sync interval (minutes) |
| incremental_sync_interval_sec | integer <int64> [ 10 .. 3600 ] Incremental sync interval (seconds) |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection to external APIs (e.g., Gmail, Outlook).
|
{- "enabled": true,
- "name": "string",
- "imap": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "smtp": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "date_since": {
- "fixed": "string",
- "relative": {
- "unit": "Days",
- "value": 1
}
}, - "folder_limit": 100,
- "sync_folders": [
- "string"
], - "full_sync_interval_min": 10,
- "incremental_sync_interval_sec": 10,
- "use_proxy": 0
}{- "message": "string",
- "code": 0
}Account creation request payload
| email required | string Email address associated with this account This field represents the user's email address and is required for account creation. Once set during account creation, the email address cannot be modified. |
| name | string Display name for the account (optional) |
object (ImapConfig) IMAP server configuration | |
object (SmtpConfig) SMTP server configuration | |
| enabled required | boolean Represents the account activation status. If this value is |
| mailer_type required | string Enum: "ImapSmtp" "GmailApi" Method used to access and manage emails. |
object (DateSince) Controls initial synchronization time range When dealing with large mailboxes, this restricts scanning to:
Use Cases
| |
| folder_limit | integer <uint32> >= 100 Max emails to sync for this folder.
If not set, sync all emails.
otherwise sync up to |
| minimal_sync | boolean Minimal sync mode flag When enabled (
|
| full_sync_interval_min | integer <int64> [ 10 .. 10080 ] Full sync interval (minutes), default 30m |
| incremental_sync_interval_sec required | integer <int64> [ 10 .. 3600 ] Incremental sync interval (seconds), default 60s |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection to external APIs (e.g., Gmail, Outlook).
|
{- "email": "string",
- "name": "string",
- "imap": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "smtp": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "enabled": true,
- "mailer_type": "ImapSmtp",
- "date_since": {
- "fixed": "string",
- "relative": {
- "unit": "Days",
- "value": 1
}
}, - "folder_limit": 100,
- "minimal_sync": true,
- "full_sync_interval_min": 10,
- "incremental_sync_interval_sec": 10,
- "use_proxy": 0
}{- "id": 0,
- "imap": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "smtp": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "enabled": true,
- "mailer_type": "ImapSmtp",
- "email": "string",
- "name": "string",
- "minimal_sync": true,
- "capabilities": [
- "string"
], - "dsn_capable": true,
- "date_since": {
- "fixed": "string",
- "relative": {
- "unit": "Days",
- "value": 1
}
}, - "folder_limit": 0,
- "sync_folders": [
- "string"
], - "full_sync_interval_min": 0,
- "incremental_sync_interval_sec": 0,
- "known_folders": [
- "string"
], - "created_at": 0,
- "updated_at": 0,
- "use_proxy": 0
}| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "imap": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "smtp": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl",
- "auth": {
- "auth_type": "Password",
- "password": "string"
}, - "use_proxy": 0
}, - "enabled": true,
- "mailer_type": "ImapSmtp",
- "email": "string",
- "name": "string",
- "minimal_sync": true,
- "capabilities": [
- "string"
], - "dsn_capable": true,
- "date_since": {
- "fixed": "string",
- "relative": {
- "unit": "Days",
- "value": 1
}
}, - "folder_limit": 0,
- "sync_folders": [
- "string"
], - "full_sync_interval_min": 0,
- "incremental_sync_interval_sec": 0,
- "known_folders": [
- "string"
], - "created_at": 0,
- "updated_at": 0,
- "use_proxy": 0
}
], - "total_pages": 0
}{- "account_id": 0,
- "last_full_sync_start": 0,
- "last_full_sync_end": 0,
- "last_incremental_sync_start": 0,
- "last_incremental_sync_end": 0,
- "errors": [
- {
- "error": "string",
- "at": 0
}
], - "is_initial_sync_completed": true,
- "initial_sync_folders": [
- "string"
], - "current_syncing_folder": "string",
- "current_batch_number": 0,
- "current_total_batches": 0,
- "initial_sync_start_time": 0,
- "initial_sync_end_time": 0
}This endpoint provides a lightweight list of accounts containing only essential information (id and name). It's primarily designed for UI selectors/dropdowns when creating or associating resources with accounts.
[- {
- "id": 0,
- "email": "string",
- "mailer_type": "ImapSmtp"
}
]{- "imap": {
- "host": "string",
- "port": 0,
- "encryption": "Ssl"
}, - "smtp": {
- "host": "string",
- "port": 0,
- "encryption": "Ssl"
}, - "oauth2": {
- "issuer": "string",
- "scope": [
- "string"
], - "auth_url": "string",
- "token_url": "string"
}
}{- "id": 0,
- "account_id": 0,
- "email": "string",
- "description": "string",
- "created_at": 0,
- "updated_at": 0,
- "global": 0,
- "enabled": true,
- "hook_type": "Http",
- "http": {
- "target_url": "string",
- "http_method": "Post",
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}
}, - "nats": {
- "host": "string",
- "port": 1,
- "auth_type": "None",
- "token": "string",
- "username": "string",
- "password": "string",
- "stream_name": "string",
- "namespace": "string"
}, - "vrl_script": "string",
- "call_count": 0,
- "success_count": 0,
- "failure_count": 0,
- "last_error": "string",
- "watched_events": [
- "EmailAddedToFolder"
], - "use_proxy": 0
}Request Body
| description | string Optional description providing additional context about the hook. |
| enabled | boolean Indicates whether the hook is active and processing events upon creation. |
object (HttpConfig) Optional HTTP configuration for HTTP-based hook. | |
object (NatsConfig) Optional NATS configuration for NATS-based hook. | |
| vrl_script | string Optional VRL (Vector Remap Language) script for customizing the hook payload. |
| watched_events | Array of strings (EventType) Items Enum: "EmailAddedToFolder" "EmailFlagsChanged" "EmailSentSuccess" "EmailSendingError" "UIDValidityChange" "MailboxDeletion" "MailboxCreation" "AccountFirstSyncCompleted" "EmailBounce" "EmailFeedBackReport" "EmailOpened" "EmailLinkClicked" List of event types the hook is configured to monitor. |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection.
|
{- "description": "string",
- "enabled": true,
- "http": {
- "target_url": "string",
- "http_method": "Post",
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}
}, - "nats": {
- "host": "string",
- "port": 1,
- "auth_type": "None",
- "token": "string",
- "username": "string",
- "password": "string",
- "stream_name": "string",
- "namespace": "string"
}, - "vrl_script": "string",
- "watched_events": [
- "EmailAddedToFolder"
], - "use_proxy": 0
}{- "message": "string",
- "code": 0
}Request Body
| account_id | integer <uint64> Unique identifier of the account associated with the hook. |
| description | string Optional description providing additional context about the hook. |
| enabled required | boolean Indicates whether the hook is active and processing events upon creation. |
| hook_type required | string Enum: "Http" "Nats" The type of hook (e.g., HTTP or NATS). |
object (HttpConfig) Optional HTTP configuration for HTTP-based hook. | |
object (NatsConfig) Optional NATS configuration for NATS-based hook. | |
| vrl_script | string Optional VRL (Vector Remap Language) script for customizing the hook payload. |
| watched_events required | Array of strings (EventType) Items Enum: "EmailAddedToFolder" "EmailFlagsChanged" "EmailSentSuccess" "EmailSendingError" "UIDValidityChange" "MailboxDeletion" "MailboxCreation" "AccountFirstSyncCompleted" "EmailBounce" "EmailFeedBackReport" "EmailOpened" "EmailLinkClicked" List of event types the hook is configured to monitor. |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection.
|
{- "account_id": 0,
- "description": "string",
- "enabled": true,
- "hook_type": "Http",
- "http": {
- "target_url": "string",
- "http_method": "Post",
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}
}, - "nats": {
- "host": "string",
- "port": 1,
- "auth_type": "None",
- "token": "string",
- "username": "string",
- "password": "string",
- "stream_name": "string",
- "namespace": "string"
}, - "vrl_script": "string",
- "watched_events": [
- "EmailAddedToFolder"
], - "use_proxy": 0
}{- "id": 0,
- "account_id": 0,
- "email": "string",
- "description": "string",
- "created_at": 0,
- "updated_at": 0,
- "global": 0,
- "enabled": true,
- "hook_type": "Http",
- "http": {
- "target_url": "string",
- "http_method": "Post",
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}
}, - "nats": {
- "host": "string",
- "port": 1,
- "auth_type": "None",
- "token": "string",
- "username": "string",
- "password": "string",
- "stream_name": "string",
- "namespace": "string"
}, - "vrl_script": "string",
- "call_count": 0,
- "success_count": 0,
- "failure_count": 0,
- "last_error": "string",
- "watched_events": [
- "EmailAddedToFolder"
], - "use_proxy": 0
}Requires root privileges.
| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "account_id": 0,
- "email": "string",
- "description": "string",
- "created_at": 0,
- "updated_at": 0,
- "global": 0,
- "enabled": true,
- "hook_type": "Http",
- "http": {
- "target_url": "string",
- "http_method": "Post",
- "custom_headers": {
- "property1": "string",
- "property2": "string"
}
}, - "nats": {
- "host": "string",
- "port": 1,
- "auth_type": "None",
- "token": "string",
- "username": "string",
- "password": "string",
- "stream_name": "string",
- "namespace": "string"
}, - "vrl_script": "string",
- "call_count": 0,
- "success_count": 0,
- "failure_count": 0,
- "last_error": "string",
- "watched_events": [
- "EmailAddedToFolder"
], - "use_proxy": 0
}
], - "total_pages": 0
}JSON body containing the script and input context.
| program required | string The VRL script program to be tested. |
| event | string Optional event data to be used as input for testing the VRL script. |
{- "program": "string",
- "event": "string"
}{- "result": null,
- "error": "string"
}| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
| status | string (TaskStatus) Enum: "Scheduled" "Running" "Success" "Failed" "Removed" "Stopped" Filter by task status (optional) |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "created_at": 0,
- "status": "Scheduled",
- "stopped_reason": "string",
- "error": "string",
- "last_duration_ms": 0,
- "retry_count": 0,
- "scheduled_at": 0,
- "account_id": 0,
- "account_email": "string",
- "event": null,
- "event_type": "EmailAddedToFolder"
}
], - "total_pages": 0
}{- "id": 0,
- "created_at": 0,
- "status": "Scheduled",
- "stopped_reason": "string",
- "error": "string",
- "last_duration_ms": 0,
- "retry_count": 0,
- "scheduled_at": 0,
- "account_id": 0,
- "account_email": "string",
- "event": null,
- "event_type": "EmailAddedToFolder"
}Initiates asynchronous removal of an event hook task by marking it for deletion. The task will be:
{- "message": "string",
- "code": 0
}{- "id": "string",
- "issued_license_id": "string",
- "application_name": "string",
- "customer_name": "string",
- "created_at": 0,
- "license_type": "Trial",
- "expires_at": 0,
- "last_expires_at": 0,
- "license_content": "string",
- "max_accounts": 0
}Requires root privileges.
Raw license key string (text/plain content-type)
{- "id": "string",
- "issued_license_id": "string",
- "application_name": "string",
- "customer_name": "string",
- "created_at": 0,
- "license_type": "Trial",
- "expires_at": 0,
- "last_expires_at": 0,
- "license_content": "string",
- "max_accounts": 0
}list messages API (serving as mailbox equivalents).Both account types support two modes:
| remote | boolean If true, includes remote mailboxes from the server. |
[- {
- "id": 0,
- "account_id": 0,
- "name": "string",
- "delimiter": "string",
- "attributes": [
- {
- "attr": "NoInferiors",
- "extension": "string"
}
], - "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "exists": 0,
- "unseen": 0,
- "permanent_flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "uid_next": 0,
- "uid_validity": 0,
- "highest_modseq": 0
}
]This is only applicable to IMAP/SMTP accounts.
In the IMAP protocol, this list reflects which mailboxes the user has chosen to subscribe to on the server side, as maintained by the IMAP server. This is not a synchronized list of all mail folders, but rather the server-side subscription list.
[- {
- "id": 0,
- "account_id": 0,
- "name": "string",
- "delimiter": "string",
- "attributes": [
- {
- "attr": "NoInferiors",
- "extension": "string"
}
], - "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "exists": 0,
- "unseen": 0,
- "permanent_flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "uid_next": 0,
- "uid_validity": 0,
- "highest_modseq": 0
}
]This operation is only applicable to IMAP/SMTP accounts.
In the IMAP protocol, it marks the mailbox as subscribed on the server side. It does not create or synchronize the mailbox, but only updates the server-maintained subscription list.
Unsupported for Gmail API accounts.
The name of the mailbox to subscribe to.
{- "message": "string",
- "code": 0
}This operation is only applicable to IMAP/SMTP accounts.
In the IMAP protocol, it removes the mailbox from the subscription list on the server side. It does not delete the mailbox or stop synchronization, but only affects the server’s record of subscribed folders.
Unsupported for Gmail API accounts.
The name of the mailbox to unsubscribe from.
{- "message": "string",
- "code": 0
}The name of the mailbox to create.
| mailbox_name required | string Name of the mailbox or label.
|
object (LabelColor) Optional color settings for the label (Gmail API only). Only applicable to Gmail API accounts. See [ |
{- "mailbox_name": "string",
- "label_color": {
- "text_color": "string",
- "background_color": "string"
}
}{- "message": "string",
- "code": 0
}The rename payload including old and new mailbox names.
| current_name required | string [ 1 .. 1024 ] characters Current name of the mailbox or label.
|
| new_name | string [ 1 .. 1024 ] characters New name for the mailbox or label (optional). |
object (LabelColor) Optional color settings for the label (Gmail API only). Only applicable to Gmail API accounts. See [ |
{- "current_name": "string",
- "new_name": "string",
- "label_color": {
- "text_color": "string",
- "background_color": "string"
}
}{- "message": "string",
- "code": 0
}specifying the source and destination mailboxes and messages
| ids required | Array of strings A list of unique message identifiers as strings.
|
| current_mailbox required | string The name of the mailbox from which the messages will be moved. For IMAP: the decoded, human-readable name of the mailbox (e.g., "INBOX"). For Gmail API: represents the label name. |
| target_mailbox required | string The name of the mailbox to which the messages will be moved. For IMAP: the decoded, human-readable name of the mailbox (e.g., "INBOX"). For Gmail API: represents the label name. |
{- "ids": [
- "string"
], - "current_mailbox": "string",
- "target_mailbox": "string"
}{- "message": "string",
- "code": 0
}specifying the source and destination mailboxes and messages.
| ids required | Array of strings A list of unique message identifiers as strings.
|
| current_mailbox required | string The name of the mailbox from which the messages will be moved. For IMAP: the decoded, human-readable name of the mailbox (e.g., "INBOX"). For Gmail API: represents the label name. |
| target_mailbox required | string The name of the mailbox to which the messages will be moved. For IMAP: the decoded, human-readable name of the mailbox (e.g., "INBOX"). For Gmail API: represents the label name. |
{- "ids": [
- "string"
], - "current_mailbox": "string",
- "target_mailbox": "string"
}{- "message": "string",
- "code": 0
}specifying the mailbox and messages to delete.
| ids required | Array of strings A list of unique message identifiers as strings.
|
| mailbox | string The decoded, human-readable name of the mailbox containing the email (e.g., "INBOX"). (IMAP only)
This name is presented as it appears to users, with any encoding (e.g., UTF-7) automatically handled by the system,
so no manual decoding is required.
In Gmail API, this field is not required and can be set to |
{- "ids": [
- "string"
], - "mailbox": "string"
}{- "message": "string",
- "code": 0
}specifying the mailbox, messages, and flags to modify.
| uids required | Array of integers <uint32> [ items <uint32 > ] A list of unique identifiers (UIDs) of the messages to be flagged or unflagged. |
| mailbox required | string The name of the mailbox where the messages are located. The decoded, human-readable name of the mailbox containing the email (e.g., "INBOX"). This name is presented as it appears to users, with any encoding (e.g., UTF-7) automatically handled by the system, so no manual decoding is required. |
required | object (FlagAction) The action to be performed on the message flags. |
{- "uids": [
- 0
], - "mailbox": "string",
- "action": {
- "add": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "remove": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "overwrite": [
- {
- "flag": "Seen",
- "custom": "string"
}
]
}
}{- "message": "string",
- "code": 0
}| mailbox required | string The decoded, human-readable name of the mailbox containing the email (e.g., "INBOX"). This name is presented as it appears to users, with any encoding (e.g., UTF-7) automatically handled by the system, so no manual decoding is required. |
| remote | boolean fetches messages from the IMAP server; otherwise, uses local data. |
| next_page_token | string The token for fetching the next page of results in pagination.
|
| page_size required | integer <uint64> The number of messages per page. |
| desc | boolean lists messages in descending order; otherwise, ascending. internal date |
{- "next_page_token": "string",
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": "string",
- "account_id": 0,
- "mailbox_id": 0,
- "mailbox_name": "string",
- "internal_date": 0,
- "size": 0,
- "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "flags_hash": 0,
- "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "date": 0,
- "from": {
- "name": "string",
- "address": "string"
}, - "in_reply_to": "string",
- "sender": {
- "name": "string",
- "address": "string"
}, - "return_address": "string",
- "message_id": "string",
- "subject": "string",
- "thread_name": "string",
- "thread_id": 0,
- "mime_version": "string",
- "references": [
- "string"
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "to": [
- {
- "name": "string",
- "address": "string"
}
], - "attachments": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
], - "body_meta": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "received": {
- "from": "string",
- "by": "string",
- "with": "string",
- "date": 0
}, - "labels": [
- "string"
]
}
], - "total_pages": 0
}| mailbox required | string The decoded, human-readable name of the mailbox containing the email (e.g., "INBOX"). This name is presented as it appears to users, with any encoding (e.g., UTF-7) automatically handled by the system, so no manual decoding is required. |
| page required | integer <uint64> The page number for pagination (1-based). |
| page_size required | integer <uint64> The number of messages per page. |
| desc | boolean lists messages in descending order; otherwise, ascending. internal date |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": "string",
- "account_id": 0,
- "mailbox_id": 0,
- "mailbox_name": "string",
- "internal_date": 0,
- "size": 0,
- "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "flags_hash": 0,
- "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "date": 0,
- "from": {
- "name": "string",
- "address": "string"
}, - "in_reply_to": "string",
- "sender": {
- "name": "string",
- "address": "string"
}, - "return_address": "string",
- "message_id": "string",
- "subject": "string",
- "thread_name": "string",
- "thread_id": 0,
- "mime_version": "string",
- "references": [
- "string"
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "to": [
- {
- "name": "string",
- "address": "string"
}
], - "attachments": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
], - "body_meta": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "received": {
- "from": "string",
- "by": "string",
- "with": "string",
- "date": 0
}, - "labels": [
- "string"
]
}
], - "total_pages": 0
}| thread_id required | integer <uint64> |
[- {
- "id": "string",
- "account_id": 0,
- "mailbox_id": 0,
- "mailbox_name": "string",
- "internal_date": 0,
- "size": 0,
- "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "flags_hash": 0,
- "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "date": 0,
- "from": {
- "name": "string",
- "address": "string"
}, - "in_reply_to": "string",
- "sender": {
- "name": "string",
- "address": "string"
}, - "return_address": "string",
- "message_id": "string",
- "subject": "string",
- "thread_name": "string",
- "thread_id": 0,
- "mime_version": "string",
- "references": [
- "string"
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "to": [
- {
- "name": "string",
- "address": "string"
}
], - "attachments": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
], - "body_meta": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "received": {
- "from": "string",
- "by": "string",
- "with": "string",
- "date": 0
}, - "labels": [
- "string"
]
}
]specifying the mailbox and message to fetch.
| mailbox | string The name of the mailbox containing the message
|
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
| max_length | integer <uint64> Optional maximum length to retrieve for text parts (useful for large messages)
|
Array of objects (EmailBodyPart) Specific email body parts to retrieve (e.g., TEXT, HTML)
| |
Array of objects (ImapAttachment) Optional list of attachments to include inline in the response
|
{- "mailbox": "string",
- "id": "string",
- "max_length": 0,
- "sections": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "inline": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
]
}{- "plain": {
- "content": "string",
- "truncated": true
}, - "html": "string",
- "attachments": [
- {
- "file_type": "string",
- "transfer_encoding": "string",
- "content_id": "string",
- "inline": true,
- "filename": "string",
- "id": "string",
- "size": 0
}
]
}specifying the mailbox, message, and attachment to fetch.
| mailbox | string IMAP only: The name of the mailbox where the message is located. Not used for Gmail API accounts. |
object (ImapAttachment) IMAP only: The metadata describing the attachment to fetch. Not used for Gmail API accounts. | |
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
object (AttachmentInfo) Gmail API only: attachment info used to fetch it via Gmail API. Not used for IMAP accounts. | |
| filename | string Optional: The original filename of the attachment, if available.
|
{- "mailbox": "string",
- "attachment": {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}, - "id": "string",
- "attachment_info": {
- "file_type": "string",
- "transfer_encoding": "string",
- "content_id": "string",
- "inline": true,
- "filename": "string",
- "id": "string",
- "size": 0
}, - "filename": "string"
}{- "message": "string",
- "code": 0
}| mailbox | string The decoded, human-readable name of the mailbox containing the email (e.g., "INBOX"). This name is presented as it appears to users, with any encoding (e.g., UTF-7) automatically handled by the system, so no manual decoding is required. |
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
| filename | string An optional filename for the attachment (defaults to a timestamped |
{- "message": "string",
- "code": 0
}| next_page_token | string The token for fetching the next page of results in pagination.
|
| page_size required | integer <uint64> The number of messages per page. |
| desc | boolean If |
specifying the search criteria (e.g., keywords, flags).
required | object The search criteria to apply (can be a simple condition or complex logical expression) |
| mailbox | string The name of the mailbox to search in
|
{- "search": {
- "type": "Condition",
- "condition": "All",
- "value": "string"
}, - "mailbox": "string"
}{- "next_page_token": "string",
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": "string",
- "account_id": 0,
- "mailbox_id": 0,
- "mailbox_name": "string",
- "internal_date": 0,
- "size": 0,
- "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "flags_hash": 0,
- "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "date": 0,
- "from": {
- "name": "string",
- "address": "string"
}, - "in_reply_to": "string",
- "sender": {
- "name": "string",
- "address": "string"
}, - "return_address": "string",
- "message_id": "string",
- "subject": "string",
- "thread_name": "string",
- "thread_id": 0,
- "mime_version": "string",
- "references": [
- "string"
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "to": [
- {
- "name": "string",
- "address": "string"
}
], - "attachments": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
], - "body_meta": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "received": {
- "from": "string",
- "by": "string",
- "with": "string",
- "date": 0
}, - "labels": [
- "string"
]
}
], - "total_pages": 0
}| page required | integer <uint64> The page number for pagination (1-based). |
| page_size required | integer <uint64> The number of messages per page. |
| desc | boolean If |
The unified search criteria (email, time range, accounts, etc.).
| accounts | Array of integers <uint64> [ items <uint64 > ] Optional list of account IDs to search within. If omitted, search all accessible accounts. |
| email required | string Customer email address to search for (appears in from, to, cc, bcc). |
| after | integer <int64> Optional start timestamp (UTC milliseconds). Filters messages after this time. |
| before | integer <int64> Optional end timestamp (UTC milliseconds). Filters messages before this time. |
{- "accounts": [
- 0
], - "email": "string",
- "after": 0,
- "before": 0
}{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": "string",
- "account_id": 0,
- "mailbox_id": 0,
- "mailbox_name": "string",
- "internal_date": 0,
- "size": 0,
- "flags": [
- {
- "flag": "Seen",
- "custom": "string"
}
], - "flags_hash": 0,
- "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "date": 0,
- "from": {
- "name": "string",
- "address": "string"
}, - "in_reply_to": "string",
- "sender": {
- "name": "string",
- "address": "string"
}, - "return_address": "string",
- "message_id": "string",
- "subject": "string",
- "thread_name": "string",
- "thread_id": 0,
- "mime_version": "string",
- "references": [
- "string"
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "to": [
- {
- "name": "string",
- "address": "string"
}
], - "attachments": [
- {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
], - "body_meta": [
- {
- "id": "string",
- "part_type": "Plain",
- "path": {
- "segments": [
- 0
]
}, - "params": [
- {
- "key": "string",
- "value": "string"
}
], - "size": 0,
- "transfer_encoding": "None"
}
], - "received": {
- "from": "string",
- "by": "string",
- "with": "string",
- "date": 0
}, - "labels": [
- "string"
]
}
], - "total_pages": 0
}The newly created draft is appended into the specified draft mailbox.
Request body containing original message location and reply content.
| mailbox_name required | string The name of the mailbox or label containing the original message.
|
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
| preview | string [ 1 .. 200 ] characters A preview text for the reply email. This optional field provides a short summary or preview of the reply content. |
| text | string [ 1 .. 10000 ] characters The plain text body of the reply email. This field is optional and can be used to provide plain text content. |
| html | string [ 1 .. 50000 ] characters The HTML body of the reply email. This field is optional and can be used to provide HTML content. |
| draft_folder_path | string The path of the folder used to store drafts (IMAP accounts only). For example: "[Gmail]/Drafts".
This can be obtained from the |
{- "mailbox_name": "string",
- "id": "string",
- "preview": "string",
- "text": "string",
- "html": "string",
- "draft_folder_path": "string"
}{- "message": "string",
- "code": 0
}{- "id": 0,
- "description": "string",
- "credentials": {
- "username": "string",
- "password": "string"
}, - "server": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl"
}, - "created_at": 0,
- "dsn_capable": true,
- "updated_at": 0,
- "last_access_at": 0,
- "use_proxy": 0
}Requires root privileges.
The MTA update request payload.
| description | string Optional descriptive text about the MTA. |
object (MTACredentials) Optional updated credentials. | |
object (SmtpServerConfig) Optional updated SMTP server configuration. | |
| dsn_capable | boolean Optional updated DSN support flag. |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection.
|
{- "description": "string",
- "credentials": {
- "username": "string",
- "password": "string"
}, - "server": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl"
}, - "dsn_capable": true,
- "use_proxy": 0
}{- "message": "string",
- "code": 0
}Requires root privileges.
The MTA creation request payload.
| description | string Optional descriptive text about the MTA. |
required | object (MTACredentials) Credentials used for authenticating with the MTA server. |
required | object (SmtpServerConfig) SMTP server configuration details. |
| dsn_capable required | boolean Whether the MTA supports DSN (Delivery Status Notification). |
| use_proxy | integer <uint64> Optional proxy ID for establishing the connection.
|
{- "description": "string",
- "credentials": {
- "username": "string",
- "password": "string"
}, - "server": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl"
}, - "dsn_capable": true,
- "use_proxy": 0
}{- "message": "string",
- "code": 0
}| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "description": "string",
- "credentials": {
- "username": "string",
- "password": "string"
}, - "server": {
- "host": "string",
- "port": 1,
- "encryption": "Ssl"
}, - "created_at": 0,
- "dsn_capable": true,
- "updated_at": 0,
- "last_access_at": 0,
- "use_proxy": 0
}
], - "total_pages": 0
}request payload.
| from required | string The email address of the sender (e.g., "no-reply@yourdomain.com"). |
| to required | string The email address of a single recipient (e.g., "user@example.com"). |
| subject required | string [ 1 .. 256 ] characters The subject line of the email. |
| message required | string [ 1 .. 1024 ] characters The plain text body content of the email, sent as the text/plain part of the email. |
{- "from": "string",
- "to": "string",
- "subject": "string",
- "message": "string"
}{- "message": "string",
- "code": 0
}Requires root privileges. This endpoint fetches the OAuth2 configuration identified by the given name.
{- "id": 0,
- "description": "string",
- "client_id": "string",
- "client_secret": "string",
- "auth_url": "string",
- "token_url": "string",
- "redirect_uri": "string",
- "scopes": [
- "string"
], - "extra_params": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "use_proxy": 0,
- "created_at": 0,
- "updated_at": 0
}Requires root privileges. This endpoint updates the OAuth2 configuration identified by the specified name
A JSON payload containing the updated configuration details
| description | string A description of what this configuration is used for. |
| client_id | string The client ID used for authenticating the application with the OAuth2 provider. |
| client_secret | string The client secret used in conjunction with the client ID. |
| auth_url | string The URL to redirect users to for OAuth2 authorization. |
| token_url | string The URL to exchange authorization codes for access tokens. |
| redirect_uri | string The URI where the OAuth2 provider will redirect to after authorization. |
| scopes | Array of strings The scopes of access that are being requested (e.g., email, profile). |
object Any additional parameters to include in the OAuth2 requests (e.g., access_type, prompt). | |
| enabled | boolean Indicates whether this configuration is enabled or disabled. |
| use_proxy | integer <uint64> route OAuth through proxy (when direct access is blocked) |
{- "description": "string",
- "client_id": "string",
- "client_secret": "string",
- "auth_url": "string",
- "token_url": "string",
- "redirect_uri": "string",
- "scopes": [
- "string"
], - "extra_params": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "use_proxy": 0
}{- "message": "string",
- "code": 0
}Requires root privileges. This endpoint creates a new OAuth2 configuration based on the provided request data.
A JSON payload containing the details for the new OAuth2 configuration
| description | string A description of what this configuration is used for. |
| client_id required | string The client ID used for authenticating the application with the OAuth2 provider. |
| client_secret required | string The client secret used in conjunction with the client ID. |
| auth_url required | string The URL to redirect users to for OAuth2 authorization. |
| token_url required | string The URL to exchange authorization codes for access tokens. |
| redirect_uri required | string The URI where the OAuth2 provider will redirect to after authorization. |
| scopes | Array of strings The scopes of access that are being requested (e.g., email, profile). |
object Any additional parameters to include in the OAuth2 requests (e.g., access_type, prompt). | |
| enabled required | boolean Indicates whether this configuration is enabled or disabled. |
| use_proxy | integer <uint64> route OAuth through proxy (when direct access is blocked) |
{- "description": "string",
- "client_id": "string",
- "client_secret": "string",
- "auth_url": "string",
- "token_url": "string",
- "redirect_uri": "string",
- "scopes": [
- "string"
], - "extra_params": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "use_proxy": 0
}{- "message": "string",
- "code": 0
}This endpoint retrieves a paginated list of OAuth2 configurations, allowing for optional pagination and sorting parameters. It requires root access.
| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "description": "string",
- "client_id": "string",
- "client_secret": "string",
- "auth_url": "string",
- "token_url": "string",
- "redirect_uri": "string",
- "scopes": [
- "string"
], - "extra_params": {
- "property1": "string",
- "property2": "string"
}, - "enabled": true,
- "use_proxy": 0,
- "created_at": 0,
- "updated_at": 0
}
], - "total_pages": 0
}This endpoint fetches the OAuth2 access tokens associated with the given account ID.
{- "account_id": 0,
- "oauth2_id": 0,
- "access_token": "string",
- "refresh_token": "string",
- "created_at": 0,
- "updated_at": 0
}This endpoint allows two usage modes:
access_token is provided, RustMailer will store it directly.oauth2_id and refresh_token are provided, it means the external
OAuth2 authorization flow has been completed outside RustMailer.Note: The oauth2_id must reference a valid OAuth2 configuration
already created in RustMailer.
| oauth2_id | integer <uint64> The id of the OAuth2 configuration associated with this access token. |
| access_token | string The OAuth2 access token used to authenticate requests to the provider. |
| refresh_token | string The OAuth2 refresh token used to obtain new access tokens. |
{- "oauth2_id": 0,
- "access_token": "string",
- "refresh_token": "string"
}{- "message": "string",
- "code": 0
}This endpoint constructs and sends a new email based on the provided request data.
A JSON payload containing the details of the email to be sent
object (EmailAddress) The sender's email address. If not provided, a default sender address may be used based on the account configuration. | |
required | Array of objects (Recipient) The list of recipients for the email. This field is required and must contain at least one recipient. Each recipient in the list will be handled as a separate send task (e.g., To, Cc, or Bcc). |
| subject | string The subject line of the email. This field is optional and may be omitted for emails without a subject. |
| text | string The plain text body of the email. This field is optional and can be used for emails that support plain text content. |
| html | string The HTML body of the email. This field is optional and can be used for emails that support HTML content. |
| preview | string A preview text for the email. This optional field provides a short summary or preview of the email content, often displayed in email clients. |
| eml | string The raw EML content of the email. This optional field allows specifying the email content in EML format, overriding other content fields if provided. |
| template_id | integer <uint64> The name of a template to use for rendering the email. This optional field specifies a predefined email template to generate the email content. |
Array of objects (MailAttachment) A list of attachments to include in the email. This optional field allows adding file attachments to the email. | |
object Custom email headers to include in the email. This optional field allows specifying additional headers (e.g., Reply-To, X-Custom-Header) as key-value pairs. | |
object (SendControl) Configuration options for controlling the email sending process. This required field specifies settings such as scheduling, or retry policies for sending the email. |
{- "from": {
- "name": "string",
- "address": "string"
}, - "recipients": [
- {
- "to": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "reply_to": [
- {
- "name": "string",
- "address": "string"
}
], - "template_params": null,
- "send_at": 0
}
], - "subject": "string",
- "text": "string",
- "html": "string",
- "preview": "string",
- "eml": "string",
- "template_id": 0,
- "attachments": [
- {
- "file_name": "string",
- "payload": {
- "base64_content": "string",
- "attachment_ref": {
- "mailbox_name": "string",
- "uid": 0,
- "attachment_data": {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
}
}, - "mime_type": "string",
- "inline": true,
- "content_id": "string"
}
], - "headers": {
- "property1": {
- "type": "Raw",
- "raw": "string"
}, - "property2": {
- "type": "Raw",
- "raw": "string"
}
}, - "send_control": {
- "envelope": {
- "from": "string",
- "recipients": [
- "string"
]
}, - "save_to_sent": true,
- "sent_folder": "string",
- "dry_run": true,
- "send_at": 0,
- "retry_policy": {
- "strategy": "Linear",
- "seconds": 0,
- "max_retries": 0
}, - "mta": 0,
- "dsn": {
- "ret": "Full",
- "envid": "string",
- "notify": [
- "Success"
], - "orcpt": "string"
}, - "campaign_id": "string",
- "enable_tracking": true
}
}{- "message": "string",
- "code": 0
}This endpoint constructs and sends a reply to an email based on the provided request data.
A JSON payload containing the details of the email reply
| mailbox_name required | string The name of the mailbox containing the original message. This is used to locate the source message that is being replied to. |
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
| text | string The plain text body of the reply email. This field is optional and can be used to provide plain text content. |
| html | string The HTML body of the reply email. This field is optional and can be used to provide HTML content. |
| preview | string A preview text for the reply email. This optional field provides a short summary or preview of the reply content. |
object Custom email headers to include in the reply email. This optional field allows specifying additional headers as key-value pairs. | |
| reply_all required | boolean Whether to reply to all original recipients (Reply-All). If true, the reply will be sent to all original recipients, including Cc. |
Array of objects (MailAttachment) A list of attachments to include in the reply. This optional field allows adding new file attachments to the reply email. | |
Array of objects (EmailAddress) A list of Cc recipients to include in the reply. This optional field allows explicitly specifying Cc recipients. | |
Array of objects (EmailAddress) A list of Bcc recipients to include in the reply. This optional field allows explicitly specifying Bcc recipients. | |
| include_original required | boolean Whether to include the original message in the reply body. If true, the original message content will be quoted and included in the reply. |
| include_all_attachments required | boolean Whether to include all original attachments in the reply. If true, all attachments from the original message will be included in the reply. |
| timezone | string The sender's timezone (e.g., "Asia/Shanghai"). This optional field may be used for formatting date/time in the reply body. |
object (SendControl) Configuration options for controlling the email sending process. This required field specifies settings such as scheduling, or retry policies for sending the reply. |
{- "mailbox_name": "string",
- "id": "string",
- "text": "string",
- "html": "string",
- "preview": "string",
- "headers": {
- "property1": {
- "type": "Raw",
- "raw": "string"
}, - "property2": {
- "type": "Raw",
- "raw": "string"
}
}, - "reply_all": true,
- "attachments": [
- {
- "file_name": "string",
- "payload": {
- "base64_content": "string",
- "attachment_ref": {
- "mailbox_name": "string",
- "uid": 0,
- "attachment_data": {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
}
}, - "mime_type": "string",
- "inline": true,
- "content_id": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "include_original": true,
- "include_all_attachments": true,
- "timezone": "string",
- "send_control": {
- "envelope": {
- "from": "string",
- "recipients": [
- "string"
]
}, - "save_to_sent": true,
- "sent_folder": "string",
- "dry_run": true,
- "send_at": 0,
- "retry_policy": {
- "strategy": "Linear",
- "seconds": 0,
- "max_retries": 0
}, - "mta": 0,
- "dsn": {
- "ret": "Full",
- "envid": "string",
- "notify": [
- "Success"
], - "orcpt": "string"
}, - "campaign_id": "string",
- "enable_tracking": true
}
}{- "message": "string",
- "code": 0
}This endpoint constructs and sends a forwarded email based on the provided request data.
A JSON payload containing the details of the email to be forwarded.
| mailbox_name required | string The name of the mailbox containing the original message. This is used to locate the source message that is being forwarded. |
| id required | string The unique ID of the message, either IMAP UID or Gmail API MID.
|
required | Array of objects (EmailAddress) The list of primary recipients to forward the email to. At least one recipient must be specified. |
Array of objects (EmailAddress) A list of Cc recipients to include in the forwarded email. This optional field allows explicitly specifying Cc recipients. | |
Array of objects (EmailAddress) A list of Bcc recipients to include in the forwarded email. This optional field allows explicitly specifying Bcc recipients. | |
| text | string The plain text body of the forwarded email. This field is optional and can be used to provide additional comments or content. |
| html | string The HTML body of the forwarded email. This field is optional and can be used to provide HTML-formatted content. |
| preview | string A preview text for the forwarded email. This optional field provides a short summary or preview of the email content. |
object Custom email headers to include in the forwarded email. This optional field allows specifying additional headers as key-value pairs. | |
| timezone | string The sender's timezone (e.g., "Asia/Shanghai"). This optional field may be used for formatting date/time in the forwarded content. |
Array of objects (MailAttachment) A list of new attachments to include in the forwarded email. This optional field allows adding additional attachments beyond the original ones. | |
| include_original required | boolean Whether to include the original message in the forwarded email body. If true, the full original message content will be included in the body. |
| include_all_attachments required | boolean Whether to include all original attachments in the forwarded email. If true, all attachments from the original message will be forwarded as well. |
object (SendControl) Configuration options for controlling the email sending process. This required field specifies settings such as scheduling or retry policies for sending the forwarded email. |
{- "mailbox_name": "string",
- "id": "string",
- "to": [
- {
- "name": "string",
- "address": "string"
}
], - "cc": [
- {
- "name": "string",
- "address": "string"
}
], - "bcc": [
- {
- "name": "string",
- "address": "string"
}
], - "text": "string",
- "html": "string",
- "preview": "string",
- "headers": {
- "property1": {
- "type": "Raw",
- "raw": "string"
}, - "property2": {
- "type": "Raw",
- "raw": "string"
}
}, - "timezone": "string",
- "attachments": [
- {
- "file_name": "string",
- "payload": {
- "base64_content": "string",
- "attachment_ref": {
- "mailbox_name": "string",
- "uid": 0,
- "attachment_data": {
- "id": "string",
- "path": {
- "segments": [
- 0
]
}, - "filename": "string",
- "inline": true,
- "content_id": "string",
- "size": 0,
- "file_type": "string",
- "transfer_encoding": "None"
}
}
}, - "mime_type": "string",
- "inline": true,
- "content_id": "string"
}
], - "include_original": true,
- "include_all_attachments": true,
- "send_control": {
- "envelope": {
- "from": "string",
- "recipients": [
- "string"
]
}, - "save_to_sent": true,
- "sent_folder": "string",
- "dry_run": true,
- "send_at": 0,
- "retry_policy": {
- "strategy": "Linear",
- "seconds": 0,
- "max_retries": 0
}, - "mta": 0,
- "dsn": {
- "ret": "Full",
- "envid": "string",
- "notify": [
- "Success"
], - "orcpt": "string"
}, - "campaign_id": "string",
- "enable_tracking": true
}
}{- "message": "string",
- "code": 0
}This endpoint retrieves a paginated list of email tasks, filtered by accessible accounts and optionally by task status. It supports sorting in ascending or descending order by creation time.
| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
| status | string (TaskStatus) Enum: "Scheduled" "Running" "Success" "Failed" "Removed" "Stopped" Represents the status of a task in the system. This enum defines the lifecycle states that a task can be in, from initial scheduling to completion or removal. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "created_at": 0,
- "status": "Scheduled",
- "stopped_reason": "string",
- "error": "string",
- "last_duration_ms": 0,
- "retry_count": 0,
- "scheduled_at": 0,
- "account_id": 0,
- "account_email": "string",
- "subject": "string",
- "message_id": "string",
- "from": "string",
- "to": [
- "string"
], - "cc": [
- "string"
], - "bcc": [
- "string"
], - "attachment_count": 0,
- "cache_key": "string",
- "envelope": {
- "from": "string",
- "recipients": [
- "string"
]
}, - "save_to_sent": true,
- "sent_folder": "string",
- "send_at": 0,
- "mta": 0,
- "dsn": {
- "ret": "Full",
- "envid": "string",
- "notify": [
- "Success"
], - "orcpt": "string"
}, - "reply": true,
- "mailbox": "string",
- "uid": 0
}
], - "total_pages": 0
}This endpoint fetches the details of an email task identified by the provided ID.
{- "id": 0,
- "created_at": 0,
- "status": "Scheduled",
- "stopped_reason": "string",
- "error": "string",
- "last_duration_ms": 0,
- "retry_count": 0,
- "scheduled_at": 0,
- "account_id": 0,
- "account_email": "string",
- "subject": "string",
- "message_id": "string",
- "from": "string",
- "to": [
- "string"
], - "cc": [
- "string"
], - "bcc": [
- "string"
], - "attachment_count": 0,
- "cache_key": "string",
- "envelope": {
- "from": "string",
- "recipients": [
- "string"
]
}, - "save_to_sent": true,
- "sent_folder": "string",
- "send_at": 0,
- "mta": 0,
- "dsn": {
- "ret": "Full",
- "envid": "string",
- "notify": [
- "Success"
], - "orcpt": "string"
}, - "reply": true,
- "mailbox": "string",
- "uid": 0
}Initiates asynchronous removal of an email task by marking it for deletion. The task will be:
{- "message": "string",
- "code": 0
}This endpoint returns a consolidated view of all critical system notifications including:
{- "release": {
- "latest": {
- "tag_name": "string",
- "published_at": "string",
- "body": "string",
- "html_url": "string"
}, - "is_newer": true,
- "error_message": "string"
}, - "license": {
- "expired": true,
- "days": 0
}
}This endpoint returns a consolidated view of all key metrics including:
{- "pending_email_task_num": 0,
- "pending_hook_task_num": 0,
- "account_num": 0,
- "uptime": 0,
- "rustmailer_version": "string",
- "time_series": {
- "imap_traffic_sent": [
- {
- "timestamp": 0,
- "value": 0
}
], - "imap_traffic_received": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_sent_success": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_sent_failure": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_sent_bytes": [
- {
- "timestamp": 0,
- "value": 0
}
], - "new_email_arrival": [
- {
- "timestamp": 0,
- "value": 0
}
], - "mail_flag_change": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_opens": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_clicks": [
- {
- "timestamp": 0,
- "value": 0
}
], - "event_dispatch_success_http": [
- {
- "timestamp": 0,
- "value": 0
}
], - "event_dispatch_success_nats": [
- {
- "timestamp": 0,
- "value": 0
}
], - "event_dispatch_failure_http": [
- {
- "timestamp": 0,
- "value": 0
}
], - "event_dispatch_failure_nats": [
- {
- "timestamp": 0,
- "value": 0
}
], - "email_task_queue_length": [
- {
- "timestamp": 0,
- "value": 0
}
], - "hook_task_queue_length": [
- {
- "timestamp": 0,
- "value": 0
}
]
}
}Returns the template if found, or a ResourceNotFound error if no template matches the provided name.
{- "id": 0,
- "description": "string",
- "account": {
- "id": 0,
- "email": "string"
}, - "subject": "string",
- "preview": "string",
- "format": "Markdown",
- "text": "string",
- "html": "string",
- "created_at": 0,
- "updated_at": 0,
- "last_access_at": 0
}Modifies the specified template with the provided update data if it exists and the client has access. Returns a ResourceNotFound error if the template is not found.
JSON payload containing the updated template data.
| description | string <= 1024 characters A brief description of the email template (optional). Maximum length is 1024 characters. |
| subject | string <= 20480 characters The subject line of the email (optional). Maximum length is 20,480 characters. |
| preview | string <= 256 characters Preview text for the email (optional), displayed in email clients. Maximum length is 256 characters. |
| text | string <= 8388608 characters The plain text content of the email template (optional). Maximum length is 8,388,608 characters (approximately 8MB). |
| html | string <= 8388608 characters The HTML content of the email template (optional). Maximum length is 8,388,608 characters (approximately 8MB). |
| format | string Enum: "Markdown" "Html" Format of the HTML email content, either Markdown or HTML. Defaults to HTML if not specified. |
{- "description": "string",
- "subject": "string",
- "preview": "string",
- "text": "string",
- "html": "string",
- "format": "Markdown"
}{- "message": "string",
- "code": 0
}Saves a new email template based on the provided request data.
JSON payload containing the data needed to create a new email template
| description | string <= 1024 characters A brief description of the email template (optional). Maximum length is 1024 characters. |
| account_id | integer <uint64> The associated account information that created or uses this template (optional). |
| subject required | string <= 20480 characters The subject line of the email. Maximum length is 20,480 characters. |
| preview | string <= 256 characters Preview text for the email (optional), displayed in email clients. Maximum length is 256 characters. |
| text | string <= 8388608 characters The plain text content of the email template (optional). Maximum length is 8,388,608 characters (approximately 8MB). |
| html | string <= 8388608 characters The HTML content of the email template (optional). Maximum length is 8,388,608 characters (approximately 8MB). |
| format | string Enum: "Markdown" "Html" Format of the HTML email content, either Markdown or HTML. Defaults to HTML if not specified. |
{- "description": "string",
- "account_id": 0,
- "subject": "string",
- "preview": "string",
- "text": "string",
- "html": "string",
- "format": "Markdown"
}{- "message": "string",
- "code": 0
}Retrieves a paginated list of all email templates. Requires root privileges.
| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "description": "string",
- "account": {
- "id": 0,
- "email": "string"
}, - "subject": "string",
- "preview": "string",
- "format": "Markdown",
- "text": "string",
- "html": "string",
- "created_at": 0,
- "updated_at": 0,
- "last_access_at": 0
}
], - "total_pages": 0
}Retrieves a paginated list of templates for the specified account ID. Requires access to the specified account.
| page | integer <uint64> Optional. The page number to retrieve (starting from 1). |
| page_size | integer <uint64> Optional. The number of items per page. |
| desc | boolean Optional. Whether to sort the list in descending order. |
{- "current_page": 0,
- "page_size": 0,
- "total_items": 0,
- "items": [
- {
- "id": 0,
- "description": "string",
- "account": {
- "id": 0,
- "email": "string"
}, - "subject": "string",
- "preview": "string",
- "format": "Markdown",
- "text": "string",
- "html": "string",
- "created_at": 0,
- "updated_at": 0,
- "last_access_at": 0
}
], - "total_pages": 0
}This endpoint allows sending a test email to verify template rendering and delivery.
request payload.
| account_id required | integer <uint64> Account ID associated with the template and sending request |
| recipient required | string Email address of the recipient who will receive the test email Must be a valid email address format (e.g., user@example.com) |
| template_params | any Optional parameters to be used for template variable substitution When provided, should be a valid JSON object that matches the template's expected variables. Example: {"name": "John Doe", "order_id": 12345} |
{- "account_id": 0,
- "recipient": "string",
- "template_params": null
}{- "message": "string",
- "code": 0
}