🚫 Suppressions module Email API
Manage your MailChannels account suppressions list.
Methods
Type declarations
ts
class Suppressions {
constructor (protected mailchannels: MailChannelsClient);
async create (entries: SuppressionsCreateEntry[], options?: Omit<SuppressionsCreateOptions, "entries">): Promise<SuccessResponse>;
async delete (recipient: string, source?: SuppressionsSource): Promise<SuccessResponse>;
async list (options?: SuppressionsListOptions): Promise<SuppressionsListResponse>;
}All type declarations
Response type declarations
ts
interface ErrorResponse {
message: string;
statusCode: number | null;
type: ErrorType;
response: Record<string, unknown> | null;
}ts
type DataResponse<T> = {
data: T;
error: null;
} | {
data: null;
error: ErrorResponse;
};ts
interface SuccessResponse {
success: boolean;
error: ErrorResponse | null;
}Create type declarations
ts
type SuppressionsTypes = "transactional" | "non-transactional";ts
interface SuppressionsCreateOptions {
addToSubAccounts?: boolean;
/** @deprecated Use `create(entries, options?)` instead. */
entries: SuppressionsCreateEntry[];
}ts
interface SuppressionsCreateEntry {
notes?: string;
recipient: string;
types?: SuppressionsTypes[];
}List type declarations
ts
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";ts
interface SuppressionsListOptions {
recipient?: string;
source?: Exclude<SuppressionsSource, "all">;
createdBefore?: string | Date;
createdAfter?: string | Date;
limit?: number;
offset?: number;
}ts
interface SuppressionsListEntry {
createdAt: string;
notes?: string;
recipient: string;
sender?: string;
source: SuppressionsSource;
types: SuppressionsTypes[];
}ts
type SuppressionsListResponse = DataResponse<SuppressionsListEntry[]>;Source
Source • Playground • Docs • Tests