Turn on Rabbitflare SMTP for a site
/v1/sites/{siteId}/smtp/actions/enable Turns Rabbitflare SMTP on: WordPress's own emails (password resets, new accounts, account changes, admin notices and order emails) are sent through Rabbitflare, from the address in from. Turning it on is included. Each site sends a number of emails a day included (limits); once the account has bought email credit in the panel, emails beyond the included ones are paid from it, and without credit they're refused (no_credit in recentEmails).
What happens next. The answer is 202 with status: "setting_up": the site's server is set up, usually within a minute. Poll GET /sites/{siteId}/smtp until status is on; failed comes with the reason in lastError (turn it on again to retry). On already: the answer is 200 as it is.
Limits. The site's server must be paid and running, not a free trial, and the account's email address confirmed (409 not_eligible; eligible says why); not for staging copies or sites still installing (409 site_unavailable). A stop on the site is lifted only as hold says (409 paused, checking or suspended). A site's first 14 days have lower limits. Up to 30 changes a minute.
The answer is the site's view, as GET /sites/{siteId}/smtp gives it to a token with sites:read. Without sites:read, it leaves out people's details: whom the site's recent emails went to (recentEmails and suggestedNoticeAddresses are empty), the sign-in addresses of the account's owner and team (addresses holds only the ones added to the site) and what the site sent (usage is null). Every call is written to the token's request log.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:write - Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Example request
curl -X POST "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
const data = await rf.sites.smtp.enable({ siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d" });
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import requests
response = requests.post(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/smtp/actions/enable",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
202 Accepted Returns the SiteSmtp object in data. It can also answer 200 OK.
The SiteSmtp object's fields 80 fields
| Field | Type and description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | string
Known values: | ||||||||||||||
enabled | boolean Whether it's turned on for the site, whatever stop | ||||||||||||||
blockedReason | string or null Why the site can't have Rabbitflare SMTP right now: a staging copy, a site still installing, or a server that's stopped or suspended. Null when it can. | ||||||||||||||
eligible | object Whether the account may use it for this site: a paid, running server (not a free trial) and a confirmed account email address. | ||||||||||||||
ok | boolean Whether the account may turn it on for this site. | ||||||||||||||
code | string or null Why not, as a code ( Known values: | ||||||||||||||
message | string or null Why not, in a sentence. Null when it may. | ||||||||||||||
lastError | string or null Why setting it up on the site's server, or removing it, didn't finish (with | ||||||||||||||
hold | object or null A stop on the site's emails: an automatic safety check, or Rabbitflare's team. Null when there's none. | ||||||||||||||
kind | string
Known values: | ||||||||||||||
reason | string Why, in a sentence. | ||||||||||||||
note | string What to do about it, in a sentence. | ||||||||||||||
heldAt | string or null An ISO 8601 time, in UTC When it was stopped. | ||||||||||||||
canResumeAt | string or null An ISO 8601 time, in UTC A first pause: when it may be turned on again ( | ||||||||||||||
canResume | boolean Whether it may be turned on again now. | ||||||||||||||
accountOff | object or null Set when the account's email is switched off for good (only support can lift it). Null otherwise. | ||||||||||||||
reason | string Why, in a sentence. | ||||||||||||||
offAt | string or null An ISO 8601 time, in UTC When it was switched off. | ||||||||||||||
wpMailReplaced | boolean Another plugin has replaced WordPress's wp_mail(), so the site's emails don't go through Rabbitflare SMTP. | ||||||||||||||
pluginCheck | object The site's server checks the plugin file every few minutes: nothing is sent while it's changed or unchecked. | ||||||||||||||
ok | boolean Whether the Rabbitflare SMTP plugin file on the site is the one Rabbitflare put there. | ||||||||||||||
checkedAt | string or null An ISO 8601 time, in UTC When the site's server last checked it. Null before the first check. | ||||||||||||||
firstOnAt | string or null An ISO 8601 time, in UTC When it was first turned on for the site. Null if never. | ||||||||||||||
newSiteEndsAt | string or null An ISO 8601 time, in UTC While the site is new to Rabbitflare SMTP (its first 14 days, with lower daily limits): when that ends. Null otherwise. | ||||||||||||||
from | string The sender the recipients see: the site's domain as the name, and the site's own sending address. | ||||||||||||||
replyTo | string or null The confirmed reply address the site's emails carry. Null when it has none. | ||||||||||||||
limits | object The limits in force. Times are rolling: 24 hours, not a calendar day. | ||||||||||||||
perSite10Min | integer Emails the site may send in 10 minutes. | ||||||||||||||
perSiteDay | integer Emails the site may send in 24 hours. | ||||||||||||||
perAccountDay | integer Emails all the account's sites may send in 24 hours. | ||||||||||||||
newRecipientsPerDay | integer Addresses the site has never emailed before that it may email in 24 hours. | ||||||||||||||
newSitePerDay | integer Emails a site may send in 24 hours while it's new to Rabbitflare SMTP (its first 14 days). | ||||||||||||||
newRecipientsPerDayFirst14 | integer New addresses a site may email in 24 hours in its first 14 days. | ||||||||||||||
perRecipientHour | integer Emails one address may be sent from the site in an hour. | ||||||||||||||
perRecipientDay | integer Emails one address may be sent from the site in 24 hours. | ||||||||||||||
noticePerSiteDay | integer Admin notices to confirmed addresses in 24 hours (their own allowance). | ||||||||||||||
noticeAddressesPerSite | integer Notice addresses a site may add. | ||||||||||||||
usage | object or null What the site sent, against its limits. Null if it was never turned on, and in a change's answer to a token without | ||||||||||||||
tenMinutes | object The site's emails in the last 10 minutes. Show its 2 fields
| ||||||||||||||
today | object The site's emails in the last 24 hours. Show its 2 fields
| ||||||||||||||
account | object or null All the account's sites' emails in the last 24 hours. Null for a token limited to some servers: it counts the sites on every server. Show its 2 fields
| ||||||||||||||
newRecipients | object New addresses the site emailed in the last 24 hours. Show its 2 fields
| ||||||||||||||
notices | object Admin notices to confirmed addresses in the last 24 hours. Show its 2 fields
| ||||||||||||||
refusedToday | integer Emails refused in the last 24 hours. | ||||||||||||||
paidToday | integer Emails paid from the account's email credit in the last 24 hours. | ||||||||||||||
days | array of objects The last 30 days, oldest first. Show its 6 fields
| ||||||||||||||
addresses | array of objects The account's own addresses first, then the ones added to the site. A token limited to some servers sees only the team members who can reach the site's server; a change's answer to a token without | ||||||||||||||
id | string The address's id. The account's own addresses have ids starting | ||||||||||||||
kind | string
Known values: | ||||||||||||||
address | string The email address. | ||||||||||||||
confirmed | boolean Whether its owner confirmed it from the link in the confirmation email. Only confirmed addresses are used. | ||||||||||||||
confirmationSentAt | string or null An ISO 8601 time, in UTC When the last confirmation email was sent to it. Null for the account's own addresses. | ||||||||||||||
source | string
Known values: | ||||||||||||||
suggestedNoticeAddresses | array of strings Addresses the site tried to send admin notices to in the last 30 days that aren't confirmed: add them to let notices through. Empty in a change's answer to a token without | ||||||||||||||
recentEmails | array of objects The site's latest emails, newest first. Empty in a change's answer to a token without | ||||||||||||||
id | string The email's id. | ||||||||||||||
sentAt | string An ISO 8601 time, in UTC When the site sent it. | ||||||||||||||
type | string or null What kind of email it is: Known values: | ||||||||||||||
to | string or null Who it was for (kept 30 days). Null when it was refused before it could be read. | ||||||||||||||
subject | string or null Its subject. Null when it was refused before it could be read. | ||||||||||||||
status | string What happened to it: Known values: | ||||||||||||||
code | string or null Why it wasn't sent, as a code ( Known values: | ||||||||||||||
reason | string or null Why it wasn't sent, in a sentence. Null when it was. | ||||||||||||||
paid | boolean Paid from the account's email credit: it was beyond the site's included emails. |
Example response
{
"data": {
"status": "setting_up",
"enabled": true,
"blockedReason": null,
"eligible": {
"ok": true,
"code": null,
"message": null
},
"lastError": null,
"hold": null,
"accountOff": null,
"wpMailReplaced": false,
"pluginCheck": {
"ok": false,
"checkedAt": null
},
"firstOnAt": "2026-11-19T10:12:05.000Z",
"newSiteEndsAt": "2026-12-03T10:12:05.000Z",
"from": "\"shop.example.com\" <[email protected]>",
"replyTo": null,
"limits": {
"perSite10Min": 5,
"perSiteDay": 50,
"perAccountDay": 150,
"newRecipientsPerDay": 15,
"newSitePerDay": 10,
"newRecipientsPerDayFirst14": 5,
"perRecipientHour": 3,
"perRecipientDay": 10,
"noticePerSiteDay": 10,
"noticeAddressesPerSite": 5
},
"usage": null,
"addresses": [
{
"id": "account:0b9f2c1e-6d3a-4f7e-9a51-2c8e4b7d1f60",
"kind": "notice",
"address": "[email protected]",
"confirmed": true,
"confirmationSentAt": null,
"source": "account"
}
],
"suggestedNoticeAddresses": [],
"recentEmails": []
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 site_ | The site isn't in a state that allows this (for example, it's still installing). Wait until the site is active, then try again. |
409 not_ | The account can't use Rabbitflare SMTP for this site: it needs a paid, running server (not a free trial) and a confirmed account email address. Read |
409 account_ | Rabbitflare SMTP is switched off for this account for good. Contact support. |
409 paused | Email from this site is paused, by an automatic safety check or by Rabbitflare's team. Read |
409 checking | The site's Rabbitflare SMTP plugin file is being checked, and its emails are stopped meanwhile. Try again in a few minutes: unless it was changed on purpose, it's checked and put back by itself. |
409 suspended | Email from this site is suspended. Contact support. |
409 temporary | Something couldn't be checked just now. Try again in a minute. |
409 server_ | The server is being restored, and nothing else can change it or its sites until that's done. Wait until the restore finishes (the server's |
429 rate_ | Too many requests. Wait for Retry-After seconds, then go on more slowly. |
503 apply_ | Rabbitflare SMTP couldn't be started on the site's server just now. Try again in a minute. |