#7295·nango

Zoho Mail generates an invalid API host for Canadian accounts

Author: LevSky22Created Aug 29, 2026Updated Sep 28, 2026
LabelsStale

Problem

The built-in zoho-mail provider cannot proxy normal API requests for accounts hosted in Zoho's Canadian data centre.

The provider currently builds its Mail API base URL as:

https://mail.zoho.${connectionConfig.extension}

With the Canadian data-centre extension ca, this becomes https://mail.zoho.ca. That hostname is not the Canadian Zoho Mail API: it serves an unrelated website and returns HTML/404 responses for Mail API paths.

Zoho documents the Canadian Mail API base URI as https://mail.zohocloud.ca and the Canadian Accounts/OAuth server as https://accounts.zohocloud.ca.

Reproduction

Using a valid, read-only Canadian Zoho Mail OAuth connection:

  • GET /api/accounts through the provider-generated https://mail.zoho.ca base returned HTTP 404 with HTML from an unrelated site.
  • The same request and OAuth token with a temporary base-url-override: https://mail.zohocloud.ca returned HTTP 200 and the expected Zoho Mail API response.
  • Sending the same regional token to the US Mail host returned 401 INVALID_OAUTHTOKEN, confirming that the Canadian service host is required.

No account, connection, mailbox, or credential identifiers are included here.

Root cause

The Mail provider assumes every Zoho data-centre code can be appended to mail.zoho.. Canada is an exception: the data-centre code remains ca, but both the Mail and Accounts hosts use zohocloud.ca.

Adding only ca to the current enum would therefore preserve the broken mail.zoho.ca result. Changing the extension itself to zohocloud.ca would also be incorrect because it would produce malformed hosts in shared Zoho OAuth/API templates.

Suggested fix

A backward-compatible provider fix can:

  • accept and label ca in the zoho-mail connection configuration;
  • map only the resolved Mail base https://mail.zoho.ca to https://mail.zohocloud.ca;
  • map the Canadian authorization host to accounts.zohocloud.ca;
  • prefer the existing accounts-server redirect metadata for token exchange, retaining the extension-based fallback for stored non-Canadian connections;
  • leave US, EU, India, Australia, China, and Japan unchanged; and
  • document the Canadian host exception.

I have a focused implementation with regression coverage proving Canada resolves to mail.zohocloud.ca, US/EU remain unchanged, the schema accepts ca, and the existing Accounts redirect-metadata path still works. I can submit it as a PR if maintainers would like one.

Official Zoho documentation

Related Nango OAuth metadata support: #4804