Kaizen 200 - OAuth and Token Management using Zoho CRM Python SDK

Kaizen 200 - OAuth and Token Management using Zoho CRM Python SDK



We’re incredibly excited to bring you the 200th post in our Kaizen series!

Idea
This journey has been as much about listening as it has been about sharing. And today, we’re making both count. Over the past few weeks, we’ve collected your feedback through the Kaizen feedback form added in our earlier posts. Thank you for the time and thought you’ve put into it.

Starting today, we’ll be actively addressing your most requested topics. 

Overview – OAuth 2.0 and Zoho CRM SDKs

In this Kaizen, we’ll walk you through how OAuth 2.0 authentication is handled using the Zoho CRM Python SDK, and how the SDK simplifies token refresh, storage, and management for multiple users and organizations across multiple data centers.

Introduction:


OAuth2.0 Recap:



Token Management using Zoho CRM SDKs:


Sample Project Overview

We’ve used a fully working sample project to demonstrate the OAuth flow in action.

Frontend

A static interface built using HTML, CSS, and JavaScript.
Files include:
  • index.html – login and data input page
  • script.js – client-side login and record handling
  • redirect.html – used to capture the grant token from Zoho

Backend

A Python server using Zoho CRM SDK to:
  • Authenticate users using OAuth 2.0
  • Store and manage tokens
  • Fetch and manipulate CRM records

Note:

Before running the project, you’ll need to register your client in the Zoho API Console. Once registered, use the generated Client ID and Client Secret in your server code.
If you're planning to support users across multiple Zoho Data Centers (DCs):
  • Be sure to enable Multi-DC for your client.
  • Use the same client credentials (Client ID and Secret) for all the DCs during authentication.

Implementation Demo:

How the SDK Maps Tokens to Users

One of the key challenges in multi-user apps is ensuring that each user's tokens are stored and retrieved correctly. The Zoho CRM Python SDK handles this automatically.
As part of the OAuth flow, the SDK retrieves the user's email and organization info in the background using the scopes ZohoCRM.users.READ and ZohoCRM.org.READ. It then uses this unique user–org combination to:
  • Store access and refresh tokens separately for each user
  • Automatically update tokens when a user logs in again
  • Ensure that all API calls are authorized with the correct tokens
If you're implementing Login with Zoho using the standard OAuth redirect flow, all of this is handled internally by the SDK using the user and org information retrieved during login. There’s no need to manually pass a UserSignature in the token object.
 
If you're not implementing Login with Zoho, or if you’d prefer to explicitly associate a token with a known user, you can pass a UserSignature object during initialization:
  1. from zohocrmsdk.src.com.zoho.api.authenticator import UserSignature

    user = UserSignature(email)
    token = OAuthToken(..., user_signature=user)
    Initializer.initialize(..., user=user)
This ensures the SDK can correctly identify the token's owner and separate tokens for different users or orgs in a multi-user application.

Multi-User & Multi-DC Token Management


Authentication can often be one of the trickiest parts of any integration, especially when you're dealing with multiple users, environments, and token refresh cycles. With the Zoho CRM SDKs, much of that complexity is handled for you, from generating and persisting tokens, to refreshing them silently when they expire, and managing user-org mappings behind the scenes.

We hope this Kaizen gave you a clearer picture of how to use our SDKs confidently in your apps. Try out the project, play around, and see how it all works in real time. 

