List DKIM Keys method 🌐 Domains
Search for DKIM keys by domain, with optional filters. If selector is provided, at most one key will be returned.
Usage
ts
import { MailChannelsClient, Domains } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const domains = new Domains(mailchannels)
const { data, error } = await domains.dkim.list('example.com', {
includeDnsRecord: true
})ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { data, error } = await mailchannels.domains.dkim.list('example.com', {
includeDnsRecord: true
})Params
domainstringrequired: The domain to get the DKIM keys for.optionsDomainsDkimListOptionsoptional: Optional filter options.selectorstringoptional: Selector to filter keys by. Must be a maximum of 63 characters.status"active" | "revoked" | "retired" | "rotated"optional: Status to filter keys by.TIP
Possible values:
active,revoked,retired,rotated.offsetnumberoptional: Number of results to skip from the start. Must be a positive integer. Defaults to0.limitnumberoptional: Maximum number of keys to return. Maximum is100and minimum is1. Defaults to10.includeDnsRecordbooleanoptional: Iftrue, includes the suggested DKIM DNS record for each returned key. Defaults tofalse.
Response
dataOptional<DomainsDkimKey, "dnsRecords">[] | nullnullable: List of keys matching the filter. Empty if no keys match the filter.algorithmstringguaranteed: Algorithm used for the key pair.createdAtstringoptional: Timestamp when the key pair was created.dnsRecordsobject[]optional: Suggested DNS records for the DKIM key. Only included ifincludeDnsRecordistrue.namestringguaranteedtypestringguaranteedvaluestringguaranteed
domainstringguaranteed: Domain associated with the key pair.gracePeriodExpiresAtstringoptional: UTC timestamp after which you can no longer use the rotated key for signing.length1024 | 2048 | 3072 | 4096guaranteed: Key length in bits.publicKeystringguaranteedretiresAtstringoptional: UTC timestamp when a rotated key pair is retired.selectorstringguaranteed: Selector assigned to the key pair.status"active" | "revoked" | "retired" | "rotated"guaranteed: Status of the key.statusModifiedAtstringoptional: Timestamp when the key was last modified.
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 list (domain: string, options?: DomainsDkimListOptions): Promise<DomainsDkimListResponse>Response type declarations
ts
interface ErrorResponse {
message: string;
statusCode: number | null;
type: ErrorType;
}ts
type DataResponse<T> = {
data: T;
error: null;
} | {
data: null;
error: ErrorResponse;
};DKIM key type declarations
ts
type DomainsDkimKeyStatus = "active" | "retired" | "revoked" | "rotated";ts
interface DomainsDkimKey {
algorithm: string;
createdAt?: string;
dnsRecords: {
name: string;
type: string;
value: string;
}[];
domain: string;
gracePeriodExpiresAt?: string;
length: 1024 | 2048 | 3072 | 4096;
publicKey: string;
retiresAt?: string;
selector: string;
status: DomainsDkimKeyStatus;
statusModifiedAt?: string;
}List DKIM Keys type declarations
ts
interface DomainsDkimListOptions {
selector?: string;
status?: DomainsDkimKey["status"];
offset?: number;
limit?: number;
includeDnsRecord?: boolean;
}ts
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;ts
type DomainsDkimListResponse = DataResponse<Optional<DomainsDkimKey, "dnsRecords">[]>;Source
Source • Playground • Docs • Tests