Turn the email forwarding of a site on or off
set_site_email_forwarding
Turns the forwarding of incoming mail on or off for a site, which is on by default for every site.
While it is on, mail sent to any address at the site's built-in sending domain, and at each of its email domains with receiving on, goes to the site's confirmed forwarding addresses (forwarding.recipients in get_site_email_settings).
While it is off, that mail is accepted and dropped without a bounce, mail still waiting to be forwarded is dropped too, and none of it is forwarded later, so the tool tells the client to confirm with you before turning it off. Turning it on is refused with Email forwarding is not set up on this server yet! while forwarding.available is false, and turning it off always works.
It needs the Delete projects permission. See Turn forwarding off and on.
Request
Call it with a POST to https://api.modulify.ai/v1/set_site_email_forwarding, sending the inputs below as a JSON object. The token needs the config:write scope.
This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an Idempotency-Key header whenever you might retry it.
curl -X POST https://api.modulify.ai/v1/set_site_email_forwarding \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID","enabled":true}'Over MCP, the same method is the set_site_email_forwarding tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
enabled |
boolean | Yes | True to turn forwarding on, false to turn it off. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.