Modulify

Turn the email sending of a site on or off

toggle_site_emails

Turns email sending on or off for a site, keeping its address, settings, blocked list and history either way.

POST /v1/toggle_site_emailsScopeconfig:writeMakes changes

Sending is on by default for every site until somebody turns it off. While it is off, every send the site's own code attempts is refused there and then and nothing is queued, so those messages are lost rather than delayed, and a form or a receipt that depends on them quietly stops working. Nothing else changes: the sending address, the settings, the blocked list and the send history are all kept, and forwarding of mail sent to the site carries on either way.

Turning it on resumes sending with the same address and sends nothing by itself. It makes sure the site has its EMAIL_URL and EMAIL_PRIVATE_KEY values and hands them to the running preview at once, and the answer says when the live site still needs a publish before its email works.

Turning it on is refused when email sending is not set up on the platform, and when the site already has its own secret named EMAIL_URL or EMAIL_PRIVATE_KEY, which has to be renamed or deleted first. It is also refused when sending was turned off on its own because too many of the site's messages bounced or were marked as spam. Only you can turn it back on then, from the Emails tab, after cleaning up the recipient list, because turning it on again without that only has it turned off again and damages how every mailbox treats the site. See Turn sending off and on.

Request

Call it with a POST to https://api.modulify.ai/v1/toggle_site_emails, sending the inputs below as a JSON object. The token needs the config:write scope.

It makes changes, so send an Idempotency-Key header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

curl -X POST https://api.modulify.ai/v1/toggle_site_emails \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","enabled":true}'

Over MCP, the same method is the toggle_site_emails tool.

Inputs

Input Type Required Description
projectId string Yes The site id.
enabled boolean Yes True to turn sending 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.