Switch Inbox Insights on or off for a sending domain
PATCH
/v1/email/inbox-insights/domains/{sending_domain}
// Requires Insights preview access for the organization.
let sendingDomain: string | undefined;
for await (const domain of bird.email.inboxInsights.domains.list({ search: "mail.example.com" })) {
if (domain.domain === "mail.example.com") { sendingDomain = domain.domain; break; }
}
if (!sendingDomain) throw new Error("Verify mail.example.com in this workspace first");
const report = await bird.email.inboxInsights.domains.update(sendingDomain, { monitored: false });
console.log(report.monitored);# Requires Insights preview access for the organization.
sending_domain = None
for domain in client.email.inbox_insights.domains.list(search="mail.example.com"):
if domain.domain == "mail.example.com":
sending_domain = domain.domain
break
if sending_domain is None:
raise ValueError("Verify mail.example.com in this workspace first")
report = client.email.inbox_insights.domains.update(sending_domain, monitored=False)
print(report.monitored)// Requires Insights preview access for the organization.
client, err := bird.NewClient(option.WithAPIKey(os.Getenv("BIRD_API_KEY")))
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
sendingDomain := ""
for domain, err := range client.Email.InboxInsights.Domains.List(ctx, bird.EmailInboxInsightsDomainsListParams{Search: "mail.example.com"}) {
if err != nil {
log.Fatal(err)
}
if domain.Domain != nil && *domain.Domain == "mail.example.com" {
sendingDomain = *domain.Domain
break
}
}
if sendingDomain == "" {
log.Fatal("Verify mail.example.com in this workspace first")
}
report, err := client.Email.InboxInsights.Domains.Update(ctx, sendingDomain, bird.EmailInboxInsightsDomainsUpdateParams{Monitored: bird.Bool(false)})
if err != nil {
log.Fatal(err)
}
encoded, err := json.MarshalIndent(report, "", " ")
if err != nil {
log.Fatal(err)
}
fmt.Println(string(encoded))// Requires Insights preview access for the organization.
$sendingDomain = null;
foreach ($bird->email->inboxInsights->domains->list(['search' => 'mail.example.com']) as $domain) {
if ($domain->getDomain() === 'mail.example.com') {
$sendingDomain = $domain->getDomain();
break;
}
}
if ($sendingDomain === null) {
throw new \RuntimeException('Verify mail.example.com in this workspace first');
}
$params = (new \MessageBird\Wire\Model\EmailInboxInsightsDomainUpdate())->setMonitored(false);
$report = $bird->email->inboxInsights->domains->update($sendingDomain, $params);
var_dump($report->getMonitored());bird email inbox-insights domains update <sending-domain> \
--monitored=truecurl -X PATCH "https://us1.platform.bird.com/v1/email/inbox-insights/domains/{sending_domain}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"monitored": true
}'Réponse200
{
"domain": "mail.acme.com",
"monitored": true
}
Changes the workspace's monitoring preference for one of its verified sending
domains. Enabling enrolls the domain with eDataSource before saving the preference.
Disabling removes the preference without removing vendor enrollment or history.
Report reads remain available for verified owned domains regardless of this setting.
A domain switched on for the first time has to be measured before it has
anything to report, so its results start empty and fill in as its mail is
seen. Switching off keeps everything measured so far: switching the domain
back on restores it in full and takes effect immediately, rather than starting
the domain over.
Setting the value it already has changes nothing and answers normally, so this
is safe to repeat.
API-key and service-account calls require Insights preview access for your organization.
Paramètres
sending_domain
string
The sending domain to change, exactly as it appears in your sending domains. A domain that is not verified in this workspace answers not-found.
Corps de la requête
monitored
boolean
obligatoire
Whether the workspace wants this domain monitored. Enabling enrolls it with eDataSource; disabling removes only the workspace preference and preserves vendor enrollment and measurement history. Verified ownership governs report access.
Contenu de la réponse
domain
string
obligatoire
The sending domain, lowercased, as it appears in your sending domains.
monitored
boolean
obligatoire
Whether Inbox Insights reports on this domain. Switching it off stops the reporting and keeps the measurement history, so switching it back on restores the full history rather than starting again.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet. Les ressources sont en anglais.
Comprendre le conceptShould I use a Bird SDK or call the API directly?Suivre le parcours d'apprentissageBuild your first integrationGuide d'implémentationSend your first email
Obtenir un guide d'implémentation