Microsoft: List rules
Microsoft meMailFolder.mailFoldersListMessageRules: arguments, response, policy and SDK examples.
← Me mail folder operations · Get started
Operation microsoft.me_mailfolders_listmessagerules
Provider route: GET /me/mailFolders/{mailFolder-id}/messageRules. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/microsoft with npm, or alter-sdk-microsoft with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { MicrosoftIntegration } from "@alter-ai/microsoft";
async function execute(input: Parameters<MicrosoftIntegration["meMailFolder"]["mailFoldersListMessageRules"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new MicrosoftIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.meMailFolder.mailFoldersListMessageRules(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_microsoft import MicrosoftIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = MicrosoftIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.me_mail_folder.mail_folders_list_message_rules(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.mailFolder-id | string | Required within parent | |
query | Model | Optional | Expand List rules — request body — query |
Referenced models: List rules — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand List rules — response body |
Referenced models: List rules — response body
Schemas
Section titled “Schemas”4 more schemas are linked from the tables above, on the schema pages.
List rules — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
$ (allOf 1) | Model | All variants apply | Expand List rules — response body — @odata count, @odata next Link |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).value | array | Optional | |
$ (allOf 2).value[] | Model | Each item | Expand Get rule — response body |
Referenced models: List rules — response body — @odata count, @odata next Link, Get rule — response body
List rules — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
$top | integer | Optional | Minimum: 0 |
$skip | integer | Optional | Minimum: 0 |
$search | string | Optional | |
$filter | string | Optional | |
$count | boolean | Optional | |
$orderby | array | Optional | Unique items: true |
$orderby[] | string | Each item | |
$select | array | Optional | Unique items: true |
$select[] | string | Each item | |
$expand | array | Optional | Unique items: true |
$expand[] | string | Each item | |
$skiptoken | string | Optional |
List rules — response body — @odata count, @odata next Link
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
@odata.count | JSON | Optional | |
@odata.count (anyOf 1) | JSON | Alternative | |
@odata.count (anyOf 1) (anyOf 1) | integer | Alternative | Format: int64 |
@odata.count (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
@odata.count (anyOf 2) | null | Alternative | |
@odata.nextLink | JSON | Optional | |
@odata.nextLink (anyOf 1) | string | Alternative | |
@odata.nextLink (anyOf 2) | null | Alternative |
Get rule — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get rule — response body — @odata type, id |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).@odata.type | string | Optional | |
$ (allOf 2).actions | JSON | Optional | Actions to be taken on a message when the corresponding conditions are fulfilled. |
$ (allOf 2).actions (anyOf 1) | Model | Alternative | Expand Get rule — response body — @odata type, actions, conditions, display Name, exceptions, has Error, is Enabled, is Read Only, sequence actions @odata type, assign Categories, copy To Folder, delete, forward As Attachment To, forward To, mark As Read, mark Importance, move To Folder, permanent Delete, redirect To, stop Processing Rules |
$ (allOf 2).actions (anyOf 2) | JSON | Alternative | |
$ (allOf 2).actions (anyOf 2) (anyOf 1) | object | Alternative | |
$ (allOf 2).actions (anyOf 2) (anyOf 2) | null | Alternative | |
$ (allOf 2).conditions | JSON | Optional | Conditions that when fulfilled trigger the corresponding actions for that rule. |
$ (allOf 2).conditions (anyOf 1) | Model | Alternative | Expand Get rule — response body — @odata type, actions, conditions, display Name, exceptions, has Error, is Enabled, is Read Only, sequence conditions @odata type, body Contains, body Or Subject Contains, categories, from Addresses, has Attachments, header Contains, importance, is Approval Request, is Automatic Forward, is Automatic Reply, is Encrypted, is Meeting Request, is Meeting Response, is Non Delivery Report, is Permission Controlled, is Read Receipt, is Signed, is Voicemail, message Action Flag, not Sent To Me, recipient Contains, sender Contains, sensitivity, sent Cc Me, sent Only To Me, sent To Addresses, sent To Me, sent To Or Cc Me, subject Contains, within Size Range |
$ (allOf 2).conditions (anyOf 2) | JSON | Alternative | |
$ (allOf 2).conditions (anyOf 2) (anyOf 1) | object | Alternative | |
$ (allOf 2).conditions (anyOf 2) (anyOf 2) | null | Alternative | |
$ (allOf 2).displayName | JSON | Optional | |
$ (allOf 2).displayName (anyOf 1) | string | Alternative | The display name of the rule. |
$ (allOf 2).displayName (anyOf 2) | null | Alternative | |
$ (allOf 2).exceptions | JSON | Optional | Exception conditions for the rule. |
$ (allOf 2).exceptions (anyOf 1) | Model | Alternative | Expand Get rule — response body — @odata type, actions, conditions, display Name, exceptions, has Error, is Enabled, is Read Only, sequence conditions @odata type, body Contains, body Or Subject Contains, categories, from Addresses, has Attachments, header Contains, importance, is Approval Request, is Automatic Forward, is Automatic Reply, is Encrypted, is Meeting Request, is Meeting Response, is Non Delivery Report, is Permission Controlled, is Read Receipt, is Signed, is Voicemail, message Action Flag, not Sent To Me, recipient Contains, sender Contains, sensitivity, sent Cc Me, sent Only To Me, sent To Addresses, sent To Me, sent To Or Cc Me, subject Contains, within Size Range |
$ (allOf 2).exceptions (anyOf 2) | JSON | Alternative | |
$ (allOf 2).exceptions (anyOf 2) (anyOf 1) | object | Alternative | |
$ (allOf 2).exceptions (anyOf 2) (anyOf 2) | null | Alternative | |
$ (allOf 2).hasError | JSON | Optional | |
$ (allOf 2).hasError (anyOf 1) | boolean | Alternative | Indicates whether the rule is in an error condition. Read-only. |
$ (allOf 2).hasError (anyOf 2) | null | Alternative | |
$ (allOf 2).isEnabled | JSON | Optional | |
$ (allOf 2).isEnabled (anyOf 1) | boolean | Alternative | Indicates whether the rule is enabled to be applied to messages. |
$ (allOf 2).isEnabled (anyOf 2) | null | Alternative | |
$ (allOf 2).isReadOnly | JSON | Optional | |
$ (allOf 2).isReadOnly (anyOf 1) | boolean | Alternative | Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. |
$ (allOf 2).isReadOnly (anyOf 2) | null | Alternative | |
$ (allOf 2).sequence | JSON | Optional | |
$ (allOf 2).sequence (anyOf 1) | JSON | Alternative | |
$ (allOf 2).sequence (anyOf 1) (anyOf 1) | number | Alternative | Indicates the order in which the rule is executed, among other rules. Format: int32 Maximum: 2147483647 Minimum: -2147483648 |
$ (allOf 2).sequence (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (allOf 2).sequence (anyOf 2) | null | Alternative |
Referenced models: Get rule — response body — @odata type, id, Get rule — response body — @odata type, actions, conditions, display Name, exceptions, has Error, is Enabled, is Read Only, sequence actions @odata type, assign Categories, copy To Folder, delete, forward As Attachment To, forward To, mark As Read, mark Importance, move To Folder, permanent Delete, redirect To, stop Processing Rules, Get rule — response body — @odata type, actions, conditions, display Name, exceptions, has Error, is Enabled, is Read Only, sequence conditions @odata type, body Contains, body Or Subject Contains, categories, from Addresses, has Attachments, header Contains, importance, is Approval Request, is Automatic Forward, is Automatic Reply, is Encrypted, is Meeting Request, is Meeting Response, is Non Delivery Report, is Permission Controlled, is Read Receipt, is Signed, is Voicemail, message Action Flag, not Sent To Me, recipient Contains, sender Contains, sensitivity, sent Cc Me, sent Only To Me, sent To Addresses, sent To Me, sent To Or Cc Me, subject Contains, within Size Range
Invoke action forward — me Event events Forward — request body — body To Recipients item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | discriminator: {"mapping": {"#microsoft.graph.attendee": "#/components/schemas/microsoft.graph.attendee", "#microsoft.graph.attendeeBase": "#/components/schemas/microsoft.graph.attendeeBase"}, "propertyName": "@odata.type"} |
@odata.type | string | Optional | |
emailAddress | JSON | Optional | The recipient's email address. |
emailAddress (anyOf 1) | Model | Alternative | Expand Get calendar Permission — response body — @odata type, allowed Roles, email Address, is Inside Organization, is Removable, role email Address @odata type, address, name |
emailAddress (anyOf 2) | JSON | Alternative | |
emailAddress (anyOf 2) (anyOf 1) | object | Alternative | |
emailAddress (anyOf 2) (anyOf 2) | null | Alternative |
Referenced models: Get calendar Permission — response body — @odata type, allowed Roles, email Address, is Inside Organization, is Removable, role email Address @odata type, address, name
Get calendar Permission — response body — @odata type, allowed Roles, email Address, is Inside Organization, is Removable, role email Address @odata type, address, name
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
@odata.type | string | Optional | |
address | JSON | Optional | |
address (anyOf 1) | string | Alternative | The email address of the person or entity. |
address (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The display name of the person or entity. |
name (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: microsoft.me_mailfolders_listmessagerules. Catalog operation: me_mailfolders_listmessagerules. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.