Skip to content

List Custom Tracking Domains method 🌐 Domains

Retrieve all custom tracking domains registered under your account. Optional filters include domain name, status, scope, limit and offset.

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.customTracking.list({
  status: 'active'
})
ts
import { MailChannels } from 'mailchannels-sdk'

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

const { data, error } = await mailchannels.domains.customTracking.list({
  status: 'active'
})

Params

  • options DomainsCustomTrackingListOptions optional: Optional filter options.
    • name string optional: Filter by custom tracking domain label.
    • status "active" | "disabled" optional: Filter by status.
    • scope DomainsCustomTrackingScope optional: Filter by scope (click, open, unsubscribe).
    • limit number optional: Maximum number of domains to return (1–1000). Default: 100.
    • offset number optional: Number of domains to skip before returning results. Default: 0.

Response

  • data object | null nullable: List of custom tracking domains matching the filter. Empty if no domains match the filter.
    • customTrackingDomains DomainsCustomTrackingDomain[] guaranteed: List of custom tracking domains matching the filter criteria.
      • name string guaranteed: The label for this custom tracking domain.
      • hostname string guaranteed: The registered domain hostname.
      • scope DomainsCustomTrackingScope guaranteed: The event type this domain handles (click, open, unsubscribe).
      • status "active" | "disabled" guaranteed: Current status of the custom tracking domain.
      • createdAt string guaranteed: ISO 8601 timestamp when the domain was registered.
    • total number guaranteed: Total number of custom tracking domains.
  • 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.
    • response Record<string, unknown> | null nullable: An object containing the response, if available. This field may be null if no response is available or if the error is not related to an HTTP request or if the response is not a JSON object.

Type declarations

Signature

ts
async function list (options?: DomainsCustomTrackingListOptions): Promise<DomainsCustomTrackingListResponse>

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;
};

Custom Tracking Domain type declarations

ts
type DomainsCustomTrackingScope = "click" | "open" | "unsubscribe";
ts
interface DomainsCustomTrackingDomain {
  name: string;
  hostname: string;
  scope: DomainsCustomTrackingScope;
  status: "active" | "disabled";
  createdAt: string;
}

List Custom Tracking Domains response type declarations

ts
interface DomainsCustomTrackingListOptions {
  name?: string;
  status?: "active" | "disabled";
  scope?: DomainsCustomTrackingScope;
  limit?: number;
  offset?: number;
}
ts
type DomainsCustomTrackingListResponse = DataResponse<{
  customTrackingDomains: DomainsCustomTrackingDomain[];
  total: number;
}>;

Source

SourcePlaygroundDocsTests

Released under the MIT License.