If you want to change the cpanel hosting account domain name using SSH or whmapi then you can run below command.

whmapi1 modifyacct user=username domain=newdomain.com

Replace username with actual username and domain name with the domain name which you want to change.

It will show output like below

[root@ ]# whmapi1 modifyacct user=username domain=younewdomain.com
--- 
data: 
  cpuser: 
    BACKUP: 1
    BWLIMIT: 0
    CHILD_WORKLOADS: ''
    CONTACTEMAIL: [email protected]
    CONTACTEMAIL2: ''
    CREATED_IN_VERSION: 11.98.0.6
    DBOWNER: username
    DEADDOMAINS: 
      - younewdomain.com
    DEMO: 0
    DISK_BLOCK_LIMIT: 0
    DOMAIN: younewdomain.com
    DOMAINS: 
  
    FEATURE-AUTOSSL: 1
    FEATURELIST: default
    HASCGI: 1
    HASDKIM: 1
    HASSPF: 1
    HOMEDIRLINKS: []

    IP:  
    LEGACY_BACKUP: 0
    LOCALE: en
    MAILBOX_FORMAT: maildir
    MAXADDON: unlimited
    MAXFTP: unlimited
    MAXLST: unlimited
    MAXPARK: unlimited
    MAXPASSENGERAPPS: 4
    MAXPOP: unlimited
    MAXSQL: unlimited
    MAXSUB: unlimited
    MAX_DEFER_FAIL_PERCENTAGE: unlimited
    MAX_EMAILACCT_QUOTA: unlimited
    MAX_EMAIL_PER_HOUR: unlimited
    MTIME: '1644149759'
    MXCHECK-younewdomain.com: 0
    OWNER: root
    PLAN: Advanced
    PUSHBULLET_ACCESS_TOKEN: ''
    RS: paper_lantern
    SSL_DEFAULT_KEY_TYPE: system
    STARTDATE: '1630740037'
    USER: username
    UTF8MAILBOX: 1
    _PACKAGE_EXTENSIONS: magicspam
    __CACHE_DATA_VERSION: '0.82'
    notify_account_authn_link: 1
    notify_account_authn_link_notification_disabled: 1
    notify_account_login: 0
    notify_account_login_for_known_netblock: 0
    notify_account_login_notification_disabled: 1
    notify_bandwidth_limit: 1
    notify_contact_address_change: 1
    notify_contact_address_change_notification_disabled: 1
    notify_disk_limit: 1
    notify_password_change: 1
    notify_password_change_notification_disabled: 1
    notify_ssl_expiry: 1
  domain: younewdomain.com
  setshell: unmodified
  user: username
metadata: 
  command: modifyacct
  output: 
    messages: 
      - "Ok\n"
      - "Ok\n"
      - "usernamegn.sa => deleted from server. \n"
      - "LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for younewdomain.com's mail.: This configuration has been manually selected.\n"
      - Horde user data updated.
      - Domain name changed
      - Updating /etc/domainips, /etc/pure-ftpd
      - Restarting apache
    warnings: []

  reason: Account Modified
  result: 1
  version: 1

If you want to cross verify it from SSH then run below command

root@]# whmapi1 accountsummary user=username
--- 
data: 
  acct: 
    - 
      backup: 1
      child_nodes: []

      disklimit: unlimited
      diskused: 112M
      domain: yourdomain.com
      email: [email protected]
      inodeslimit: unlimited
      inodesused: 93
      ip: 
      ipv6: []

      is_locked: 0
      legacy_backup: 0
      mailbox_format: maildir
      max_defer_fail_percentage: unlimited
      max_email_per_hour: unlimited
      max_emailacct_quota: unlimited
      maxaddons: unlimited
      maxftp: unlimited
      maxlst: unlimited
      maxparked: unlimited
      maxpop: unlimited
      maxsql: unlimited
      maxsub: unlimited
      min_defer_fail_to_trigger_protection: 5
      outgoing_mail_hold: 0
      outgoing_mail_suspended: 0
      owner: root
      partition: home1
      plan: 
      shell: /usr/local/cpanel/bin/noshell
      startdate: 21 Sep 04 12:50
      suspended: 0
      suspendreason: not suspended
      suspendtime: 0
      temporary: 0
      theme: paper_lantern
      uid: 1523
      unix_startdate: '1630740037'
      user: username
metadata: 
  command: accountsummary
  reason: OK
  result: 1
  version: 1
[root@ ]#