- API reference
- Rules
- List rule evaluations
https://api.us.nylas.com/v3/grants/{grant_id}/rule-evaluationsList rule evaluations
Returns the most recent rule evaluation records for the specified grant, up to limit records. Each record captures
which rules were evaluated against an inbound message, SMTP envelope, or outbound send, the
normalized sender or recipient data that was matched, which rules matched, and which actions were
applied.
Rule evaluations are created automatically when at least one rule matches as inbound mail is processed or an outbound send is evaluated, and serve as an audit trail for the Rules engine. Records are returned in reverse chronological order (most recent first).
Works with an API key or an IAM API key with the rule_evaluations.read permission.
"f47ac10b-58cc-4372-a567-0e02b2c3d479""41009df5-bf11-4c97-aa18-b285b5f2e386"message_idstringThe inbound message or stored sent copy associated with this evaluation (UUID). Omitted when no
message record exists: for smtp_rcpt evaluations, when an inbound message was blocked, and when
an outbound send was blocked before storage or no sent copy was stored.
"e8b5a51d-3c2f-4a1e-9d7b-6f8c2e1a4b3d"1713000000evaluation_stagestringWhere in the processing pipeline the evaluation happened. smtp_rcpt means the evaluation ran
during SMTP RCPT TO processing (before the message was accepted), and message_id is omitted in
this case. inbox_processing means the evaluation ran after the message was accepted and
during inbox processing, and message_id is present unless the message was blocked.
outbound_send means the evaluation ran for an outbound send; message_id is present when a
sent copy was stored, and omitted when the send was blocked before storage or no sent copy was
stored.
"inbox_processing"evaluation_inputobjectThe normalized sender, recipient, and send-type data that rules were matched against.
applied_actionsobjectThe actions that were applied as a result of matching rules. For inbox_processing and smtp_rcpt
records, blocked, marked_as_spam, marked_as_read, marked_starred, archived, and trashed
are always present as true or false. For outbound_send records, only the actions that were
applied are present, as true.
truematched_rule_idsarray<string>IDs of the rules that matched during this evaluation. A record is created only when at least one
rule matched. When applied_actions.blocked_by_evaluation_error is true, this lists the rules
that could not be evaluated.
["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]application_idstringThe application this evaluation belongs to (UUID). Read-only; derived from the authenticated API key.
"5f37fe8d-c4ba-4898-bc18-aad5bb34735e"organization_idstringThe Nylas organization this evaluation belongs to (UUID). Read-only; derived from the authenticated API key.
"9a8b7c6d-5e4f-3a2b-1c0d-ef9876543210"Rate limited. The provider or Nylas throttled the request. If a provider throttles a request 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.