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
domainstringrequired: The domain of the DKIM key to update.optionsDomainsDkimUpdateStatusOptionsrequired: Update DKIM key options.selectorstringrequired: 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 toretired2 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
successbooleanguaranteed: Whether the operation was successful.errorErrorResponse | nullnullable: Error information if the operation failed.messagestringguaranteed: A human-readable description of the error.statusCodenumber | nullnullable: The HTTP status code from the API, ornullif the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.typestringguaranteed: 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
Source • Playground • Docs • Tests