Skip to content

Delete Custom Tracking Domain method 🌐 Domains

Permanently delete an existing custom tracking domain for the given hostname and scope. The domain can be re-registered if needed.

WARNING

Any tracking links or unsubscribe URLs in previously sent emails using this domain will stop working immediately.

Usage

ts
import { MailChannelsClient, Domains } from 'mailchannels-sdk'

const mailchannels = new MailChannelsClient('your-api-key')
const domains = new Domains(mailchannels)

const { success, error } = await domains.customTracking.delete('click.example.com', 'click')
ts
import { MailChannels } from 'mailchannels-sdk'

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

const { success, error } = await mailchannels.domains.customTracking.delete('click.example.com', 'click')

Params

  • hostname string required: The hostname of the custom tracking domain to delete.
  • scope DomainsCustomTrackingScope required: The scope of the custom tracking domain to delete (click, open, unsubscribe).

Response

  • success boolean guaranteed: Whether the operation was successful.
  • 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 delete (hostname: string, scope: DomainsCustomTrackingScope): Promise<SuccessResponse>

Response type declarations

ts
interface ErrorResponse {
  message: string;
  statusCode: number | null;
  type: ErrorType;
  response: Record<string, unknown> | null;
}
ts
interface SuccessResponse {
  success: boolean;
  error: ErrorResponse | null;
}

Custom Tracking Domain type declarations

ts
type DomainsCustomTrackingScope = "click" | "open" | "unsubscribe";

Source

SourcePlaygroundDocsTests

Released under the MIT License.