import { MailChannels } from "mailchannels-sdk";const { MAILCHANNELS_API_KEY, DOMAIN, CURRENT_SELECTOR, NEW_SELECTOR } = process.env;if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");if (!DOMAIN) throw new Error("Set DOMAIN (the sending domain, e.g. example.com)");if (!CURRENT_SELECTOR) throw new Error("Set CURRENT_SELECTOR (the active key to rotate out)");if (!NEW_SELECTOR) throw new Error("Set NEW_SELECTOR (the selector for the new active key)");const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);const { data, error } = await mailchannels.domains.dkim.rotate(DOMAIN, CURRENT_SELECTOR, { newKey: { selector: NEW_SELECTOR },});if (error) { console.error("Rotate DKIM key failed:", error); process.exit(1);}console.log(data);
import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY before running")
domain = os.environ.get("DOMAIN")
current_selector = os.environ.get("CURRENT_SELECTOR")
new_selector = os.environ.get("NEW_SELECTOR")
if not domain:
sys.exit("Set DOMAIN (the sending domain, e.g. example.com)")
if not current_selector:
sys.exit("Set CURRENT_SELECTOR (the active key to rotate out)")
if not new_selector:
sys.exit("Set NEW_SELECTOR (the selector for the new active key)")
response = mailchannels.Dkim.rotate(
domain,
current_selector,
new_selector=new_selector,
)
print(response)
<?php
require_once __DIR__ . '/vendor/autoload.php';
use MailChannels\Client;
$api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error: MAILCHANNELS_API_KEY is not set\n");
$domain = getenv('DOMAIN') or exit("Error: DOMAIN is not set\n");
$current_selector = getenv('CURRENT_SELECTOR') or exit("Error: CURRENT_SELECTOR is not set\n");
$new_selector = getenv('NEW_SELECTOR') or exit("Error: NEW_SELECTOR is not set\n");
$client = new Client(apiKey: $api_key);
$response = $client->dkim->rotate($domain, $current_selector, $new_selector);
print_r($response->toArray());
Rotate an active DKIM key pair. Mark the original key as ‘rotated’, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to ‘retired’ 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.
POST
/
domains
/
{domain}
/
dkim-keys
/
{selector}
/
rotate
Node.js
import { MailChannels } from "mailchannels-sdk";const { MAILCHANNELS_API_KEY, DOMAIN, CURRENT_SELECTOR, NEW_SELECTOR } = process.env;if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");if (!DOMAIN) throw new Error("Set DOMAIN (the sending domain, e.g. example.com)");if (!CURRENT_SELECTOR) throw new Error("Set CURRENT_SELECTOR (the active key to rotate out)");if (!NEW_SELECTOR) throw new Error("Set NEW_SELECTOR (the selector for the new active key)");const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);const { data, error } = await mailchannels.domains.dkim.rotate(DOMAIN, CURRENT_SELECTOR, { newKey: { selector: NEW_SELECTOR },});if (error) { console.error("Rotate DKIM key failed:", error); process.exit(1);}console.log(data);
import os
import sys
import mailchannels
if not os.environ.get("MAILCHANNELS_API_KEY"):
sys.exit("Set MAILCHANNELS_API_KEY before running")
domain = os.environ.get("DOMAIN")
current_selector = os.environ.get("CURRENT_SELECTOR")
new_selector = os.environ.get("NEW_SELECTOR")
if not domain:
sys.exit("Set DOMAIN (the sending domain, e.g. example.com)")
if not current_selector:
sys.exit("Set CURRENT_SELECTOR (the active key to rotate out)")
if not new_selector:
sys.exit("Set NEW_SELECTOR (the selector for the new active key)")
response = mailchannels.Dkim.rotate(
domain,
current_selector,
new_selector=new_selector,
)
print(response)
<?php
require_once __DIR__ . '/vendor/autoload.php';
use MailChannels\Client;
$api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error: MAILCHANNELS_API_KEY is not set\n");
$domain = getenv('DOMAIN') or exit("Error: DOMAIN is not set\n");
$current_selector = getenv('CURRENT_SELECTOR') or exit("Error: CURRENT_SELECTOR is not set\n");
$new_selector = getenv('NEW_SELECTOR') or exit("Error: NEW_SELECTOR is not set\n");
$client = new Client(apiKey: $api_key);
$response = $client->dkim->rotate($domain, $current_selector, $new_selector);
print_r($response->toArray());
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MailChannels","description":"MailChannels email platform documentation — Email API, Outbound Filtering, and Inbound Filtering.","colors":{"primary":"#1E3A5F","light":"#6BA3D0","dark":"#1E3A5F"},"logo":{"light":"https://mintcdn.com/mailchannelscorporation/82jCZhYczGMlrqqs/images/MC_Logo_Full_Color_Light_Background_RGB_clearspace.png?fit=max\u0026auto=format\u0026n=82jCZhYczGMlrqqs\u0026q=85\u0026s=edceff94929b18cb41691d3277e58baa","dark":"https://mintcdn.com/mailchannelscorporation/82jCZhYczGMlrqqs/images/MC_Logo_Full_Color_Dark_Background_RGB_clearspace.png?fit=max\u0026auto=format\u0026n=82jCZhYczGMlrqqs\u0026q=85\u0026s=9f8675d2f6f8fc2af622c2db79440a45"},"favicon":{"light":"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png","dark":"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png"},"api":{"examples":{"languages":["javascript","python","php","curl"],"autogenerate":true}},"appearance":{"default":"system"},"background":{"decoration":"gradient","color":{"light":"#FFFFFF","dark":"#12131A"}},"navbar":{"links":[{"href":"https://status.mailchannels.net/","label":"System Status"},{"href":"https://support.mailchannels.com/hc/en-us/requests/new","label":"Support"}],"primary":{"type":"button","label":"Log in","href":"https://dash.mailchannels.com"}},"footer":{"socials":{"website":"https://mailchannels.com"},"links":[{"header":"For developers","items":[{"label":"Email API OpenAPI spec","href":"https://docs.mailchannels.com/email-api/api-reference/openapi.yaml"},{"label":"Official SDKs","href":"https://docs.mailchannels.com/email-api/official-libraries"},{"label":"Pricing and free plan","href":"https://docs.mailchannels.com/email-api/billing/pricing"}]},{"header":"For AI agents","items":[{"label":"llms.txt","href":"https://docs.mailchannels.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.mailchannels.com/llms-full.txt"}]}]},"seo":{"metatags":{"canonical":"https://docs.mailchannels.com"}},"fonts":{"heading":{"family":"Roboto","weight":600},"body":{"family":"Roboto","weight":400}},"icons":{"library":"fontawesome"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","assistant","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mailchannelscorporation","hasAudioNarration":false,"actualSubdomain":"mailchannelscorporation","customDomains":["docs.mailchannels.com"],"gitSource":{"type":"github","owner":"mailchannels","repo":"mc-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aee2ebc53bbcb625325dd19","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Email API","count":106},{"language":"default","tag":"API Reference","count":80},{"language":"default","tag":"Outbound Filtering","count":61},{"language":"default","tag":"Inbound Filtering","count":46},{"language":"default","tag":"Get Started","count":39},{"language":"default","tag":"Mail Server Setup","count":20},{"language":"default","tag":"Troubleshooting","count":15},{"language":"default","tag":"Sub-accounts","count":15},{"language":"default","tag":"Configuration","count":13},{"language":"default","tag":"Billing \u0026 Account Management","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@mailchannels.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--mc-logo-width: 14rem;--mc-logo-clearspace-height: 7.375rem;--mc-navbar-tabs-height: 3rem;--mc-navbar-height: calc(var(--mc-logo-clearspace-height) + var(--mc-navbar-tabs-height))}:is(h1,h2,h3,h4,h5,h6),[data-component-part=\"card-title\"]{font-family:Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;font-weight:700;letter-spacing:0}:is(p,li,td,th),[data-component-part=\"card-content\"]{font-family:Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif}toc-item>a{position:relative;padding-left:1rem!important}toc-item[data-active-deepest]>a::before{content:\"\";position:absolute;left:0;top:50%;width:0.75rem;height:0.75rem;transform:translateY(-50%);background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml;utf8,\u003csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'>\u003cpolyline points='9 18 15 12 9 6'/>\u003c/svg>\") no-repeat center / contain;mask:url(\"data:image/svg+xml;utf8,\u003csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'>\u003cpolyline points='9 18 15 12 9 6'/>\u003c/svg>\") no-repeat center / contain;pointer-events:none}.nav-tabs-item,#sidebar li[data-active=\"true\"]>a{text-shadow:none!important}#navbar{min-height:var(--mc-navbar-height)!important}#sidebar{top:var(--mc-navbar-height)!important;height:calc(100vh - var(--mc-navbar-height))!important}#navbar>.max-w-8xl>div>.relative,#navbar .h-16{height:var(--mc-logo-clearspace-height)!important}#navbar .h-full{height:100%!important}#navbar a[href=\"/\"] img,#navbar a[href=\"/\"] svg,#sidebar a[href=\"/\"] img,#sidebar a[href=\"/\"] svg{width:var(--mc-logo-width)!important;max-width:var(--mc-logo-width)!important;height:auto!important;max-height:none!important;object-fit:contain!important}#search-bar-entry,#assistant-entry,li.navbar-link>:is(a,button){border-radius:9999px!important;height:2.25rem!important;padding:0 1rem!important}[data-component-part=\"products-selector-trigger\"]{background-color:rgb(var(--background-light));border-radius:0.75rem!important;height:2.25rem!important;padding:0 0.75rem!important;transition:background-color 0.15s ease-out, box-shadow 0.15s ease-out!important;.dark \u0026 {\n background-color: rgb(var(--background-dark));\n }}.nav-dropdown-products-selector-item-icon{background:rgb(var(--primary));color:#ffffff!important;border-radius:0.375rem!important;aspect-ratio:1;svg {\n background-color: #ffffff;\n }}[data-component-part=\"products-selector-trigger\"]{position:relative;--icon-left-offset: 0.05rem;\u0026::before{content:\"\";position:absolute;top:50%;left:calc(0.5rem - var(--icon-left-offset));transform:translateY(-50%);width:1.5rem;height:1.5rem;border-radius:0.5rem;background:rgb(var(--primary));pointer-events:none}svg:not(:last-child) {\n position: relative;\n z-index: 1;\n filter: brightness(0) invert(1);\n margin-right: 0.25rem;\n margin-left: calc(-1 * var(--icon-left-offset));\n }}#search-bar-entry,#assistant-entry{transition:opacity 0.15s ease-out;body:has(#custom-homepage-assistant-entry) \u0026 {\n opacity: 0;\n pointer-events: none;\n }}#topbar-cta-button{padding:0!important;height:auto!important;\u0026,*,>*{border-radius:9999px!important}> :is(a, button, div, span) {\n height: 2.25rem !important;\n padding: 0 1rem !important;\n display: inline-flex !important;\n align-items: center !important;\n gap: 0.375rem !important;\n overflow: hidden !important;\n transition: background-color 0.15s ease-out !important;\n }}#topbar-cta-button>:is(a,button) span{background-color:rgb(var(--primary-dark))!important;font-weight:600}.dark #topbar-cta-button>:is(a,button) span{background-color:rgb(var(--primary-light))!important}.dark #topbar-cta-button>:is(a,button) :is(span,svg,svg *){color:rgb(var(--primary))!important}.dark #topbar-cta-button>:is(a,button) svg{stroke:currentColor!important}ul:is(:has(>#topbar-cta-button),:has(>li.navbar-link)){gap:0.25rem!important;> li + li {\n margin-left: 0.125rem !important;\n }}[data-popular-search]{border-radius:0.375rem!important;font-family:Roboto, sans-serif;letter-spacing:0!important}.card{border-radius:0.5rem!important;box-shadow:none!important}[data-component-part=\"card-icon\"]{color:#36A048}[data-component-part=\"card-icon\"] svg{stroke:#36A048;background-color:#36A048;stroke-width:1;stroke-linecap:round!important;stroke-linejoin:round!important}.card [data-component-part=\"card-icon\"]{background:rgba(54, 160, 72, 0.08);border-radius:0.5rem!important;display:grid!important;place-items:center!important;width:2.25rem!important;height:2.25rem!important}code{border-radius:0.375rem!important}.columns.suggested-articles{gap:1.5rem 2rem}"}],"page":{"pagePath":"api-reference/dkim/rotate-dkim-key-pair","slug":"/api-reference/dkim/rotate-dkim-key-pair","pageMetadata":{"title":"Rotate DKIM Key Pair","description":"Rotate an active DKIM key pair. Mark the original key as 'rotated', and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to 'retired' 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /domains/{domain}/dkim-keys/{selector}/rotate","href":"/api-reference/dkim/rotate-dkim-key-pair","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Rotate an active DKIM key pair. Mark the original key as ‘rotated’, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to ‘retired’ 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Rotate DKIM Key Pair","description":"Rotate an active DKIM key pair. Mark the original key as 'rotated', and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to 'retired' 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /domains/{domain}/dkim-keys/{selector}/rotate","href":"/api-reference/dkim/rotate-dkim-key-pair","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/mailchannelscorporation/eaffec8e65cd9c3a/search.js"],"openApiReferenceData":{"operation":{"description":"Rotate an active DKIM key pair. Mark the original key as 'rotated', and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to 'retired' 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.","parameters":["09c00c45-02f5-4fff-be13-bc58e4f1f578","f7e0fb76-fd47-450c-abbe-1c05453b4163","8eb53b87-5b38-4601-a7a3-cccf438578ae"],"requestBody":"989c2708-208e-40c4-b985-9ceaf8c2f3eb","responses":{"201":"45dbccf9-375d-468f-a4b4-dd871d869ddf","400":"b4c7d157-7a79-4346-a332-c23b3cfe8cab","404":"12f48e0c-a488-4b85-a16e-14b50678383b","409":"0db7a612-e481-43f0-9f7c-a3c6e6920777","500":"dece3721-c0a1-4aa6-979b-128bcbb8f4c5","503":"8296fa92-3abc-4c3f-9830-82d15331c645"},"summary":"Rotate DKIM Key Pair","tags":["DKIM"],"x-codeSamples":[{"label":"Node.js","lang":"javascript","source":"import { MailChannels } from \"mailchannels-sdk\";\n\nconst { MAILCHANNELS_API_KEY, DOMAIN, CURRENT_SELECTOR, NEW_SELECTOR } = process.env;\nif (!MAILCHANNELS_API_KEY) throw new Error(\"Set MAILCHANNELS_API_KEY before running\");\nif (!DOMAIN) throw new Error(\"Set DOMAIN (the sending domain, e.g. example.com)\");\nif (!CURRENT_SELECTOR) throw new Error(\"Set CURRENT_SELECTOR (the active key to rotate out)\");\nif (!NEW_SELECTOR) throw new Error(\"Set NEW_SELECTOR (the selector for the new active key)\");\n\nconst mailchannels = new MailChannels(MAILCHANNELS_API_KEY);\n\nconst { data, error } = await mailchannels.domains.dkim.rotate(DOMAIN, CURRENT_SELECTOR, {\n newKey: { selector: NEW_SELECTOR },\n});\n\nif (error) {\n console.error(\"Rotate DKIM key failed:\", error);\n process.exit(1);\n}\nconsole.log(data);"},{"label":"Python","lang":"python","source":"import os\nimport sys\n\nimport mailchannels\n\nif not os.environ.get(\"MAILCHANNELS_API_KEY\"):\n sys.exit(\"Set MAILCHANNELS_API_KEY before running\")\n\ndomain = os.environ.get(\"DOMAIN\")\ncurrent_selector = os.environ.get(\"CURRENT_SELECTOR\")\nnew_selector = os.environ.get(\"NEW_SELECTOR\")\nif not domain:\n sys.exit(\"Set DOMAIN (the sending domain, e.g. example.com)\")\nif not current_selector:\n sys.exit(\"Set CURRENT_SELECTOR (the active key to rotate out)\")\nif not new_selector:\n sys.exit(\"Set NEW_SELECTOR (the selector for the new active key)\")\n\nresponse = mailchannels.Dkim.rotate(\n domain,\n current_selector,\n new_selector=new_selector,\n)\n\nprint(response)"},{"label":"PHP","lang":"php","source":"\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse MailChannels\\Client;\n\n$api_key = getenv('MAILCHANNELS_API_KEY') or exit(\"Error: MAILCHANNELS_API_KEY is not set\\n\");\n$domain = getenv('DOMAIN') or exit(\"Error: DOMAIN is not set\\n\");\n$current_selector = getenv('CURRENT_SELECTOR') or exit(\"Error: CURRENT_SELECTOR is not set\\n\");\n$new_selector = getenv('NEW_SELECTOR') or exit(\"Error: NEW_SELECTOR is not set\\n\");\n\n$client = new Client(apiKey: $api_key);\n\n$response = $client->dkim->rotate($domain, $current_selector, $new_selector);\n\nprint_r($response->toArray());"}],"method":"post","type":"path","servers":["1e26a32e-ba39-4568-a0dc-d133bdf1b202"],"security":[],"path":"/domains/{domain}/dkim-keys/{selector}/rotate","baseUrlOptions":["https://api.mailchannels.net/tx/v1"],"title":"Rotate DKIM Key Pair","codeSamples":[{"label":"Node.js","lang":"javascript","source":"import { MailChannels } from \"mailchannels-sdk\";\n\nconst { MAILCHANNELS_API_KEY, DOMAIN, CURRENT_SELECTOR, NEW_SELECTOR } = process.env;\nif (!MAILCHANNELS_API_KEY) throw new Error(\"Set MAILCHANNELS_API_KEY before running\");\nif (!DOMAIN) throw new Error(\"Set DOMAIN (the sending domain, e.g. example.com)\");\nif (!CURRENT_SELECTOR) throw new Error(\"Set CURRENT_SELECTOR (the active key to rotate out)\");\nif (!NEW_SELECTOR) throw new Error(\"Set NEW_SELECTOR (the selector for the new active key)\");\n\nconst mailchannels = new MailChannels(MAILCHANNELS_API_KEY);\n\nconst { data, error } = await mailchannels.domains.dkim.rotate(DOMAIN, CURRENT_SELECTOR, {\n newKey: { selector: NEW_SELECTOR },\n});\n\nif (error) {\n console.error(\"Rotate DKIM key failed:\", error);\n process.exit(1);\n}\nconsole.log(data);"},{"label":"Python","lang":"python","source":"import os\nimport sys\n\nimport mailchannels\n\nif not os.environ.get(\"MAILCHANNELS_API_KEY\"):\n sys.exit(\"Set MAILCHANNELS_API_KEY before running\")\n\ndomain = os.environ.get(\"DOMAIN\")\ncurrent_selector = os.environ.get(\"CURRENT_SELECTOR\")\nnew_selector = os.environ.get(\"NEW_SELECTOR\")\nif not domain:\n sys.exit(\"Set DOMAIN (the sending domain, e.g. example.com)\")\nif not current_selector:\n sys.exit(\"Set CURRENT_SELECTOR (the active key to rotate out)\")\nif not new_selector:\n sys.exit(\"Set NEW_SELECTOR (the selector for the new active key)\")\n\nresponse = mailchannels.Dkim.rotate(\n domain,\n current_selector,\n new_selector=new_selector,\n)\n\nprint(response)"},{"label":"PHP","lang":"php","source":"\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse MailChannels\\Client;\n\n$api_key = getenv('MAILCHANNELS_API_KEY') or exit(\"Error: MAILCHANNELS_API_KEY is not set\\n\");\n$domain = getenv('DOMAIN') or exit(\"Error: DOMAIN is not set\\n\");\n$current_selector = getenv('CURRENT_SELECTOR') or exit(\"Error: CURRENT_SELECTOR is not set\\n\");\n$new_selector = getenv('NEW_SELECTOR') or exit(\"Error: NEW_SELECTOR is not set\\n\");\n\n$client = new Client(apiKey: $api_key);\n\n$response = $client->dkim->rotate($domain, $current_selector, $new_selector);\n\nprint_r($response->toArray());"}],"requestExampleLanguages":["javascript","python","php","bash"],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"09c00c45-02f5-4fff-be13-bc58e4f1f578":{"in":"path","name":"domain","required":true,"schema":{"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"f7e0fb76-fd47-450c-abbe-1c05453b4163":{"in":"path","name":"selector","required":true,"schema":{"maxLength":63,"minLength":1,"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"8eb53b87-5b38-4601-a7a3-cccf438578ae":{"in":"header","name":"X-Api-Key","required":true,"schema":{"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"properties":{"new_key":{"properties":{"selector":{"description":"Selector for the new key pair","maxLength":63,"minLength":1,"type":"string","isRequired":true,"uniqueKey":"new_key.selector","typeLabel":"string"}},"required":["selector"],"type":"object","isRequired":true,"uniqueKey":"new_key","typeLabel":"object"}},"required":["new_key"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"new_key":{"selector":"\u003cstring>"}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"45dbccf9-375d-468f-a4b4-dd871d869ddf":{"content":{"application/json":{"schema":{"properties":{"new_key":{"properties":{"algorithm":{"description":"Algorithm used for the key pair\n","type":"string","isRequired":true,"uniqueKey":"new_key.algorithm","typeLabel":"string"},"domain":{"description":"Domain associated with the key pair\n","type":"string","isRequired":true,"uniqueKey":"new_key.domain","typeLabel":"string"},"public_key":{"type":"string","isRequired":true,"uniqueKey":"new_key.public_key","typeLabel":"string"},"selector":{"description":"Selector assigned to the key pair\n","type":"string","isRequired":true,"uniqueKey":"new_key.selector","typeLabel":"string"},"status":{"enum":["active","retired","revoked","rotated"],"type":"string","isRequired":true,"uniqueKey":"new_key.status","typeLabel":"enum\u003cstring>"},"created_at":{"oneOf":[{"description":"Timestamp when the key pair was created\n","format":"date-time","type":"string","uniqueKey":"new_key.created_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"Timestamp when the key pair was created\n","format":"date-time","type":"null","uniqueKey":"new_key.created_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"new_key.created_at","typeLabel":"string\u003cdate-time> | null"},"dkim_dns_records":{"description":"Suggested DNS records for the DKIM key\n","items":{"oneOf":[{"description":"Suggested DNS record for the DKIM key\n","properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"new_key.dkim_dns_records.items.[INDEX].oneOf.0.name","typeLabel":"string"},"type":{"example":"TXT","type":"string","isRequired":true,"uniqueKey":"new_key.dkim_dns_records.items.[INDEX].oneOf.0.type","typeLabel":"string"},"value":{"type":"string","isRequired":true,"uniqueKey":"new_key.dkim_dns_records.items.[INDEX].oneOf.0.value","typeLabel":"string"}},"required":["name","type","value"],"type":"object","uniqueKey":"new_key.dkim_dns_records.items.[INDEX].oneOf.0","typeLabel":"object"},{"description":"Suggested DNS record for the DKIM key\n","properties":{"name":{"type":"string"},"type":{"example":"TXT","type":"string"},"value":{"type":"string"}},"required":["name","type","value"],"type":"null","uniqueKey":"new_key.dkim_dns_records.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"new_key.dkim_dns_records.items.[INDEX]","typeLabel":"object | null"},"type":"array","uniqueKey":"new_key.dkim_dns_records","typeLabel":"(object | null)[]"},"gracePeriodExpiresAt":{"oneOf":[{"description":"UTC timestamp after which you can no longer use the rotated key for signing\n","format":"date-time","type":"string","uniqueKey":"new_key.gracePeriodExpiresAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"UTC timestamp after which you can no longer use the rotated key for signing\n","format":"date-time","type":"null","uniqueKey":"new_key.gracePeriodExpiresAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"new_key.gracePeriodExpiresAt","typeLabel":"string\u003cdate-time> | null"},"key_length":{"description":"Key length in bits\n","type":"integer","uniqueKey":"new_key.key_length","typeLabel":"integer"},"retiresAt":{"oneOf":[{"description":"UTC timestamp when a rotated key pair is retired\n","format":"date-time","type":"string","uniqueKey":"new_key.retiresAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"UTC timestamp when a rotated key pair is retired\n","format":"date-time","type":"null","uniqueKey":"new_key.retiresAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"new_key.retiresAt","typeLabel":"string\u003cdate-time> | null"},"status_modified_at":{"oneOf":[{"description":"Timestamp when the key was last modified\n","format":"date-time","type":"string","uniqueKey":"new_key.status_modified_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"Timestamp when the key was last modified\n","format":"date-time","type":"null","uniqueKey":"new_key.status_modified_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"new_key.status_modified_at","typeLabel":"string\u003cdate-time> | null"}},"required":["domain","selector","public_key","status","algorithm"],"type":"object","isRequired":true,"uniqueKey":"new_key","typeLabel":"object"},"rotated_key":{"properties":{"algorithm":{"description":"Algorithm used for the key pair\n","type":"string","isRequired":true,"uniqueKey":"rotated_key.algorithm","typeLabel":"string"},"domain":{"description":"Domain associated with the key pair\n","type":"string","isRequired":true,"uniqueKey":"rotated_key.domain","typeLabel":"string"},"public_key":{"type":"string","isRequired":true,"uniqueKey":"rotated_key.public_key","typeLabel":"string"},"selector":{"description":"Selector assigned to the key pair\n","type":"string","isRequired":true,"uniqueKey":"rotated_key.selector","typeLabel":"string"},"status":{"enum":["active","retired","revoked","rotated"],"type":"string","isRequired":true,"uniqueKey":"rotated_key.status","typeLabel":"enum\u003cstring>"},"created_at":{"oneOf":[{"description":"Timestamp when the key pair was created\n","format":"date-time","type":"string","uniqueKey":"rotated_key.created_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"Timestamp when the key pair was created\n","format":"date-time","type":"null","uniqueKey":"rotated_key.created_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"rotated_key.created_at","typeLabel":"string\u003cdate-time> | null"},"dkim_dns_records":{"description":"Suggested DNS records for the DKIM key\n","items":{"oneOf":[{"description":"Suggested DNS record for the DKIM key\n","properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX].oneOf.0.name","typeLabel":"string"},"type":{"example":"TXT","type":"string","isRequired":true,"uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX].oneOf.0.type","typeLabel":"string"},"value":{"type":"string","isRequired":true,"uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX].oneOf.0.value","typeLabel":"string"}},"required":["name","type","value"],"type":"object","uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX].oneOf.0","typeLabel":"object"},{"description":"Suggested DNS record for the DKIM key\n","properties":{"name":{"type":"string"},"type":{"example":"TXT","type":"string"},"value":{"type":"string"}},"required":["name","type","value"],"type":"null","uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX].oneOf.1","typeLabel":"null"}],"uniqueKey":"rotated_key.dkim_dns_records.items.[INDEX]","typeLabel":"object | null"},"type":"array","uniqueKey":"rotated_key.dkim_dns_records","typeLabel":"(object | null)[]"},"gracePeriodExpiresAt":{"oneOf":[{"description":"UTC timestamp after which you can no longer use the rotated key for signing\n","format":"date-time","type":"string","uniqueKey":"rotated_key.gracePeriodExpiresAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"UTC timestamp after which you can no longer use the rotated key for signing\n","format":"date-time","type":"null","uniqueKey":"rotated_key.gracePeriodExpiresAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"rotated_key.gracePeriodExpiresAt","typeLabel":"string\u003cdate-time> | null"},"key_length":{"description":"Key length in bits\n","type":"integer","uniqueKey":"rotated_key.key_length","typeLabel":"integer"},"retiresAt":{"oneOf":[{"description":"UTC timestamp when a rotated key pair is retired\n","format":"date-time","type":"string","uniqueKey":"rotated_key.retiresAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"UTC timestamp when a rotated key pair is retired\n","format":"date-time","type":"null","uniqueKey":"rotated_key.retiresAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"rotated_key.retiresAt","typeLabel":"string\u003cdate-time> | null"},"status_modified_at":{"oneOf":[{"description":"Timestamp when the key was last modified\n","format":"date-time","type":"string","uniqueKey":"rotated_key.status_modified_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"Timestamp when the key was last modified\n","format":"date-time","type":"null","uniqueKey":"rotated_key.status_modified_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"rotated_key.status_modified_at","typeLabel":"string\u003cdate-time> | null"}},"required":["domain","selector","public_key","status","algorithm"],"type":"object","isRequired":true,"uniqueKey":"rotated_key","typeLabel":"object"}},"required":["new_key","rotated_key"],"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"new_key":{"algorithm":"\u003cstring>","domain":"\u003cstring>","public_key":"\u003cstring>","selector":"\u003cstring>","status":"active","created_at":"2023-11-07T05:31:56Z","dkim_dns_records":[{"name":"\u003cstring>","type":"TXT","value":"\u003cstring>"}],"gracePeriodExpiresAt":"2023-11-07T05:31:56Z","key_length":123,"retiresAt":"2023-11-07T05:31:56Z","status_modified_at":"2023-11-07T05:31:56Z"},"rotated_key":{"algorithm":"\u003cstring>","domain":"\u003cstring>","public_key":"\u003cstring>","selector":"\u003cstring>","status":"active","created_at":"2023-11-07T05:31:56Z","dkim_dns_records":[{"name":"\u003cstring>","type":"TXT","value":"\u003cstring>"}],"gracePeriodExpiresAt":"2023-11-07T05:31:56Z","key_length":123,"retiresAt":"2023-11-07T05:31:56Z","status_modified_at":"2023-11-07T05:31:56Z"}}}},"exampleType":"generated"}},"description":"Key pair status updated and new key pair created successfully","exampleType":"generated"},"b4c7d157-7a79-4346-a332-c23b3cfe8cab":{"content":{"application/json":{"schema":{"properties":{"errors":{"description":"This is an array error objects that provide machine and human readable descriptions of the errors.\n","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"type":"array","uniqueKey":"errors","typeLabel":"string[]"}},"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"errors":["\u003cstring>"]}}},"exampleType":"generated"}},"description":"Bad Request","exampleType":"generated"},"12f48e0c-a488-4b85-a16e-14b50678383b":{"description":"Specified key pair not found","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"0db7a612-e481-43f0-9f7c-a3c6e6920777":{"description":"Key pair already created for domain, and provided new key selector.\n","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"dece3721-c0a1-4aa6-979b-128bcbb8f4c5":{"description":"Internal Server Error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"8296fa92-3abc-4c3f-9830-82d15331c645":{"description":"Temporarily unavailable for maintenance","headers":{"Retry-After":{"description":"Suggested wait time in seconds before retrying.\n","schema":{"example":"20","type":"string"}}},"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{},"servers":{"1e26a32e-ba39-4568-a0dc-d133bdf1b202":{"url":"https://api.mailchannels.net/tx/v1"}}},"originalFileLocation":"email-api/api-reference/openapi.yaml"},"subdomain":"mailchannelscorporation","siteName":"MailChannels","title":"Rotate DKIM Key Pair - MailChannels","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T18:19:58.335Z","originalFileLocation":"api-reference/dkim/rotate-dkim-key-pair.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Rotate an active DKIM key pair. Mark the original key as \u0026#x27;rotated\u0026#x27;, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to \u0026#x27;retired\u0026#x27; 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MailChannels\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://media.brand.dev/1905386c-3c6f-4c57-84d6-872e7dd5f936.png\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rotate DKIM Key Pair - MailChannels\">\u003cmeta data-mint-head property=\"og:description\" content=\"Rotate an active DKIM key pair. Mark the original key as \u0026#x27;rotated\u0026#x27;, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to \u0026#x27;retired\u0026#x27; 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MailChannels\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mailchannelscorporation.mintlify.site/_mintlify/api/og/v2?division=DKIM\u0026amp;title=Rotate+DKIM+Key+Pair\u0026amp;description=Rotate+an+active+DKIM+key+pair.+Mark+the+original+key+as+%27rotated%27%2C+and+create+a+new+key+pair+with+the+required+new+key+selector%2C+reusing+the+same+algorithm+and\u0026amp;theme=06ed90d9d16f3e705ce8c66b\u0026amp;signature=c0668105a4d817dd56a172b71ed30ed35fa271f48d8d81ba1f3e7edf8380cd74\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Rotate DKIM Key Pair - MailChannels\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Rotate an active DKIM key pair. Mark the original key as \u0026#x27;rotated\u0026#x27;, and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to \u0026#x27;retired\u0026#x27; 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mailchannelscorporation.mintlify.site/_mintlify/api/og/v2?division=DKIM\u0026amp;title=Rotate+DKIM+Key+Pair\u0026amp;description=Rotate+an+active+DKIM+key+pair.+Mark+the+original+key+as+%27rotated%27%2C+and+create+a+new+key+pair+with+the+required+new+key+selector%2C+reusing+the+same+algorithm+and\u0026amp;theme=06ed90d9d16f3e705ce8c66b\u0026amp;signature=c0668105a4d817dd56a172b71ed30ed35fa271f48d8d81ba1f3e7edf8380cd74\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/mailchannelscorporation/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MailChannels\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1E3A5F\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/dkim/rotate-dkim-key-pair.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mailchannels.com/#organization\",\"name\":\"MailChannels\",\"url\":\"https://docs.mailchannels.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mailchannelscorporation/82jCZhYczGMlrqqs/images/MC_Logo_Full_Color_Light_Background_RGB_clearspace.png?fit=max\u0026auto=format\u0026n=82jCZhYczGMlrqqs\u0026q=85\u0026s=edceff94929b18cb41691d3277e58baa\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mailchannels.com#website\",\"name\":\"MailChannels\",\"url\":\"https://docs.mailchannels.com\",\"publisher\":{\"@id\":\"https://docs.mailchannels.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair#webpage\",\"url\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair\",\"name\":\"Rotate DKIM Key Pair\",\"description\":\"Rotate an active DKIM key pair. Mark the original key as 'rotated', and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to 'retired' 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\",\"dateModified\":\"2026-10-26T18:19:58.335Z\",\"isPartOf\":{\"@id\":\"https://docs.mailchannels.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.mailchannels.com/email-api/api-reference-introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DKIM\",\"item\":\"https://docs.mailchannels.com/api-reference/dkim/dkim-spf-\u0026-domain-lockdown-check\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Rotate DKIM Key Pair\",\"item\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair#apireference\",\"headline\":\"Rotate DKIM Key Pair\",\"name\":\"Rotate DKIM Key Pair\",\"description\":\"Rotate an active DKIM key pair. Mark the original key as 'rotated', and create a new key pair with the required new key selector, reusing the same algorithm and key length. The rotated key remains valid for signing for a 3-day grace period, and is automatically changed to 'retired' 2 weeks after rotation. Publish the new key to its DNS TXT record before rotated key expires for signing as emails sent with an unpublished key will fail DKIM validation by receiving providers. After the grace period, only the new key is valid for signing if published.\",\"url\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mailchannels.com/api-reference/dkim/rotate-dkim-key-pair#webpage\"},\"dateModified\":\"2026-10-26T18:19:58.335Z\",\"publisher\":{\"@id\":\"https://docs.mailchannels.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mailchannels.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MailChannels\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"MailChannels","nav":{"global":null,"tabs":[{"tab":"Email API","groups":[{"group":"Get Started","pages":[{"title":"MailChannels Email API: transactional email for platforms","sidebarTitle":"Overview","href":"/email-api/overview"},{"title":"Email API vs SMTP","sidebarTitle":"Email API vs SMTP","href":"/email-api/email-api-vs-smtp"},{"group":"Quickstart","expanded":true,"pages":[{"title":"cURL quickstart","sidebarTitle":"cURL","icon":"envelope","href":"/email-api/curl/quickstart"},{"title":"Node.js quickstart","sidebarTitle":"Node.js","icon":"envelope","href":"/email-api/javascript/quickstart"},{"title":"Python quickstart","sidebarTitle":"Python","icon":"envelope","href":"/email-api/python/quickstart"},{"title":"PHP quickstart","sidebarTitle":"PHP","icon":"envelope","href":"/email-api/php/quickstart"}]},{"group":"SDKs \u0026 libraries","pages":[{"title":"Official libraries","sidebarTitle":"Official libraries","href":"/email-api/official-libraries"},{"title":"Laravel","sidebarTitle":"Laravel","href":"/email-api/laravel"},{"title":"Symfony","sidebarTitle":"Symfony","href":"/email-api/symfony"},{"title":"Nodemailer","sidebarTitle":"Nodemailer","href":"/email-api/nodemailer"},{"title":"Nuxt community integration","sidebarTitle":"Nuxt","href":"/email-api/integrations/nuxt"}]},{"title":"Local development","sidebarTitle":"Local development","href":"/email-api/local-development"},{"title":"MailChannels Email API: pricing, plans, and limits","sidebarTitle":"Pricing and limits","href":"/email-api/billing/pricing"}]},{"group":"API Reference","expanded":false,"pages":[{"title":"Introduction","sidebarTitle":"Introduction","href":"/email-api/api-reference-introduction"},{"group":"DKIM","pages":[{"title":"DKIM, SPF \u0026 Domain Lockdown Check","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /check-domain","href":"/api-reference/dkim/dkim-spf-\u0026-domain-lockdown-check"},{"title":"Retrieve DKIM Keys","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /domains/{domain}/dkim-keys","href":"/api-reference/dkim/retrieve-dkim-keys"},{"title":"Create DKIM Key Pair","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /domains/{domain}/dkim-keys","href":"/api-reference/dkim/create-dkim-key-pair"},{"title":"Update DKIM Key Status","description":"Update fields of an existing DKIM key pair for the specified domain and selector, for the current customer.\nCurrently, only the status field can be updated.\nrevoked: Indicates that the key is compromised and should not be used.\nretired: Indicates that the key has been rotated and is no longer in use.\nrotated: Indicates that the key is going through the rotation process. Only active key pairs can be\nupdated to this status, and no new key pair is created. The rotated key can be used to sign emails for 3 days after\nthe status update, and will automatically change to 'retired' 2 weeks after update. For a smooth key transition,\nit is recommended to create and publish a new key pair before signing is disabled for the rotated key.\n","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml patch /domains/{domain}/dkim-keys/{selector}","href":"/api-reference/dkim/update-dkim-key-status"},{"title":"Rotate DKIM Key Pair","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /domains/{domain}/dkim-keys/{selector}/rotate","href":"/api-reference/dkim/rotate-dkim-key-pair"}]},{"group":"Custom Tracking","pages":[{"title":"Retrieve Custom Tracking Domains","description":"Retrieve all custom tracking domains registered under your account.\nOptional filters include domain name, status, scope, limit and offset.\n","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /custom-tracking-domains","href":"/api-reference/custom-tracking/retrieve-custom-tracking-domains"},{"title":"Register Custom Tracking Domain","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /custom-tracking-domains","href":"/api-reference/custom-tracking/register-custom-tracking-domain"},{"title":"Delete Custom Tracking Domain","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /custom-tracking-domains/{hostname}/{scope}","href":"/api-reference/custom-tracking/delete-custom-tracking-domain"},{"title":"Update Custom Tracking Domain","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml patch /custom-tracking-domains/{hostname}/{scope}","href":"/api-reference/custom-tracking/update-custom-tracking-domain"}]},{"group":"Metrics","pages":[{"title":"Retrieve Engagement Metrics","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /metrics/engagement","href":"/api-reference/metrics/retrieve-engagement-metrics"},{"title":"Retrieve Performance Metrics","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /metrics/performance","href":"/api-reference/metrics/retrieve-performance-metrics"},{"title":"Retrieve Recipient Behaviour Metrics","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /metrics/recipient-behaviour","href":"/api-reference/metrics/retrieve-recipient-behaviour-metrics"},{"title":"Retrieve Sender Metrics","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /metrics/senders/{sender_type}","href":"/api-reference/metrics/retrieve-sender-metrics"},{"title":"Retrieve Volume Metrics","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /metrics/volume","href":"/api-reference/metrics/retrieve-volume-metrics"}]},{"group":"Send","pages":[{"title":"Send an Email","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /send","href":"/api-reference/send/send-an-email"},{"title":"Send an Email Asynchronously","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /send-async","href":"/api-reference/send/send-an-email-asynchronously"}]},{"group":"Sub-accounts","pages":[{"title":"Retrieve Sub-accounts","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /sub-account","href":"/api-reference/sub-accounts/retrieve-sub-accounts"},{"title":"Create Sub-account","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /sub-account","href":"/api-reference/sub-accounts/create-sub-account"},{"title":"Delete Sub-account","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /sub-account/{handle}","href":"/api-reference/sub-accounts/delete-sub-account"},{"title":"Activate Sub-account","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /sub-account/{handle}/activate","href":"/api-reference/sub-accounts/activate-sub-account"},{"title":"Retrieve Sub-account API Keys","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /sub-account/{handle}/api-key","href":"/api-reference/sub-accounts/retrieve-sub-account-api-keys"},{"title":"Create Sub-account API Key","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /sub-account/{handle}/api-key","href":"/api-reference/sub-accounts/create-sub-account-api-key"},{"title":"Delete Sub-account API Key","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /sub-account/{handle}/api-key/{id}","href":"/api-reference/sub-accounts/delete-sub-account-api-key"},{"title":"Retrieve Sub-account Limit","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /sub-account/{handle}/limit","href":"/api-reference/sub-accounts/retrieve-sub-account-limit"},{"title":"Set Sub-account Limit","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml put /sub-account/{handle}/limit","href":"/api-reference/sub-accounts/set-sub-account-limit"},{"title":"Delete Sub-account Limit","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /sub-account/{handle}/limit","href":"/api-reference/sub-accounts/delete-sub-account-limit"},{"title":"Retrieve Sub-account SMTP Passwords","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /sub-account/{handle}/smtp-password","href":"/api-reference/sub-accounts/retrieve-sub-account-smtp-passwords"},{"title":"Create Sub-account SMTP Password","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /sub-account/{handle}/smtp-password","href":"/api-reference/sub-accounts/create-sub-account-smtp-password"},{"title":"Delete Sub-account SMTP Password","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /sub-account/{handle}/smtp-password/{id}","href":"/api-reference/sub-accounts/delete-sub-account-smtp-password"},{"title":"Suspend Sub-account","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /sub-account/{handle}/suspend","href":"/api-reference/sub-accounts/suspend-sub-account"},{"title":"Retrieve Sub-account Usage Stats","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /sub-account/{handle}/usage","href":"/api-reference/sub-accounts/retrieve-sub-account-usage-stats"}]},{"group":"Suppression","pages":[{"title":"Retrieve Suppression List","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /suppression-list","href":"/api-reference/suppression/retrieve-suppression-list"},{"title":"Create Suppression Entries","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /suppression-list","href":"/api-reference/suppression/create-suppression-entries"},{"title":"Delete Suppression Entry","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /suppression-list/recipients/{recipient}","href":"/api-reference/suppression/delete-suppression-entry"}]},{"group":"Usage","pages":[{"title":"Retrieve Usage Stats","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /usage","href":"/api-reference/usage/retrieve-usage-stats"}]},{"group":"Webhooks","pages":[{"title":"Retrieve Customer Webhooks","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /webhook","href":"/api-reference/webhooks/retrieve-customer-webhooks"},{"title":"Enroll for Webhook Notifications","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /webhook","href":"/api-reference/webhooks/enroll-for-webhook-notifications"},{"title":"Delete Customer Webhooks","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml delete /webhook","href":"/api-reference/webhooks/delete-customer-webhooks"},{"title":"Retrieve Webhook Batches","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /webhook-batch","href":"/api-reference/webhooks/retrieve-webhook-batches"},{"title":"Resend Events","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /webhook-batch/{batch_id}/resend","href":"/api-reference/webhooks/resend-events"},{"title":"Retrieve Webhook Signing Key","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml get /webhook/public-key","href":"/api-reference/webhooks/retrieve-webhook-signing-key"},{"title":"Validate Enrolled Webhook","deprecated":null,"version":null,"openapi":"/email-api/api-reference/openapi.yaml post /webhook/validate","href":"/api-reference/webhooks/validate-enrolled-webhook"}]}]},{"group":"Authentication \u0026 Account Setup","pages":[{"title":"Authentication","sidebarTitle":"Authentication","href":"/email-api/authentication"},{"title":"Security","sidebarTitle":"Security","href":"/email-api/security"},{"title":"Domain Lockdown","sidebarTitle":"Domain Lockdown","href":"/email-api/domain-lockdown"}]},{"group":"Sending Email","pages":[{"title":"Send vs send async","sidebarTitle":"Send vs send async","href":"/email-api/send-vs-send-async"},{"title":"How emails are structured","sidebarTitle":"Email structure","href":"/email-api/how-emails-are-structured"},{"title":"Content types","sidebarTitle":"Content types","href":"/email-api/content-types"},{"title":"Attachments","sidebarTitle":"Attachments","href":"/email-api/attachments"},{"title":"Custom headers","sidebarTitle":"Custom headers","href":"/email-api/custom-headers"},{"title":"Templates","sidebarTitle":"Templates","href":"/email-api/templates"},{"title":"Sending via SMTP","sidebarTitle":"SMTP sending","href":"/email-api/smtp-sending"},{"title":"Custom tracking","sidebarTitle":"Custom tracking","href":"/email-api/custom-tracking"},{"title":"Inbound email and replies","sidebarTitle":"Inbound email and replies","href":"/email-api/inbound-email-replies"}]},{"group":"Email Authentication","pages":[{"title":"SPF, DKIM, and DMARC","sidebarTitle":"SPF, DKIM, and DMARC","href":"/email-api/spf-dkim-dmarc"},{"title":"DKIM signing and key management","sidebarTitle":"DKIM signing and key management","href":"/email-api/configuring-dkim"}]},{"group":"Webhooks \u0026 Delivery Events","pages":[{"title":"Webhooks","sidebarTitle":"Webhooks","href":"/email-api/webhooks"},{"title":"Event types","sidebarTitle":"Event types","href":"/email-api/webhook-event-types"},{"title":"JSON schema for webhooks","sidebarTitle":"JSON schema","href":"/email-api/webhook-schema"},{"title":"Webhook retries and delivery behavior","sidebarTitle":"Retries and delivery behavior","href":"/email-api/webhook-retries"},{"title":"Handling hard-bounced events","sidebarTitle":"Hard-bounced events","href":"/email-api/hard-bounced-events"},{"title":"Handling soft-bounced events","sidebarTitle":"Soft-bounced events","href":"/email-api/soft-bounced-events"},{"title":"Handling complained events","sidebarTitle":"Complained events","href":"/email-api/complained-events"},{"title":"Handling unsubscribed events","sidebarTitle":"Unsubscribed events","href":"/email-api/unsubscribed-events"}]},{"group":"Platform \u0026 Multi-tenant","pages":[{"title":"Multi-tenancy overview","sidebarTitle":"Multi-tenancy","href":"/email-api/multi-tenancy"},{"title":"Creating a sub-account","sidebarTitle":"Create","href":"/email-api/sub-accounts-create"},{"title":"Authenticating a sub-account","sidebarTitle":"Authenticate","href":"/email-api/sub-accounts-authentication"},{"title":"Sub-account sending limits","sidebarTitle":"Limits","href":"/email-api/sub-accounts-limits"}]},{"group":"Reputation and Abuse Control","pages":[{"title":"Reputation and abuse control","sidebarTitle":"Overview","href":"/email-api/reputation-abuse-control"},{"title":"Sending policies and best practices","sidebarTitle":"Sending policies","href":"/email-api/sending-policies"}]},{"group":"Metrics \u0026 Monitoring","pages":[{"title":"Metrics","sidebarTitle":"Overview","href":"/email-api/metrics"},{"title":"Engagement metrics","sidebarTitle":"Engagement","href":"/email-api/metrics-engagement"},{"title":"Performance metrics","sidebarTitle":"Performance","href":"/email-api/metrics-performance"},{"title":"Volume metrics","sidebarTitle":"Volume","href":"/email-api/metrics-volume"},{"title":"Recipient behavior metrics","sidebarTitle":"Recipient behavior","href":"/email-api/metrics-recipient-behavior"},{"title":"Sender breakdown metrics","sidebarTitle":"Sender breakdown","href":"/email-api/metrics-senders"}]},{"group":"Operate in production","pages":[{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","href":"/email-api/troubleshooting"},{"title":"Errors","sidebarTitle":"Errors","href":"/email-api/errors"},{"title":"Debug a sent message","sidebarTitle":"Debug a sent message","href":"/email-api/debug-sent-message"},{"title":"Suppressions and unsubscribe handling","sidebarTitle":"Suppressions and unsubscribes","href":"/email-api/suppressions-unsubscribes"},{"title":"Managing suppressions","sidebarTitle":"Managing suppressions","href":"/email-api/suppression-api-actions"},{"title":"Unsubscribe","sidebarTitle":"Unsubscribe","href":"/email-api/unsubscribe"}]},{"group":"Migration guides","pages":[{"title":"Migration Center","sidebarTitle":"Overview","href":"/email-api/migration-center/overview"},{"title":"Migrate from SendGrid to MailChannels Email API","sidebarTitle":"SendGrid","href":"/email-api/migration-center/migrate-from-sendgrid"},{"title":"Migrate from Mailgun to MailChannels Email API","sidebarTitle":"Mailgun","href":"/email-api/migration-center/migrate-from-mailgun"},{"title":"Migrate from Mailjet to MailChannels Email API","sidebarTitle":"Mailjet","href":"/email-api/migration-center/migrate-from-mailjet"},{"title":"Migrate from Brevo to MailChannels Email API","sidebarTitle":"Brevo","href":"/email-api/migration-center/migrate-from-brevo"},{"title":"Migrate from Postmark to MailChannels Email API","sidebarTitle":"Postmark","href":"/email-api/migration-center/migrate-from-postmark"},{"title":"Migrate from Amazon SES to MailChannels Email API","sidebarTitle":"Amazon SES","href":"/email-api/migration-center/migrate-from-amazon-ses"},{"title":"Migrate from Resend to MailChannels Email API","sidebarTitle":"Resend","href":"/email-api/migration-center/migrate-from-resend"}]},{"group":"Integrations","pages":[{"title":"Send governed emails automatically with MailChannels + Zapier","sidebarTitle":"Zapier integration","href":"/email-api/integrations/zapier"}]},{"group":"For AI Agents","pages":[{"title":"Send email from OpenClaw agents using MailChannels","sidebarTitle":"OpenClaw integration","href":"/email-api/openclaw"}]}]},{"tab":"Outbound Filtering","pages":[{"title":"Outbound Filtering","href":"/outbound/overview"}]},{"tab":"Inbound Filtering","pages":[{"title":"Inbound Filtering","href":"/inbound/overview"}]},{"tab":"Plugins","pages":[{"title":"Plugins","href":"/plugins/whmcs/overview"}]}]},"basePath":"","title":"Rotate DKIM Key Pair - MailChannels","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}