Documentation
Sign inGet started

Create an inbound route

POST
/v1/email/inbound-routes
curl -X POST "https://us1.platform.bird.com/v1/email/inbound-routes" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "mail.acme.com",
    "match_type": "address",
    "match_value": "refunds",
    "action": "deliver_to_mailbox",
    "target_mailbox_id": "mbx_01krdgeqcxet5s7t44vh8rt9mg"
  }'
Creates a routing rule that delivers matching inbound mail on one of your domains to a mailbox, or drops it. Routes are evaluated in order, lowest priority first, and a mailbox's own address always matches ahead of any route you create. Mail that no route matches is still received as a plain received email. The domain must be one of your workspace's inbound-enabled domains. Some fields depend on each other, and that dependency is described on the field itself. Breaking one of those rules returns 422.
Request Payload
domain
string
required
The domain the route applies to. It has to be one of your inbound-enabled custom domains.
match_type
string
required
How the route matches recipients. address matches one local part and requires match_value. catch_all matches every recipient on the domain that nothing else matched.
Possible values: address, catch_all
match_value
string
The local part an address route matches. Required for address routes. Stored lowercase.
action
string
required
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.
Possible values: deliver_to_mailbox, drop
target_mailbox_id
string
The mailbox that receives matching mail. Required for deliver_to_mailbox routes.
priority
integer
The order routes are tried in, lowest number first. Your own routes take a priority from 11 to 1000. The mailbox's own address always matches at priority 10, so a route can never pre-empt exact-address delivery.
enabled
boolean
Whether the route is evaluated.
Response Payload
id
string
required
Inbound route ID.
domain
string
required
The domain the route applies to.
match_type
string
required
How the route matches recipients. address matches one local part. catch_all matches every recipient on the domain that nothing else matched.
Possible values: address, catch_all
match_value
nullable string
required
The local part an address route matches. Null for catch_all routes.
action
string
required
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.
Possible values: deliver_to_mailbox, drop
target_mailbox_id
nullable string
required
The mailbox that receives matching mail. Null for drop routes.
priority
integer
required
The order routes are tried in, lowest number first. Your own routes take a priority from 11 to 1000, and default to 100. A mailbox's own address always matches at priority 10.
enabled
boolean
required
Whether the route is evaluated. Disabled routes are kept but skipped.
created_at
string
required
When the route was created.
updated_at
string
required
When the route was last updated.