> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailchannels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Custom Tracking Domains

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




## OpenAPI

````yaml /email-api/api-reference/openapi.yaml get /custom-tracking-domains
openapi: 3.0.0
info:
  contact:
    email: support@mailchannels.com
    name: MailChannels Corporation
  description: >
    This is the API reference for Email API. Here, you'll find more detailed
    information on every endpoint, including parameters, response formats, and
    error codes.
  title: Email API
  version: 1.7.1
servers:
  - url: https://api.mailchannels.net/tx/v1
security: []
tags:
  - name: Send
  - name: DKIM
  - name: Metrics
  - name: Sub-accounts
  - name: Suppression
  - name: Webhooks
  - name: Usage
  - name: Custom Tracking
paths:
  /custom-tracking-domains:
    get:
      tags:
        - Custom Tracking
      summary: Retrieve Custom Tracking Domains
      description: |
        Retrieve all custom tracking domains registered under your account.
        Optional filters include domain name, status, scope, limit and offset.
      parameters:
        - description: Filter by custom tracking domain label
          in: query
          name: name
          required: false
          schema:
            type: string
        - description: Filter by status
          in: query
          name: status
          required: false
          schema:
            enum:
              - active
              - disabled
            type: string
        - description: Filter by scope
          in: query
          name: scope
          required: false
          schema:
            enum:
              - click
              - open
              - unsubscribe
            type: string
        - description: The maximum number of domains to return. The default is 100.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            type: integer
        - description: >-
            The number of domains to skip before returning results. The default
            is 0.
          in: query
          name: offset
          required: false
          schema:
            default: 0
            minimum: 0
            type: integer
        - in: header
          name: X-Api-Key
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomTrackingDomainListResponse'
          description: Response with the list of custom tracking domains
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid query parameter value
        '500':
          description: Internal server error
      x-codeSamples:
        - label: Node.js
          lang: javascript
          source: >-
            import { MailChannels } from "mailchannels-sdk";


            const { MAILCHANNELS_API_KEY } = process.env;

            if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY
            before running");


            const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);


            const { data, error } = await
            mailchannels.domains.customTracking.list();


            if (error) {
              console.error("List custom tracking domains failed:", error);
              process.exit(1);
            }

            console.log(data);
        - label: Python
          lang: python
          source: |-
            import os
            import sys

            import mailchannels

            if not os.environ.get("MAILCHANNELS_API_KEY"):
                sys.exit("Set MAILCHANNELS_API_KEY (parent or sub-account) before running")

            # Retrieve custom tracking domains registered under the account.
            response = mailchannels.CustomTrackingDomains.list()

            print(response)
        - label: PHP
          lang: php
          source: >-
            <?php


            require_once __DIR__ . '/vendor/autoload.php';


            use MailChannels\Client;


            $api_key = getenv('MAILCHANNELS_API_KEY') or exit("Error:
            MAILCHANNELS_API_KEY is not set\n");


            $client = new Client(apiKey: $api_key);


            // Retrieve custom tracking domains registered under the account.

            $response = $client->customTrackingDomains->list();


            print_r($response->toArray());
components:
  schemas:
    CustomTrackingDomainListResponse:
      properties:
        custom_tracking_domains:
          description: List of custom tracking domains matching the filter criteria
          items:
            $ref: '#/components/schemas/CustomTrackingDomain'
          type: array
        total:
          description: Total number of custom tracking domains
          type: integer
      required:
        - custom_tracking_domains
        - total
      type: object
    ErrorResponse:
      properties:
        errors:
          description: >
            This is an array error objects that provide machine and human
            readable descriptions of the errors.
          items:
            type: string
          type: array
      type: object
    CustomTrackingDomain:
      properties:
        created_at:
          description: ISO 8601 timestamp when the domain was registered
          format: date-time
          type: string
        hostname:
          description: The registered domain hostname
          type: string
        name:
          description: The label for this custom tracking domain
          type: string
        scope:
          description: The event type this domain handles
          enum:
            - click
            - open
            - unsubscribe
          type: string
        status:
          description: Current status of the custom tracking domain
          enum:
            - active
            - disabled
          type: string
      required:
        - name
        - hostname
        - scope
        - status
        - created_at
      type: object

````