Get your free beta license ↗
API operation · mail group
POST

/domains/{name}/mail/dkim/rotate

First published 3 Oct 20260.1.0Unchanged since publication

Rotate the domain's DKIM key

Who may call it
AdministratorResellerCustomer
Token scope, any of
mailall
Answers200 OK

UrbeStack creates a DKIM key under a dated selector and starts signing with it immediately. For example, the first rotation on that date uses s20260915, the second uses s20260915a, and further rotations that day continue with suffixes.

The previous selector's DNS record stays in the zone until the next rotation so mail in transit can still be verified. UrbeStack removes older selector records. The 200 response includes name, selector, previous, retired and record in dkim. Use record to publish the new DNS record at your DNS provider if DNS is hosted elsewhere.

Administrators, the customer who owns the domain and that customer's reseller can call this operation with a token that has the mail scope.

As a command

Run as root on the server

Parameters

namepath ·DomainNameRequired

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/domains/example.com/mail/dkim/rotate" \
  -H "Authorization: Bearer $TOKEN"
Response · 200 OK
{
  "dkim": {
    "name": "alice",
    "previous": "text",
    "record": {},
    "retired": [
      "text"
    ],
    "selector": "text"
  }
}

Errors

14 errors, each a status and a sentence
400--name is required
400<name> routes its mail elsewhere; there is nothing to sign
400<what> must be text without control characters, 1 to <max> characters
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid domain name
400Invalid port
400Invalid setting key
400The mail stack is not installed on this server
401Authentication required
404Setting '<key>' not found
409Too many rotations today
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-domains-name-mail-dkim-rotate/