Nylas Rules API

The Rules endpoints let you define automated filtering and routing logic for Nylas Agent Accounts. Each rule specifies a `trigger` (`inbound` or `outbound`), matching conditions, and actions to perform when those conditions are met. **Inbound rules** run when mail arrives. Conditions match the sender — `from.address`, `from.domain`, or `from.tld`. Actions include blocking the message at the SMTP level, marking as spam, assigning to a folder, marking as read or starred, archiving, and trashing. **Outbound rules** run before a send is submitted to the email provider. Conditions can match sender data (`from.address`, `from.domain`, `from.tld`), recipient data (`recipient.address`, `recipient.domain`, `recipient.tld`), or the send type via `outbound.type` (`compose` for new messages, `reply` for replies). A `block` action on an outbound rule rejects the send with HTTP 403 before it reaches the provider, so no message is delivered and no sent copy is stored. Non-blocking actions (`mark_as_spam`, `archive`, `mark_as_read`, `mark_as_starred`, `assign_to_folder`, `trash`) apply to the stored sent copy. `recipient.*` fields match against **any** recipient — including To, CC, BCC, and SMTP envelope recipients. Inbound and outbound rules are isolated. Inbound rules never run during sends, and outbound rules never run on message receipt, so stored sent copies aren't re-evaluated against inbound rules. Rules are evaluated in priority order (lower numbers first). Inbound rules are applied through the recipient grant's policy. Outbound rules are currently evaluated from the sending application's enabled outbound rules. The `block` action is terminal and cannot be combined with other actions. Rules support the `in_list` condition operator, which checks field values against Lists (managed via the Lists API) for dynamic, maintainable allow and block lists. `in_list` works for `from.*` and `recipient.*` fields but not for `outbound.type`, which accepts only `is` and `is_not`. Rule executions are audited per grant. List evaluation records with `GET /v3/grants/{grant_id}/rule-evaluations` to see which inbound or outbound rules ran, what normalized input was considered, and which actions were applied.

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v3/rules Create an inbound or outbound email rule · Create a rule #
Ask an LLM
“Can I automatically act on incoming mail from a particular sender domain?”
“How do I set up a rule that runs on outbound sends before they reach the provider?”
Tell an agent
Create a rule {name} matching {match} that applies {actions}.
Add an {trigger} rule named {name} with conditions {match} and actions {actions}.
GET /v3/rules List my application's email rules · List rules #
Ask an LLM
“Which inbound and outbound email rules are defined for my app?”
“How do I page through all of my rules?”
Tell an agent
List all email rules.
Show the first {limit} rules.
GET /v3/rules/{rule_id} Retrieve one email rule · Get a rule #
Ask an LLM
“How can I see the conditions and actions of a specific rule?”
“Can I look up a rule by its ID?”
Tell an agent
Get rule {rule_id}.
Show the conditions and actions of rule {rule_id}.
PUT /v3/rules/{rule_id} Edit or disable an email rule · Update a rule #
Ask an LLM
“Can I temporarily turn off a rule without deleting it?”
“Is it possible to change a rule's priority?”
Tell an agent
Disable rule {rule_id}.
Set the priority of rule {rule_id} to {priority}.
DELETE /v3/rules/{rule_id} Delete an email rule · Delete a rule #
Ask an LLM
“What happens to policies that reference a rule after I delete it?”
“How do I permanently remove a rule?”
Tell an agent destructive · confirm first
Delete rule {rule_id}.
Permanently remove email rule {rule_id}.
GET /v3/grants/{grant_id}/rule-evaluations See which rules ran on a user's mail · List rule evaluations #
Ask an LLM
“How can I audit which rules were evaluated against a user's incoming messages?”
“Can I see the outcome of rule checks on a specific grant's sends?”
Tell an agent
List rule evaluations for grant {grant_id}.
Show the latest {limit} rule evaluation records for mailbox {grant_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nylas:nylas-rules-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nylas-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nylas Rules API
  version: v3
  summary: The complete Nylas v3 API — Email, Calendar, Contacts, Notetaker, Scheduling, Administration, and Migration.
  description: The Nylas API is designed using the REST ideology to provide simple and predictable URIs to access and modify objects. Requests support standard HTTP methods like `GET`, `PUT`, `POST`, and `DELETE`, and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. You can use the Nylas Postman collection to quickly start using the Nylas APIs. For more information, check out the Nylas Postman collection documentation.
  contact:
    url: https://www.nylas.com/
servers:
- url: https://api.us.nylas.com
  description: U.S.
- url: https://api.eu.nylas.com
  description: E.U.
security:
- ACCESS_TOKEN: []
- NYLAS_API_KEY: []
tags:


# --- truncated at 32 KB (48 KB total) ---
# Full source: https://artifacts.apis.io/nylas/openapi/nylas-rules-api-openapi.yml