If you have any queries, let us know the comments below, or send an email to support@zohocrm.com. We'd love to hear from you.


    • Sticky Posts

    • Kaizen #197: Frequently Asked Questions on GraphQL APIs

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Client Script | Update - Introducing Commands in Client Script!

      Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands
    • Recent Topics

    • Zoholics Europe 2025: Your Ultimate Data Analysis (Zoho Analytics) Workshop Experience

      Why should you attend? This year, Zoholics Europe 2025 is putting data analysis centre stage. With a dedicated workshop designed to answer all your data-related questions, you’ll gain practical skills, real-time solutions, and expert insights that you
    • how i can update client_secret or refresh_token in case if my was stolen?

      i want to know how i can protect my data on this case
    • [Webinar] CoCreator – Generative AI-Assisted Application Development in Zoho Creator

      Hello Creators! The Zoho Developer Community is hosting a webinar on CoCreator – Generative AI-Assisted Application Development to showcase our latest AI capabilities. What's this about? It's all about our latest AI capabilities in Zoho Creator. Instead
    • custom fields not populating from deluge script into invoice

      Hello, I've created some Deluge script that is meant to take a few inputted invoice custom fields and calculate a few others. I can see when I execute the function that my inputted custom fields are being passed, yet im still ending up with all "null"
    • Using English But Dropdowns in Thai

      We have selected English in Settings but all of the dropdown boxes are in Thai. How do i change this? The organization is based in Thailand and we are using the THB as our currency, but need the dropdowns to be in English. Please help! 🙏
    • Introducing Import Contract API

      We are excited to introduce the Import Contract API in Zoho Contracts. Here's a brief overview: Import Contract API The Import Contract API allows you to import contracts directly into Zoho Contracts in any of the following states: Draft Signed Active
    • Cambio de Plane

      Tenia un plan gratuito, hice una actualización a un plan de pago, salí por completo y entre nuevamente, pero no me deja corregir, pagar o modificar las facturas que había realizado en el modo de prueba. Me da el siguiente error: Factura de proveedor se
    • Better integration between Zoho CRM and Zoho Bookings

      I've noticed that when a meeting which was created in Zoho Bookings is updated by a sales person in Zoho CRM, the change is not reflected back into Zoho Bookings. I have raised this with support who advised that meetings created in Bookings need to be
    • Why is there a limit to JSONString of less 100 characters

      having this problem.
    • Enhanced crash reporting in Zoho Apptics

      All app crashes have the same sad ending: The app dies while the user still wants to use it. But the reason behind each crash? They vary every time. Identifying the root cause and fixing it is already hard work for your dev team. What makes it harder?
    • Description column in the "all expenses" overview page?

      Hi! I'm new to Zoho Books and accounting. I'm surprised there doesn't seem to have a proper "description" field for the expenses, only "notes", and that I can't have such a description visible on the overview page. So that I can quickly visualize my expenses...
    • Only Default Administrator Profile can Convert Estimates Zoho Finance

      In Zoho Finance Only the Default Administrator Profile can convert the Estimates A different Profile with the Admin level permission cannot convert the Estimate of someone else to a Sales Order, Only and only the default Administrator Profile Why is that
    • Zoho Notebook suddenly running very slow on long notes

      I have been a longtime user of Zoho Notebook. Historically, it has run quite well, but I've noticed over the last few days that it has begun to run unbearably slow when typing in large notes, to the point where I can type four words and have to wait for
    • Is there a way to pass the source of the chat from SalesIQ to the CRM lead creation?

      Currently when I update the values of the visitor and the lead is automatically generated in the CRM it says that the lead source is Chat, but in reality it was from either Facebook, Instagram or WhatsApp. Is there a way to make sure that the correct
    • Imported tasks

      Good afternoon, I have recently setup a test instance of Zoho CRM and am currently working through a data migration from Hubspot usine the API migration tool. I needed to get a feel for how seamless this process was but I am running into an issue. It
    • Assigning Leads to Queues

      Do you support Queues as Lead Owner? This is a basic function in any CRM. Assign Lead to a Queue group where any member can take ownership by him self.
    • Migration of emails from Yandex to Zoho

      I am trying to migrate an yandex mail account to zoho mail account. I am confused with all the related articles/informations in the net. Could someone please outline the process to do it, just thinking about me as a novice with limited knowledge or experience. A couple of questions from the knowledge gained. 1. I believe we have to delete the yandex current MX from the website records and add Zoho MX. What happens to the emails as we remove the mail exchange record. Yandex stops updating emails and
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Zoho Sheets working offline

      Hi, I am looking for the ability to work offline in Zoho Sheets, but currently I cannot find the process to complete this. Does someone have any ideas or steps I might have missed? Also does Zoho Sheets have the "Format as Tables" function as is currently
    • Fetching whole month availability via API

      We are currently building a custom calendar component that books directly into our client's Zoho Bookings instance. The challenge we are facing is that your API only allows fetching availability one day at a time, which is problematic. Our second workaround
    • reCAPTCHA

      Is the Bookings form protected by reCAPTCHA, or some mechanism to ensure submission of the appointment request form is made by a human vs. bot?
    • Recent enhancements to Bigin's workflows and Associated Products

      Greetings, I hope all of you are doing well! We're happy to announce a few recent enhancements we've made to Bigin. Let's go over each one in detail. Enhancement to workflows Trigger workflows when specific fields are modified to specific values Previously,
    • Zoho Survey Goes to Junk Folder

      Hello, My company is wanting to use Zoho Survey to send out a customer satisfaction survey, and we were wondering if Zoho Campaigns allows the emails to not go into their junk folder. We sent out a test email campaign to our team and for some people it went to their inbox and for others it went to their junk folder. Is there a way to eliminate this from happening? Hope to hear from you soon! Thanks!
    • Nifty enhancements to Reports in Zoho CRM

      Dear Customers, We hope you’re well! We are here with a line of useful enhancements to Reports in Zoho CRM that are readily available to access. Include or exclude Record ID in the report export Display currency fields in record currency Capture report
    • need a formula to return value as shown (zoho sheet)

      Dear folks, What should be the formula in cell B3 to get that output, based on input sheet data.
    • need a formula to return value as shown (zoho sheet)

      Hello folks, what should be the formula in B3, to get the value shown based on input sheet ranges. thanks in advance.
    • Playground: An exclusive test environment to analyze Field Prediction accuracy

      Hello everyone, We are introducing Playground: an exclusive proactive testing environment for businesses to analyze Zia's prediction accuracy. This allows admins and agents to: Run predictions on actual tickets or specific content for realistic test conditions.
    • Attention: Upcoming changes to Zoho Assist support for older windows versions

      At Zoho Assist, our goal is to provide you with secure, reliable, and feature-rich remote support experiences. To maintain this standard, we periodically align our platform with the latest technology and security updates from the broader software ecosystem.
    • Send again email with link for signup

      Hello, I have a lot of problem to send contract my email, also missing the features "share link". How can I send again email to client and me wit link for signup a contract? Everytime it's a disaster!
    • How do I synchronize a quote to an opportunity?

      Hi everyone, We don't quote anything via Zoho but we use it to track services/products so that I can see what was actually sold, vs an opportunity with just shows an amount.  We use the quotes for other purposes, mostly to request a quote from Salesforce but we don't invoice or do sales orders or anything. (Basically a user makes a quick quote in Zoho, adds items and pricing, and then exports to PDF which gets emailed to our Quote Desk who then enters the request into Salesforce). Just wondering
    • Zoho Sprints Android app update: Tags and Epic search

      Hello everyone! We are excited to introduce tags and an option to search items within Epic module on the latest Android version(v2.0.2) of the Zoho Sprints mobile app. Let's take a look at these features: Tags You can now create, edit, and delete tags,
    • Zoho CRM Webhooks - Dynamic URL

      Hi Zoho, We've noted a gap in the webhooks function that if improved would increase use cases significantly. The "URL to Notify" field in "Create a Webhook" only supports static information. We have a number of use cases where we could use webhooks more
    • Work Order Creation Issue

      Dear Team, I would like to inquire about the daily limit for Work Order creation in Zoho FSM. Yesterday (02/05/2025) at around 6:30 PM GST, I attempted to create a Work Order, but I have been unable to do so since then. Please find the attached image
    • Tracking on Zoho Booking

      Hi We want to use Zoho Booking for our appointment management. We're using Calendly as of now that lets us track sources of the appointments made including UTM parameters. Is there a way for us to do same with Zoho Bookings?
    • Pre-created Popular Zoho Flows returns with 404 Error

      Your popular Zoho Flows are returning with a 404 page error. This applies to all work flows in your Gallery Space. See video here for further clarification. When will this be fixed? https://drive.google.com/drive/folders/1kDl4ni5EQeLHWeaoIDdtRqoUbW8FNLfO?usp=sharing
    • CRM Feature Request

      When enabling Translation in Zoho CRM I would like to see the ability to remove the language "English (US)". I have encountered a user experience issue with a client recently. The client uses English (UK) but they are based in Spain, so they have activated
    • Import your Google Docs Spreadsheets into Zoho Sheet

      You can now import your Google spreadsheet into Zoho Sheet. This will be useful if you want to switch to Zoho Sheet or if you want to simply try out Zoho Sheet.  If you don't have an account with Zoho, you can still try this by signing in with your Google account. Here is a video on how to do this.  Note: Existing charts won't appear in spreadsheets you import from Google Docs as the Export functionality of Google Docs doesn't give out the charts. Check out the announcement in our blog: https://blogs.zoho.com/general/import-google-docs-into-zoho-productivity-suite
    • Support Mixed Visibility Settings in Knowledge Base Categories

      Hello Zoho Desk Team, We hope you're all doing well. We’d like to submit a feature request regarding visibility settings in the Knowledge Base module. 🎯 Current Limitation As of today, when a category is set to a specific visibility level (e.g., Public),
    • Will a campaign send duplicates is same email is on two separate lists

      Hi I have two lists to which I want to send campaign. One list is ALL leads and other is list of opportunities and current students. There is overlap between the two lists My question is if I send one campaign to all, will zoho automatically know only to send the email once to the duplicate email?
    • Time Based Report / Dashboard

      We measure our support agent's KPI based on their response time and resolution time from the time the ticket is assigned to them The time based dashboard should provide this information however there is a problem with us referring to this dashboard We
    • Next Page