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
optionsDomainsCustomTrackingListOptionsoptional: Optional filter options.namestringoptional: Filter by custom tracking domain label.status"active" | "disabled"optional: Filter by status.scopeDomainsCustomTrackingScopeoptional: Filter by scope (click,open,unsubscribe).limitnumberoptional: Maximum number of domains to return (1–1000). Default: 100.offsetnumberoptional: Number of domains to skip before returning results. Default: 0.
Response
dataobject | nullnullable: List of custom tracking domains matching the filter. Empty if no domains match the filter.customTrackingDomainsDomainsCustomTrackingDomain[]guaranteed: List of custom tracking domains matching the filter criteria.namestringguaranteed: The label for this custom tracking domain.hostnamestringguaranteed: The registered domain hostname.scopeDomainsCustomTrackingScopeguaranteed: The event type this domain handles (click,open,unsubscribe).status"active" | "disabled"guaranteed: Current status of the custom tracking domain.createdAtstringguaranteed: ISO 8601 timestamp when the domain was registered.
totalnumberguaranteed: Total number of custom tracking domains.
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.responseRecord<string, unknown> | nullnullable: An object containing the response, if available. This field may benullif 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
Source • Playground • Docs • Tests