Skip to content

Update DKIM Key Status method 🌐 Domains

Update fields of an existing DKIM key pair for the specified domain and selector, for the current customer. Currently, only the status field can be updated.

Usage

ts
import { MailChannelsClient, Domains } from 'mailchannels-sdk'

const mailchannels = new MailChannelsClient('your-api-key')
const domains = new Domains(mailchannels)

const { success, error } = await domains.dkim.updateStatus('example.com', {
  selector: 'mailchannels',
  status: 'retired'
})
ts
import { MailChannels } from 'mailchannels-sdk'

const mailchannels = new MailChannels('your-api-key')

const { success, error } = await mailchannels.domains.dkim.updateStatus('example.com', {
  selector: 'mailchannels',
  status: 'retired'
})

Params

  • domain string required: The domain of the DKIM key to update.
  • options DomainsDkimUpdateStatusOptions required: Update DKIM key options.
    • selector string required: Selector of the DKIM key to update. Must be a maximum of 63 characters.
    • status "revoked" | "retired" | "rotated" required: New status of the DKIM key pair.

      TIP

      Possible values: revoked, retired, rotated.

      • revoked: Indicates that the key is compromised and should not be used.
      • retired: Indicates that the key has been rotated and is no longer in use.
      • rotated: Indicates that the key is going through the rotation process. Only active key pairs can be updated to this status, and no new key pair is created. The rotated key can be used to sign emails for 3 days after the status update, and will automatically change to retired 2 weeks after update. For a smooth key transition, it is recommended to create and publish a new key pair before signing is disabled for the rotated key.

Response

  • success boolean guaranteed: Whether the operation was successful.
  • error ErrorResponse | null nullable: Error information if the operation failed.
    • message string guaranteed: A human-readable description of the error.
    • statusCode number | null nullable: The HTTP status code from the API, or null if the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.
    • type string guaranteed: A string identifier for the type of error. This field is intended for diagnostic use only and should not be relied upon.

Type declarations

Signature

ts
async function updateStatus (domain: string, options: DomainsDkimUpdateStatusOptions): Promise<SuccessResponse>

Response type declarations

ts
interface ErrorResponse {
  message: string;
  statusCode: number | null;
  type: ErrorType;
}
ts
interface SuccessResponse {
  success: boolean;
  error: ErrorResponse | null;
}

DKIM key type declarations

ts
type DomainsDkimKeyStatus = "active" | "retired" | "revoked" | "rotated";

Update DKIM Key type declarations

ts
interface DomainsDkimUpdateStatusOptions {
  selector: string;
  status: Exclude<DomainsDkimKey["status"], "active">;
}

Source

SourcePlaygroundDocsTests

Released under the MIT License.