Skip to content

🚫 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

SourcePlaygroundDocsTests

Changelog

  • v1.3.0 on Jul 6, 2026

    • c85e5b1 refactor(suppressions): deprecate create entries option and use as positional param
  • v1.1.0 on Jun 12, 2026

    • 5a34b8a fix: encode path params in all api requests
    • b2cf377 refactor: restructure modules into module directories
    • b86dc89 refactor: replace formatDateInput with parseDateInputs
    • f5477f8 feat(suppressions): accept Date object for list date filters
  • v1.0.0 on May 26, 2026

    • f49c49f feat(errors): introduce error type keys
  • v0.8.0 on May 23, 2026

    • ab66dc1 refactor: split internal utils into focused modules

Released under the MIT License.