Get Zoho Mail API working (including DRE Connector, Oauth Token, ZUID, ZOID & ACCOUNT_ID)

Get Zoho Mail API working (including DRE Connector, Oauth Token, ZUID, ZOID & ACCOUNT_ID)

Disclaimer: I’m not a professional coder!



Do you need to use Zoho Mail API?


Me too. It lets you do all sorts of things — like reading the complete header of an email, or forwarding an email with its attachments — which is what I wanted to do.


But setting up the API (application programming interface) took me hours.


It didn’t need to, but advice on this forum sent me in circles and, while the Knowledgebase probably has all the information, it’s not easy to determine which are the relevant bits. So…


Maybe this little guide will help you.

       To use Zoho Mail API you need:

a) A working OAuth Token (Open Authorization token)

b) Up to three Zoho IDs — User, Organization, Account

c) Depending on what you want to do, additional IDs for emails, folders, etc


OAUTH TOKEN


The token validates you when you make an API call. There are various ways to create it.

The hard way: it’s possible to create an OAuth token via Developer Space but this requires lots of options to be chosen and the OAuth token needs to be frequently refreshed. This route is intended for developers who are using external apps to link with Zoho.


The easy way, at least for me, was via a custom function in filters — because it’s simple to do, refreshing the OAuth token is handled by Zoho, and creating a custom function is what I was trying to do anyway


If you already have an OAuth token, great. If not, but have already created a custom function, jump to 4 below. Alternatively:


      1)    In Zoho Mail, go to settings/filters

      2)    Create a new filter and, under Actions, select ‘Custom Function’. Zoho help file here.

      3)    Click ‘Select Function’ and create a new function or use an existing one

      4)    Once the custom function is on screen, select ‘DRE Connectors’ (Deluge Runtime Environment) at the top right

      5)    Click ‘Create Connection’ and under ‘Default Services’ choose ‘Zoho OAuth’

      6)    ‘Connection Name’ can be anything you like. It’s the ‘Connection Link Name’ that you will use in your Deluge scripts.

      7)    Chose the ‘Scopes’ of your token. There are zillions of them and they determine what your script can and can’t do. The most basic might be ‘ZohoMail.messages.READ’. The API Guide Index lists every API command and, for each, details what scope you need (e.g. the send an email page shows you’ll need the scope  ZohoMail.messages.ALL or ZohoMail.messages.CREATE). It's good security practice to only use the minimum scope you need.

      8)    After you click ‘Create and Connect’ you should have a working OAuth token with a lowercase ‘link name’ that you can paste into your Deluge scripts.


NB: The OAuth token only applies to the Zoho area where you have your account (Zoho.eu in my case). So, for example, if I cut and paste a snippet into my script from the send an email page: https://mail.zoho.com/api/accounts/{accountId}/messages it will NOT work with my Europe OAuth token. I would need to change the snippet to: https://mail.zoho.eu/api/accounts/{accountId}/messages


GETTING YOUR IDS


Without API

You’ll see from the snippet above that this particular API needs your ‘accountId’ to work. Zoho advises getting your IDs via an API call, but you don't need to:


1)   Zoho User ID (ZUID).  Just log into Zoho and click the ‘My Profile’ icon (top right). Your user ID is right there under your name and email address.

2)  Zoho Organisation ID (ZOID). Open your Zoho Mail Dashboard (remember, this link is for zoho.eu, you’ll need to use your area). Then select ‘Organization’ on the left menu bar to display ‘Organization Info’, including your Zoho Organization ID.

