- API reference
- Rules
- List rules
https://api.us.nylas.com/v3/rulesList rules
Returns a list of all rules for your application.
Query parameters
The maximum number of objects to return. See Pagination for more information.
50"c1d2e3f4-5678-4abc-9def-0123456789ab""Rejects messages from known spam domains at the SMTP level."priorityintegerExecution order for the rule. Lower numbers run first. Must be between 0 and 1000. Defaults to 10.
101triggerstringWhen the rule is evaluated. inbound rules run on incoming messages. outbound rules run on sends
before the message is submitted to the email provider — an outbound rule with a block action
rejects the send with HTTP 403 and no message is delivered. Non-blocking actions (mark_as_spam,
archive, mark_as_read, mark_as_starred, assign_to_folder, trash) on outbound rules apply
to the stored sent copy. Inbound and outbound rules are isolated: inbound rules never run during sends, and
outbound rules never run on receipt.
"inbound""inbound"operatorstringHow conditions are combined. Use any to match when any condition is true (OR), or all to
require every condition to be true (AND). When omitted, the rule defaults to all.
"any"fieldstringThe field to match against. from.* fields match the normalized sender and are valid on
both triggers: from.address is the full sender email, from.domain is the domain
portion, and from.tld is the top-level domain. recipient.* fields are valid only on
outbound rules and match against any recipient — including To, CC, BCC, and SMTP
envelope recipients. For is_not, the condition is true only when no recipient
matches. outbound.type is valid only on outbound rules and classifies the send as
compose (a fresh message) or reply (a reply to an existing thread). The type is
derived as reply when the send includes reply_to_message_id or the raw MIME
contains In-Reply-To or References headers; otherwise it's compose.
"from.domain"operatorstringHow to compare the field value. Use is for an exact match, is_not for the inverse,
contains for substring matching, or in_list to check against one or more List
resources. String matching is case-insensitive. The outbound.type field accepts only
is and is_not — contains and in_list are rejected.
"is"actionsarray<object>The actions to perform when the rule matches. At least one action is required. The block action cannot be
combined with other actions — it is terminal.
typestringThe action to take on the matching message or send. block rejects inbound mail at the SMTP
level or rejects an outbound send before provider submission. mark_as_spam routes the
message or stored sent copy to the spam folder, assign_to_folder files it in the folder
named in value, and the remaining actions modify the message state.
"block"valuestringRequired when type is assign_to_folder — the target folder by name. Use a custom folder's
name (or its full path for a nested folder, e.g. Clients/Acme), or a system folder name
(Inbox, Sent, Drafts, Trash, Junk, Archive). The name is resolved when the rule
runs, so a reference to a folder that doesn't exist is skipped. Optional for other action types.
"Receipts"application_idstringThe ID of the application that owns the rule. Read-only; derived from the authenticated API key.
"ad410018-d306-43f9-8361-fa5d7b2172e0"organization_idstringThe ID of the Nylas organization that owns the rule. Read-only; derived from the authenticated API key.
"org-abc123"1742932766Rate limited. The provider or Nylas throttled the request. If a provider throttles a read and
says how long to wait, the Retry-After header gives that number of seconds. When the header
is missing, retry with exponential backoff. See
429 rate limit errors by provider.