Use cases → Email operations
Apply conditional forwarding rules via delegated automation
Set up and manage mailbox-specific forwarding logic based on message content, sender or other criteria using a service account.
| Who it is for | IT admins automating mailbox routing for teams or departments. |
|---|---|
| APIs | Gmail API |
| Typical scopes | gmail.modify |
The problem
Users need emails forwarded only when they match certain conditions, but manual filter management is error-prone and doesn’t scale. Delegated automation is required to apply and update rules across many mailboxes.
How it works
- Use a service account with domain-wide delegation and impersonate each target user.
- Fetch existing Gmail filters for the mailbox.
- Construct and insert new filters matching the required forwarding conditions.
- Remove or update filters as requirements change.
What changes
Conditional forwarding rules are consistent, centrally managed, and can be bulk-updated or revoked as policies evolve.
Questions people ask
Can I add a forwarding address with the API?
You can programmatically add a forwarding address, but the user must confirm it via an email link before it becomes usable for filters. Automation cannot bypass this confirmation.
How do I know if a forwarding filter was actually created?
Always fetch and verify the mailbox's filters after creation. Do not trust a 200 response alone; the filter list must include the new rule and reference the verified forwarding address.
Want this built?
This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.
Talk to us Or read the setup guideRelated use cases
Draft replies automatically in a shared inbox
A delegated service account reads an incoming enquiry, drafts a researched reply in the mailbox, and leaves it for a human to approve and send.
Triage and route inbound mail across a domain
Classify every inbound message, label it, and forward the ones that matter to the person who owns them — without touching a single mail rule.
Send mail as a shared alias from automation
Deliver notifications, confirmations and campaign replies from a branded address like support@ or updates@ without a human in the loop.