3) Zoho Account ID (ZAID). Select any of your emails in Zoho Mail. Right click and pick 'Open in New Window'. Your Zoho Accound ID is the number following "accId=". (See Zoho's help page to get the message ID of emails — it also shows the accountId.)

With API
Alternatively, you can get all three IDs with one API call: https://mail.zoho.eu/api/accounts (remember to adjust for your area). Help page here for what scope you need for this API call. The call returns a mass of information but buried in it are your Zoho User ID (ZUID), Zoho Organisation ID (ZOID) and Zoho Account ID (ZAID).


So how do I make the API call?

There are various ways but I use a bit of deluge script:

apiUrl = "https://mail.zoho.eu/api/accounts";
response = invokeurl
[
    url :apiUrl
    type :GET
    connection:"your_oauth_token" // the OAuth token you created, in quotes
];
info response;

1) Create a new Zoho Mail custom function and paste in the above script.
2 ) In the function window, click 'Test Run' (top right). You'll be asked for a Message ID.
3) For this script, any message will do. Select any message in your Zoho Mail inbox. Right click and choose 'Open in New Window'. You'll see the Message ID after 'msgId=' in the URL displayed by your browser. See here for visual.
4) Paste the Message ID into the function window and press 'Proceed'. You'll be presented with the heading 'Console' and the result of your API call beneath it, where you'll find the IDs you need after 'zuid=', 'zoid=' and 'accountId='.

FOLDER & EMAIL IDs


      1)    You may be able to use the name of a folder (e.g. “Trash”) in your Deluge script but if you need the folder ID number, either use this API or, even easier, select an email in the folder your interested in, right click and pick 'Open in New Window'. The folder ID comes after 'folId=' in the browser URL.

      2)    All my scripts are triggered by an email by arriving in my inbox. The ID for that current email is held in the variable ‘mail_messageId’.

      3)    For everything else refer to the API Guide Index


