Domains: DKIM

Start DKIM Upgrade

Moves a domain from a 1024-bit to a 2048-bit DKIM key without stopping your sends. Creates the new key on a new selector and returns the record to publish.

POSThttps://g.sendcorex.com/v1/domaincommand: start_dkim_upgrade
i

Needs the domain:create scope on your API key.

i

Up to 10 calls per minute per account. Over that, the command answers RATE_LIMITED.

i

Safe to call twice: if an upgrade is already in progress, you get the same pending key back.

!

Do not edit or remove the current DKIM record. Add the new one next to it.

Arguments

  • domainstringrequired

    The domain name.

    e.g. "acme-mail.com"

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/domain',
  {
    commands: [
      {
        command: "start_dkim_upgrade",
        args: {
          domain: "acme-mail.com"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "start_dkim_upgrade",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 620,
      "data": {
        "domain": "acme-mail.com",
        "validated": true,
        "has_mx": true,
        "has_spf": true,
        "has_dkim": true,
        "has_dmarc": true,
        "has_return_path": true,
        "description": null,
        "dkim_key_size": 1024,
        "dkim_deprecated": true,
        "dkim_upgrade_pending": true,
        "created_at": "2026-09-02T14:21:07.118Z",
        "updated_at": "2026-10-21T02:40:51.902Z",
        "registrar": "cloudflare",
        "dns_records": {
          "spf": {
            "type": "TXT",
            "host": "acme-mail.com",
            "value": "v=spf1 include:_spf.google.com include:smtp.emailsbit.com ~all"
          },
          "dkim": {
            "type": "TXT",
            "host": "sendcorex._domainkey",
            "value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCfGv4Yz2sTJHJ7BwjYjLlcHpL1OVJ0eA6Gg3Z3sQhZ2y1nI4S0Zl8q7vUJr5cQ1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7A8B9C0D1E2F3G4H5I6J7K8L9M0N1O2P3Q4R5S6T7U8V9W0X1Y2Z3wIDAQAB"
          },
          "dkim_pending": {
            "type": "TXT",
            "host": "sendcorex2._domainkey",
            "value": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw3v8Qk2Lr9sT1yH6pE0bN4cM7xZ2aJ5fG8dK1uV3oW9qR6tY0iS4eL2nB7mC5vX8zA1sD3fH6jK9lP0oI2uY4tR7eW1qA5sZ8xC3vB6nM9kL2jH5gF8dS1aP4oI7uY0tR3eW6qA9sZ2xC5vB8nM1kL4jH7gF0dS3aP6oI9uY2tR5eW8qA1sZ4xC7vB0nM3kL6jH9gF2dS5aP8oI1uY4tR7eW0qA3sZ6xC9vB2nM5kL8jH1gF4dS7aP0oI3uY6tR9eW2qA5sZ8xC1vB4nM7kL0jH3gF6dS9aP2oI5uY8tR1eW4qA7sZ0xC3vB6nM9QIDAQAB",
            "split_value": "\"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw3v8Qk2Lr9sT1yH6pE0bN4cM7xZ2aJ5fG8dK1uV3oW9qR6tY0iS4eL2nB7mC5vX8zA1sD3fH6jK9lP0oI2uY4tR7eW1qA5sZ8xC3vB6nM9kL2jH5gF8dS1aP4oI7uY0tR3eW6qA9sZ2xC5vB8nM1kL4jH7gF0dS3aP6oI9uY2tR5eW8qA1sZ4xC7vB0nM3kL6\" \"jH9gF2dS5aP8oI1uY4tR7eW0qA3sZ6xC9vB2nM5kL8jH1gF4dS7aP0oI3uY6tR9eW2qA5sZ8xC1vB4nM7kL0jH3gF6dS9aP2oI5uY8tR1eW4qA7sZ0xC3vB6nM9QIDAQAB\""
          },
          "mx": {
            "type": "MX",
            "host": "acme-mail.com",
            "value": "bounce.emailsbit.com",
            "priority": 0
          },
          "return_path": {
            "type": "CNAME",
            "host": "bounces",
            "value": "bounce.emailsbit.com"
          },
          "dmarc": {
            "type": "TXT",
            "host": "_dmarc",
            "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@bounces.acme-mail.com"
          }
        },
        "spf_duplicate": false,
        "spf_duplicate_records": [],
        "dkim": {
          "version": 1,
          "key_size": 1024,
          "selector": "sendcorex",
          "deprecated": true,
          "upgrade_pending": true,
          "pending": {
            "selector": "sendcorex2",
            "key_size": 2048,
            "host": "sendcorex2._domainkey",
            "full_host": "sendcorex2._domainkey.acme-mail.com",
            "value": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw3v8Qk2Lr9sT1yH6pE0bN4cM7xZ2aJ5fG8dK1uV3oW9qR6tY0iS4eL2nB7mC5vX8zA1sD3fH6jK9lP0oI2uY4tR7eW1qA5sZ8xC3vB6nM9kL2jH5gF8dS1aP4oI7uY0tR3eW6qA9sZ2xC5vB8nM1kL4jH7gF0dS3aP6oI9uY2tR5eW8qA1sZ4xC7vB0nM3kL6jH9gF2dS5aP8oI1uY4tR7eW0qA3sZ6xC9vB2nM5kL8jH1gF4dS7aP0oI3uY6tR9eW2qA5sZ8xC1vB4nM7kL0jH3gF6dS9aP2oI5uY8tR1eW4qA7sZ0xC3vB6nM9QIDAQAB",
            "split_value": "\"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw3v8Qk2Lr9sT1yH6pE0bN4cM7xZ2aJ5fG8dK1uV3oW9qR6tY0iS4eL2nB7mC5vX8zA1sD3fH6jK9lP0oI2uY4tR7eW1qA5sZ8xC3vB6nM9kL2jH5gF8dS1aP4oI7uY0tR3eW6qA9sZ2xC5vB8nM1kL4jH7gF0dS3aP6oI9uY2tR5eW8qA1sZ4xC7vB0nM3kL6\" \"jH9gF2dS5aP8oI1uY4tR7eW0qA3sZ6xC9vB2nM5kL8jH1gF4dS7aP0oI3uY6tR9eW2qA5sZ8xC1vB4nM7kL0jH3gF6dS9aP2oI5uY8tR1eW4qA7sZ0xC3vB6nM9QIDAQAB\"",
            "created_at": "2026-10-21T03:10:44.205Z"
          },
          "previous_selector": null,
          "keep_old_record_until": null,
          "just_upgraded": false
        }
      }
    }
  ]
}

Response fields

  • domain

    The domain name, in lowercase. It is the id you use in every other command.

  • validated

    true once the Return-Path CNAME and the DKIM record were found. Only validated domains can have senders.

  • has_mx

    The MX record points to bounce.emailsbit.com. Optional: needed only to receive replies and bounces on the domain itself.

  • has_spf

    Your SPF includes include:smtp.emailsbit.com.

  • has_dkim

    The DKIM TXT record with your public key is published.

  • has_dmarc

    A DMARC record exists on _dmarc.<domain>.

  • has_return_path

    The Return-Path CNAME (bounces.<domain> → bounce.emailsbit.com) is published. Bounces and SPF alignment depend on it.

  • description

    Your own note about the domain, or null.

  • dkim_key_size

    2048 or 1024. null if the domain has no key yet.

  • dkim_deprecated

    true for 1024-bit keys. Some providers already treat them as weak: upgrade with Start DKIM Upgrade.

  • dkim_upgrade_pending

    true while a new 2048-bit key waits for its DNS record.

  • created_at / updated_at

    ISO 8601, UTC.

  • registrar

    Where the DNS is hosted, from its nameservers: cloudflare, namecheap, godaddy, route53, google, vercel, hostinger, ionos, hetzner, dreamhost, squarespace, registrobr or other.

  • dns_records.spf / dkim / mx / return_path / dmarc

    The records to publish. Each has type, host and value. See DNS records below.

  • dns_records.dkim_pending

    Only during a DKIM upgrade: the new 2048-bit record. Publish it next to the current one.

  • dns_records.*.split_value

    Only for TXT values over 255 characters: the same value already split into quoted strings, for DNS panels that need it.

  • dns_records.mx.priority

    Always 0.

  • spf_duplicate

    true when the domain has more than one SPF record. That is invalid: SPF fails for every receiver until you merge them into one.

  • spf_duplicate_records

    The SPF records found, to help you merge them.

  • dkim

    The DKIM key in use and any upgrade in progress. See DKIM below.

  • dkim.version

    2 for 2048-bit keys, 1 for 1024.

  • dkim.key_size

    The size of the key that signs your emails now.

  • dkim.selector

    The selector of the key in use: the s= in the DKIM-Signature header.

  • dkim.deprecated

    true for 1024-bit keys.

  • dkim.upgrade_pending

    true while a new key waits for its DNS record.

  • dkim.pending

    The new key: selector, key_size, host, full_host, value, split_value, created_at. null when there is no upgrade.

  • dkim.previous_selector

    For 48 hours after an upgrade: the old selector. Keep its record until keep_old_record_until, then you can remove it.

  • dkim.keep_old_record_until

    When the old record can be removed. null when there is nothing to remove.

  • dkim.just_upgraded

    true only on the call that switched to the new key.

How the upgrade works

Your emails are signed with the old key the whole time, until the new one is in the DNS.

  • 1. Start

    This command. The new key goes to dkim.pending and dns_records.dkim_pending (selector sendcorex2).

  • 2. Publish

    Create the dkim_pending TXT record. Keep the old one.

  • 3. Check

    Call Get Domain. As soon as the new record is found, the new key starts signing (dkim.just_upgraded is true on that call).

  • 4. Clean up

    Keep the old record until dkim.keep_old_record_until (48 hours), so emails still in transit keep passing, then remove it.

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have the scope this command needs.

  • CMDINVALID_ARGS

    An argument is invalid: missing or malformed `domain`, `key_size` other than 1024/2048, invalid `email`, a description over 255 characters…

  • CMDDOMAIN_NOT_FOUND

    The domain is not on your account.

  • CMDDKIM_NOT_FOUND

    The domain has no DKIM key.

  • CMDALREADY_UPGRADED

    The domain already uses a 2048-bit key.

  • CMDDKIM_GENERATION_FAILED

    The DKIM key could not be created. Nothing was saved. Try again.

  • CMDRATE_LIMITED

    This command was called too many times in the last minute by your account. Wait a minute.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.