Create a forward rule
Create a forward rule on the inbox. The rule, its conditions, and its destinations are validated and saved together: if any part is invalid, nothing is created.
An inbox can have at most 5 forward rules; each rule can have at most 5 conditions and 5 destinations.
API token in Api-Token header
Inbound inbox ID
1Rule name. Must be unique within the inbox.
Copy billing mail to financeForward rule created
Unauthorized
Forbidden. The token lacks the permission required for this operation
(Access forbidden), has no access to the account
(Account access forbidden), or Email API/SMTP is not enabled for the
organization (empty response body).
Not found
Validation error. Errors on a condition or destination are keyed by
the request field and attribute (for example conditions.operator
or destinations.email); the per-inbox rule limit is reported under
base.
curl -X POST https://mailtrap.io/api/inbound/inboxes/{inbox_id}/forward_rules \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Copy billing mail to finance",
"conditions": [
{ "match_type": "sender", "operator": "ends_with", "value": "@billing.example.com" }
],
"destinations": [
{ "email": "finance@example.com" }
]
}'
{
"data": {
"id": 7,
"name": "Copy billing mail to finance",
"created_at": "2026-05-08T10:30:00.000Z",
"updated_at": "2026-05-08T10:30:00.000Z",
"conditions": [
{
"match_type": "sender",
"operator": "ends_with",
"value": "@billing.example.com",
"header_key": null
}
],
"destinations": [
{
"email": "finance@example.com"
}
]
}
}Last updated
Was this helpful?