Finally, there might be a better way to do any of the above — I did warn you I’m not a pro! — please feel free to add improvements.

    • Topic Participants

    • zoho

    • Sticky Posts

    • Pocket from Mozilla is closing shop. Don’t lose your favorites . Move them to Zoho Mail Bookmarks now! 📥🔖

      The end of Pocket shouldn't mean the end of your important links and content. Easily import them into Zoho Mail's Bookmarks and continue right where you left off. You can bring over your entire Saves, Collections, and tags just the way they are. Bookmarks
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Workplace - Zoholics Europe Customer Awards

      Dear Zoho Mail Community! 📣 We're excited to announce that at this year's Zoholics events across Europe, we're holding customer awards for the first time ever! Workplace - Zoholics Europe Customer Awards This is your chance to shout about the amazing
    • Important update on Group Management | Zoho Mail

      Dear Zoho Mail Community, This post is to inform you all of the following updates on the Group Management in Zoho Mail. Group Member Addition: If a group member is added to an organization group in a Zoho Application, the member will be automatically
    • Mastering email etiquette and best practices to follow in Zoho Mail

      Hello Zoho Mail Community, We’re thrilled to invite you all to our upcoming webinar: Mastering email etiquette and best practices to follow in Zoho Mail. Join our live webinar for expert etiquette tips to enhance your professionalism and elevate your

    Nederlandse Hulpbronnen


      • Recent Topics

      • Require ticket resolution

        Hi Zoho team, Is there a way to require resolution even if an agent did not use a blueprint? for example, our blueprint has a "resolve" transition but what if agent revoked blueprint and manually set the status of ticket to closed? Is there a way where
      • Super Admin Logging in as another User

        How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Moderation Update (8th Aug 2025): We are working
      • Integrate your Outlook/ Office 365 inbox with Zoho CRM via Graph API

        Hello folks, In addition to the existing IMAP and POP options, you can now integrate your Outlook/Office 365 inbox with Zoho CRM via Graph API. Why did we add this option? Microsoft Graph API offers a single endpoint to access data from across Microsoft’s
      • Any way to "Pay with Check" or "Refund with Check" for Credit Notes?

        When we have a Bill in Zoho Books, we can select the "Pay with Check" option which then allows us to print/cut the check directly out of Zoho Books. When we created a Credit Note and want to refund the customer, is there any way to Refund with Check,
      • CRM Mobile reports

        When our engineers finish a job they like to email the customer a job report. This is best done todate as an email template but we can find no way to include an image field from that module. Is there any other options?
      • Items Below Reorder Point Report?

        Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
      • Unify All Zoho Video Meeting Experiences into One Standardized Platform

        Hi Zoho Team, We would like to share an important user experience concern regarding the current state of video meeting functionality across the Zoho ecosystem. The Problem Within Zoho, there are multiple ways to initiate or schedule a video meeting: Zoho
      • When Zoho Tables Beta will be open to EU data center

        Hello all, We in EU are looking at you all using and testing and are getting jealous :) When we will be able to get into the beta also? We don't mind testing and playing with beta software. Thank you!
      • Start Form on a different page (i.e., hide form pages)?

        I have a Zoho form that uses the `Field Alias - Prefill URL` feature. My goal is to have a pre-filled field that directs the user to a specific starting page in the form. For example: The URL will have a field alias that will auto-populate a field with
      • API Pagination Error: 'from' Parameter Limit

        Hello, I am encountering an error while paging through the Zoho Desk API results: Status code: 422 - {"errorCode":"UNPROCESSABLE_ENTITY","message":"The value passed for field 'from' exceeds the range of '0-4999'."} Is 5000 the maximum number of records
      • Prevent new Record Association

        Hello all, We have a small sales organization therefore, it's helpful for everyone on the sales team to be able to view the full list of accounts to assist in preventing duplicate accounts from being created. However we want to prevent people from creating
      • Microsoft Teams now available as an online meeting provider

        Hello everyone, We're pleased to announce that Zoho CRM now supports Microsoft Teams as an online meeting provider—alongside the other providers already available. Admins can enable Microsoft Teams directly from the Preferences tab under the Meetings
      • Standard Payment Term is not pulled from account to quotation

        Hey Team There seems to be something off. I do have "Net 30" as my default payment term in Zoho Books for my customers. If, from the customer overview or quote section, I create a new Quotation, the payment terms field stays blank and doesn't get the
      • Passing the CRM

        Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
      • How can we disable "My Requests"?

        We are not using this functionality in our system at all and our users get confused.
      • Update Subform in specific field(Status) without affecting other fields in Zoho CRM using Deluge?

        Scenario: PRODUCT Module(change name Plot) in any product status change From Available to Booked then on PROJECT Custom Module have Subform So, Subform name is Property Details now in that Subform 1 field is STATUS that update according to  product status
      • PayPal payment received recording problem

        Hi, A little while back one of our customers used the PayPal payment option to pay an invoice For some reason though the payment is showing up twice within the Payments section of the invoice! Instead of setting the invoice value to ZERO, it now shows a negative value Anyone else face this problem? I've checked PayPal and there is only 1 payment in reality... A bug? Actonia ps: for anyone from Zoho Customer Service or tech team,  its Invoice 785 in our account
      • string(87) "{"code":"INVALID_TOKEN","details":{},"message":"invalid oauth token","status":"error"} " grtting this error

        Using access token i am trying to add sales orders through api but it is throwing errors like the above i have mentioned. Please help me for that
      • How to mute chat notification sound by default in Zoho SalesIQ?

        We’ve recently embedded the Zoho SalesIQ chatbot on our website, and we’ve noticed that notification sounds sometimes play even when the visitor hasn’t interacted with the chat widget yet. We’re trying to understand two things: Why do these sounds occur
      • How to Hide Article Links in SalesIQ Answer Bot Responses

        I have published an article in SalesIQ, and the Answer Bot is fetching the data and responding correctly. However, it is also displaying the article link, which I don’t want. How can I remove the link so that only the message is shown?
      • ZOHO CRM App - Open Meetings Option Not Appearing

        Hello. I have a sales rep who's using the Zoho app and says that when he selects the account, the Open Meetings option with the + sign does not appear. It doesn't matter if it's a new account with no previous meetings or an existing account. Any ideas
      • Currency limitation when integrating Zoho CRM & Zoho Books

        Brief Video of Problem: https://www.loom.com/share/d61d1d07d0904e149d80c1901a22418e. Background ·       Our business is based in Australia and we have to have Zoho Books in AUD to comply with tax and reporting regulations in Australia. ·       We sell
      • Add RECURRING option when adding email to calendar events

        When you add an email to a calendar event, there is no option to make that new calendar event into a recurring event.  It is counterproductive to make an event from your email to then have to go to your calendar, find the event, and make it recurring. 
      • Using Contains as a filter

        We are using Zoho Reports, ServiceDesk Plus analytics. I do not see how to create a report filter using Contains comparison of a string values, is one string contained in another. For example, Task Title contains the word Monitor. Is this possible in Zoho Reports?  This reporting feature is available in SDP reporting. Thanks in advance, Craig Rice
      • CRM verify details pop-up

        Was there a UI change recently that involves the Verify Details pop-up when changing the Stage of a Deal to certain things? I can't for the life of me find a workflow or function, blueprint, validation rule, layout rule ect that would randomly make it
      • Applications built with Zoho Creator

        Hi, I’m really interested in seeing how others have built their application using Zoho Creator, especially those designed for external users (clients, vendors, or the public). If you’ve developed something along those lines and don’t mind sharing, I’d
      • LINE Auto Message Connect to Zoho

        When I integrated LINE into the CRM, I was prompted to disable “Chat,” “Auto Response,” and “Greeting Messages,” and to enable the webhook. However, since I have already set up some auto-reply features in LINE, including Rich Messages and greeting automation,
      • Option to block bookings from specific email address or ip adresss in zoho booking

        Sometime few of our client keep booking irrelevant booking service just to resolve their queries and they keep booking it again and again whenever they have queries. Currently its disturbing our current communication process and hierarchy which we have
      • Threaded conversations for emails sent via automation

        Hi Guys, I hope you are doing well. Don't you guys think we should have an option in a workflow to notify users either as a new email or the previous email thread. For example, if you have one deal in the process and there are 10 different stages during
      • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

        The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Managing addresses
      • Create folder is fetch fails

        coming from zapier... zapier has a google drive task that searches for a specific folder in google drive, and if it fails to find the folder it will create a folder based on the search criteria, and contine along the singluar path of the flow. Trying
      • Meetups de Usuarios de Zoho - Noviembre 2025

        ¡Hola, Comunidad! Durante el mes de noviembre celebraremos los Meetups de usuarios de Zoho, encuentros presenciales pensados para quienes queráis mejorar vuestras estrategias de lead nurturing y aprender a sacar el máximo partido a herramientas como Zoho
      • Introducing 7 New Connectors in Zoho DataPrep!

        We’ve just made data management even easier - Zoho DataPrep now supports 7 new external connectors to help you build more robust, scalable ETL pipelines. Why it matters: ✅ Broader data access ✅ More automation, less manual work ✅ Smarter pipelines, better
      • System flaws and lack of response from Zoho

        I have had to go on here as no-one is replying to my emails regarding my problem (been 10 days and no email reply) and your chat facility online through your Zoho Books software opens and closes immediately, so not functioning properly. I actually called
      • How do I increase the email attachment size in Zoho CRM ?

        It looks like I'm limited to 10MB when sending an attachment using the email widget on a record in Zoho CRM. Is there a way to increase the size? Or can I use some other tool? From what I'm reading online, I'm maxed out at 10MB. Any insight would be greatly
      • Sales Order, Invoice and Payment numbers

        Hi zoho friends, it is me again, the slow learner. I'm wondering if there is a way to have it so the Sales order, invoice and payment numbers are all the same? It would be easier for me if they were the same number so there is not so many reference numbers
      • Missing information data Zoho inventory

        there some missing data in Zoho inventory connection. pick list stock counts bin location we have requested it via mail and the support team doesn’t gove feedback. has anyone achieve to get these info or to ask other ya les
      • First day of trying FSM in the field.

        What we found. 1. with out a network connection we were unable to start a service call? 2. if you go to an appointment and then want to add an asset it does not seem possible. 3. disappointed not to be able to actually take a payment from within the app
      • Zoho Desk app update: AI powered features

        Hello everyone! We’ve introduced various AI-powered services on the Zoho Desk app. Let's take a look at what's new. Generate Content: Generate Content uses AI to formulate responses based on the your query and provides a ready-to-use reply which can be
      • Maximum tags possible in Contacts Records

        I read in some documentation that Zoho allows a total of 200 tags across all records. Is this correct? So is it not possible to have one tag per record for 500 records?
      • Next Page