<Intro>

<EndpointHeader />

<Description>

Returns a paginated list of the mailbox's receive rules, oldest first. Filter by action to see only allow or only block entries.

</Description>

</Intro>

<Parameters in="query">

<Parameter name="action" type="string">

<Description>

Filter by rule action.

</Description>

<Description>

Possible values: `allow`, `block`

</Description>

</Parameter>

<Parameter name="limit" type="integer">

<Description>

Maximum number of items to return per page.

</Description>

</Parameter>

<Parameter name="starting_after" type="string">

<Description>

Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.

</Description>

</Parameter>

<Parameter name="ending_before" type="string">

<Description>

Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.

</Description>

</Parameter>

</Parameters>

<Payload kind="response">

<Field name="data" type="array of object" required>

<FieldChildren kind="response">

<Field name="id" type="string" prefix="data." required>

<Description>

Receive rule ID.

</Description>

</Field>

<Field name="mailbox_id" type="string" prefix="data." required>

<Description>

The mailbox the rule applies to.

</Description>

</Field>

<Field name="action" type="string" prefix="data." required>

<Description>

What the rule does when it matches. Block rules always win — over allow rules and over the reply admission on allowlist mailboxes.

</Description>

<Description>

Possible values: `allow`, `block`

</Description>

</Field>

<Field name="entry" type="string" prefix="data." required>

<Description>

The sender address or domain the rule matches. Domains also match their subdomains.

</Description>

</Field>

<Field name="entry_type" type="string" prefix="data." required>

<Description>

Whether the entry is a full address or a domain.

</Description>

<Description>

Possible values: `address`, `domain`

</Description>

</Field>

<Field name="note" type="nullable string" prefix="data." required>

<Description>

Your own note about why the rule exists. Null when unset.

</Description>

</Field>

<Field name="created_at" type="string" prefix="data." required>

<Description>

When the rule was created.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="next_cursor" type="nullable string" required>

<Description>

Cursor for the next page. Pass back as `starting_after` to advance forward. Null when no next page exists.

</Description>

</Field>

<Field name="prev_cursor" type="nullable string" required>

<Description>

Cursor for the previous page. Pass back as `ending_before` to step backward. Null when no previous page exists.

</Description>

</Field>

<Field name="refresh_cursor" type="nullable string" required>

<Description>

Refresh anchor. Pass back as `ending_before` later to fetch items that have appeared since this response. Non-null whenever `data` is non-empty; null only on an empty page. Distinct from `prev_cursor`.

</Description>

</Field>

</Payload>