Skip to content
docs
Browse the docsRules and templates

Mail

Rules and templates

Forward, label or drop new mail by sender or subject with inbox rules, and save inbox settings as templates to make new inboxes from.

Inbox rules

A rule looks at every new message in your inboxes as it arrives and does one thing with it: forward it, label it or drop it. Rules are on Pro (10 rules) and Business (50 rules).

How a message is matched:

  • Each rule has a sender pattern, a subject pattern, or both. A rule matches when either of its patterns matches.
  • Patterns are globs: * is any run of characters, ? is one character, and case is ignored. A pattern matches the whole value, so *@github.com matches noreply@github.com and github alone matches only the exact text github.
  • Rules are tried from the highest priority down (0 to 100). The first rule that matches is the only one applied.
  • Disabled rules are skipped.
actionaction_valueWhat happens
labelA label nameThe message is stored with that label. A label of that name is made if you have none.
forwardAn email addressThe message is stored and a copy is sent to the address (needs a plan with forwarding; not to dissolve.email or disposable addresses). For that message it takes the place of the inbox's own forwarding.
deleteNothingThe message is dropped as it arrives: it is never stored and sends no message.received webhook.

Patterns are at most 200 characters with at most 10 * each.

Create a rule

POST/v1/rulesrules:managePro and up
FieldWhat it does
nameRequired. What the rule is for, at most 100 characters.
from_patternGlob for the sender address, or null.
subject_patternGlob for the subject, or null. At least one pattern is required.
actionRequired. forward, delete or label.
action_valueThe forward address or the label name.
enabledDefault true.
priority0 to 100, default 0. Higher runs first.
curl -X POST https://api.dissolve.email/v1/rules \
  -H "Authorization: Bearer $DISSOLVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Label receipts", "subject_pattern": "*receipt*", "action": "label", "action_value": "Receipts"}'
JSON
{
  "id": "rul3Kd7PxN2qVw9Zc4TmB",
  "name": "Label receipts",
  "fromPattern": null,
  "subjectPattern": "*receipt*",
  "action": "label",
  "actionValue": "Receipts",
  "enabled": true,
  "priority": 0,
  "createdAt": "2026-11-19T10:00:00.000Z",
  "updatedAt": "2026-11-19T10:00:00.000Z"
}

Requests use snake_case field names; answers use camelCase. Going over your plan's count answers 400 rule_limit; a bad pattern 400 invalid_pattern; a forward rule without forwarding on your plan 403 upgrade_required.

List, change and delete rules

GET/v1/rulesrules:managePro and up
JSON
{ "rules": [{ "id": "rul3Kd7PxN2qVw9Zc4TmB", "name": "Label receipts", "subjectPattern": "*receipt*", "action": "label", "actionValue": "Receipts", "enabled": true, "priority": 0 }], "limit": 10, "used": 1 }
GET/v1/rules/{id}rules:managePro and up PATCH/v1/rules/{id}rules:managePro and up

Send only the fields that change. The rule is checked again as a whole, so you cannot remove its last pattern.

curl -X PATCH https://api.dissolve.email/v1/rules/$RULE_ID \
  -H "Authorization: Bearer $DISSOLVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
DELETE/v1/rules/{id}rules:managePro and up

Two more calls take an API key or the signed-in app, outside /v1: flip a rule on or off, and set the priority of many rules at once with {"rules": [{"id": "...", "priority": 10}]}.

POST/api/inbox-rules/{id}/toggleAPI key or session
POST/api/inbox-rules/reorderAPI key or session

Templates

A template saves settings to make inboxes from: a domain, an address to forward to and a webhook address kept with it. Pass its id as templateId when you create an inbox and its domain and forwarding are applied. Free accounts may save 3 templates, Pro 10 and Business 25. Forwarding in a template needs Pro or Business.

POST/v1/templatesrules:manage
FieldWhat it does
nameRequired, at most 100 characters.
domainA domain from GET /v1/domains, or null.
forward_toAn address to forward new inboxes' mail to, or null.
webhook_urlA webhook address kept with the template, or null.
is_defaultDefault false.
curl -X POST https://api.dissolve.email/v1/templates \
  -H "Authorization: Bearer $DISSOLVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Forwarded", "forward_to": "me@example.com", "is_default": true}'
JSON
{ "id": "tpl9Wm2QxK5rNc8Vz1LpT", "name": "Forwarded", "domain": null, "forwardTo": "me@example.com", "webhookUrl": null, "isDefault": true, "createdAt": "2026-11-19T10:00:00.000Z", "updatedAt": "2026-11-19T10:00:00.000Z" }
GET/v1/templatesinboxes:read DELETE/v1/templates/{id}rules:manage

Deleting a template leaves inboxes made from it as they are. Changing a template, and making one the default, take an API key or the signed-in app:

PATCH/api/inbox-templates/{id}API key or session
POST/api/inbox-templates/{id}/set-defaultAPI key or session

Something wrong or missing on this page? Tell us at support@dissolve.email.View as Markdown