API reference
Rules API
Forward, label or delete new mail by sender or subject. Every rules endpoint with its scope, parameters, body and an example answer.
Base URL https://api.dissolve.email. Send an API key or OAuth access token as Authorization: Bearer <token> (Authentication); an OAuth token needs the scope on each endpoint. Errors follow one shape.
| Endpoint | Summary |
|---|---|
GET /v1/rules | List rules |
POST /v1/rules | Create a rule |
GET /v1/rules/{id} | Get a rule |
PATCH /v1/rules/{id} | Change a rule |
DELETE /v1/rules/{id} | Delete a rule |
List rules
/v1/rulesrules:managePro and upYour inbox rules, highest priority first, with how many your plan allows (Pro 10, Business 50).
curl "https://api.dissolve.email/v1/rules" \
-H "Authorization: Bearer $DISSOLVE_API_KEY"import { Dissolve } from '@dissolve-email/sdk';
const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.listRules();import os, requests
API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.get("https://api.dissolve.email/v1/rules", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())Response 200
{
"rules": [
{
"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"
}
],
"limit": 10,
"used": 1
}Create a rule
/v1/rulesrules:managePro and upA rule runs on every new message in your inboxes: when the sender or subject matches its glob pattern (* any run of characters, ? one character, case ignored), it forwards, labels or deletes the message. At least one pattern is needed.
Body (application/json)
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | What the rule is for. At most 100 characters. |
from_pattern | string or null | no | Glob matched against the sender address, such as *@github.com. At most 200 characters. |
subject_pattern | string or null | no | Glob matched against the subject, such as receipt. At most 200 characters. |
action | string | yes | What to do with a match. One of forward, delete, label. |
action_value | string or null | no | The address to forward to, or the label name to apply. At most 255 characters. |
enabled | boolean | no | Whether it runs. Default true. |
priority | integer | no | Higher runs first. Default 0. 0 to 100. |
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"}'import { Dissolve } from '@dissolve-email/sdk';
const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.createRule({
name: "Label receipts",
subject_pattern: "*receipt*",
action: "label",
action_value: "Receipts"
});import os, requests
API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.post("https://api.dissolve.email/v1/rules", json={
"name": "Label receipts",
"subject_pattern": "*receipt*",
"action": "label",
"action_value": "Receipts"
}, headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())Response 201
{
"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"
}Get a rule
/v1/rules/{id}rules:managePro and upOne rule.
Path parameters
| Name | Description |
|---|---|
id | The rule id. |
curl "https://api.dissolve.email/v1/rules/$RULE_ID" \
-H "Authorization: Bearer $DISSOLVE_API_KEY"import { Dissolve } from '@dissolve-email/sdk';
const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.getRule(ruleId);import os, requests
API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.get(f"https://api.dissolve.email/v1/rules/{rule_id}", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())Response 200
{
"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"
}Change a rule
/v1/rules/{id}rules:managePro and upChanges any field; the rule is checked again as a whole.
Path parameters
| Name | Description |
|---|---|
id | The rule id. |
Body (application/json)
| Name | Type | Required | Description |
|---|---|---|---|
name | string | no | What the rule is for. At most 100 characters. |
from_pattern | string or null | no | Sender glob, or null. |
subject_pattern | string or null | no | Subject glob, or null. |
action | string | no | What to do with a match. One of forward, delete, label. |
action_value | string or null | no | Forward address or label name. |
enabled | boolean | no | Whether it runs. |
priority | integer | no | Higher runs first. 0 to 100. |
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}'import { Dissolve } from '@dissolve-email/sdk';
const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.updateRule(ruleId, {
enabled: false
});import os, requests
API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.patch(f"https://api.dissolve.email/v1/rules/{rule_id}", json={
"enabled": False
}, headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())Response 200
{
"success": true
}Delete a rule
/v1/rules/{id}rules:managePro and upDeletes the rule.
Path parameters
| Name | Description |
|---|---|
id | The rule id. |
curl -X DELETE "https://api.dissolve.email/v1/rules/$RULE_ID" \
-H "Authorization: Bearer $DISSOLVE_API_KEY"import { Dissolve } from '@dissolve-email/sdk';
const client = new Dissolve(); // reads DISSOLVE_API_KEY
const result = await client.v1.deleteRule(ruleId);import os, requests
API_KEY = os.environ["DISSOLVE_API_KEY"]
response = requests.delete(f"https://api.dissolve.email/v1/rules/{rule_id}", headers={"Authorization": f"Bearer {API_KEY}"})
print(response.json())Response 200
{
"success": true
}Something wrong or missing on this page? Tell us at support@dissolve.email.View as Markdown