Authentication

The CLI tool uses REST API to perform operations on mail. By default, US DC (zoho.com) is used for API calls. To use the accounts from different DC like zoho.eu or zoho.in, use the login command with the DC option as given below:

Login to specific DC

Copiedzmail:>login --dc zoho.eu

Output

CopiedAccess this url in your browser => https://accounts.zoho.eu/oauth/v2/auth?client_id=****.A1TUVF0JPZUKSMNXAHNEZGJ8S6WF4U&redirect_uri=http://localhost:*****/oauth/callback&scope=ZohoMail.accounts.ALL,ZohoMail.organization.accounts.ALL,ZohoMail.messages.ALL,ZohoMail.attachments.ALL,ZohoMail.tags.ALL,ZohoMail.folders.ALL,ZohoMail.tasks.ALL,ZohoMail.notes.ALL,ZohoMail.links.ALL,ZohoMail.settings.ALL,ZohoMail.search.ALL,ZohoMail.organization.subscriptions.ALL,ZohoMail.organization.domains.ALL,ZohoMail.organization.policy.ALL,ZohoMail.organization.audit.ALL,ZohoMail.organization.groups.ALL,ZohoMail.partner.organization.ALL&response_type=*****************&prompt=consent

Access the displayed URL in your browser to login.

To display the account details of the user, such as Account Id, Display Name, and Email Address, in a specific DC, run the below command:

Command to display user account details from a specific DC

Copiedzmail:>account list --dc zoho.com

Output

Copied+---------------------+--------------+--------------------------+
| Account Id          | Display Name | Email Address            |
+---------------------+--------------+--------------------------+
| 8****************2 | johnm        | johnm@zylkertraining.com |
+---------------------+--------------+--------------------------+

Note:

You can change the desired DC as zoho.in or zoho.eu accordingly. Refer to know the available DC values.

Changing DCs with every command is tiresome. You can change the default DC to the required DC of your need with the switch user command.

Command to switch user

Copiedzmail:>auth switch-user --dc zoho.com --zuid 7******5

To list all the DC authentications that you have, run the below command:

Authentication command

Copiedzmail:>auth list

Output

Copied+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
| DC       | Zuid      | Stored Time                           | Refresh Token                                              | Access Token                                               |
+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
| zoho.com | 7******5 | 05-Mar-2026 11:50:52 (1772734852420)  | dhKt3mTNCOZEg0tEhoR9icNaXV2ifiz86qKpDP4Dufl7241bHLPqde2cx/ | PxImJxghogVS8UQkZV3A5YdwInjVncDE6cQG74GSgstnGWqPiHDEiu86aQ |
|          |           |                                       | bbDwkmRi2K7J18prIq+aOT+iyoXiqLzm1dnw6Udc5/EvOr0z0=:=:=:cX1 | pPP+ZvmKl4SiBc/D1OuTYE2hR9XKc2MNYyM7/zUIASqPfDgXs=:=:=:N5L |
|          |           |                                       |         xsjqRBUNkZ30rQI2eFg==:=:=:UPX13MkoUxXk+b2WbR2TWg== |         YvZJMHVgOo9YtAIwscA==:=:=:sI+fwP4LZ6k/r8DkEtJYkA== |
+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------

By default, the refresh and access tokens are displayed in the encrypted format. Run the below command to decrypt the tokens:

Command to decrypt

Copiedzmail:>auth list --decrypt

Output

Copied+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
| DC       | Zuid      | Stored Time                           | Refresh Token                                              | Access Token                                               |
+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------+
| zoho.com | 7******5 | 05-Mar-2026 11:50:52 (1***********0)  | 10*****************************************97 | 10**************************************d53 |
|          |           |                                       |                                               8**********3 |                                               f********2 |
+----------+-----------+---------------------------------------+------------------------------------------------------------+------------------------------------------------------------+

Once the command is run, the decrypted tokens are displayed along with the DC, Zuid, and Stored Time.