<Intro>

<EndpointHeader />

<Description>

Updates an inbound route. Omitted fields are unchanged; the `domain` is immutable. Cross-field rules are validated against the merged result, so an update that leaves the route inconsistent (such as `deliver_to_mailbox` without a target mailbox) returns `422`. Disabled routes are kept but skipped during evaluation.

</Description>

</Intro>

<Payload kind="request">

<Field name="match_type" type="string">

<Description>

How the route matches recipients.

</Description>

<Description>

Possible values: `address`, `catch_all`

</Description>

</Field>

<Field name="match_value" type="nullable string">

<Description>

The local part an `address` route matches. Null for `catch_all` routes.

</Description>

</Field>

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

<Description>

What happens to matching mail. `deliver_to_mailbox` delivers it to `target_mailbox_id` (required); `drop` discards it silently, with nothing stored and no webhook fired.

</Description>

<Description>

Possible values: `deliver_to_mailbox`, `drop`

</Description>

</Field>

<Field name="target_mailbox_id" type="nullable string">

<Description>

The mailbox that receives matching mail. Null for `drop` routes.

</Description>

</Field>

<Field name="priority" type="integer">

<Description>

Evaluation order — lowest number wins. Explicit routes accept 11–1000; the mailbox's own address always matches at priority 10.

</Description>

</Field>

<Field name="enabled" type="boolean">

<Description>

Whether the route is evaluated.

</Description>

</Field>

</Payload>

<Payload kind="response">

<Field name="id" type="string" required>

<Description>

Inbound route ID.

</Description>

</Field>

<Field name="domain" type="string" required>

<Description>

The domain the route applies to.

</Description>

</Field>

<Field name="match_type" type="string" required>

<Description>

How the route matches recipients. `address` matches one local part; `catch_all` matches every recipient on the domain that nothing else matched.

</Description>

<Description>

Possible values: `address`, `catch_all`

</Description>

</Field>

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

<Description>

The local part an `address` route matches. Null for `catch_all` routes.

</Description>

</Field>

<Field name="action" type="string" required>

<Description>

What happens to matching mail. `deliver_to_mailbox` delivers it to `target_mailbox_id`; `drop` discards it silently, with nothing stored and no webhook fired.

</Description>

<Description>

Possible values: `deliver_to_mailbox`, `drop`

</Description>

</Field>

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

<Description>

The mailbox that receives matching mail. Null for `drop` routes.

</Description>

</Field>

<Field name="priority" type="integer" required>

<Description>

Evaluation order — lowest number wins. Explicit routes accept 11–1000 (default 100); the mailbox's own address always matches at priority 10.

</Description>

</Field>

<Field name="enabled" type="boolean" required>

<Description>

Whether the route is evaluated. Disabled routes are kept but skipped.

</Description>

</Field>

<Field name="created_at" type="string" required>

<Description>

When the route was created.

</Description>

</Field>

<Field name="updated_at" type="string" required>

<Description>

When the route was last updated.

</Description>

</Field>

</Payload>