For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a forward rule

Partially update a forward rule. Only the fields present in the request are changed:

  • name renames the rule.

  • conditions, when present, replaces the whole condition set. An empty array removes every condition, so the rule matches all messages.

  • destinations, when present, replaces the whole destination set.

Omitted fields are left unchanged. The update is applied atomically: if any part is invalid, the rule is left as it was.

patch
Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
inbox_idintegerRequired

Inbound inbox ID

Example: 1
idintegerRequired

Forward rule ID

Example: 7
Body

All fields are optional. A present conditions or destinations array replaces the whole set; an omitted one is left unchanged.

namestring · max: 100Optional

Rule name. Must be unique within the inbox.

Example: Copy billing mail to finance
Responses
200

Forward rule updated

application/json
patch/api/inbound/inboxes/{inbox_id}/forward_rules/{id}
curl -X PATCH https://mailtrap.io/api/inbound/inboxes/{inbox_id}/forward_rules/{id} \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "destinations": [
      { "email": "finance@example.com" },
      { "email": "accounting@example.com" }
    ]
  }'
{
  "data": {
    "id": 7,
    "name": "Copy billing mail to finance",
    "created_at": "2026-05-08T10:30:00.000Z",
    "updated_at": "2026-05-08T12:15:00.000Z",
    "conditions": [
      {
        "match_type": "sender",
        "operator": "ends_with",
        "value": "@billing.example.com",
        "header_key": null
      }
    ],
    "destinations": [
      {
        "email": "finance@example.com"
      },
      {
        "email": "accounting@example.com"
      }
    ]
  }
}

Last updated

Was this helpful?