Zoho AI Calling Automation This project automates outbound calls to leads from Zoho CRM using VAPI AI assistants and leverages OpenAI GPT for transcript summarization and lead status classification. It also logs call details back to Zoho CRM dynamically. Features Fetches leads from Zoho CRM based on predefined statuses. Initiates outbound calls via VAPI AI assistants. Automatically formats and validates phone numbers. Retries failed calls up to configurable attempts. Captures call transcript, start/end time, and call duration. Summarizes conversation and classifies lead status using OpenAI GPT. Updates Zoho CRM with call log, transcript, summary, and updated lead status. Supports scheduling callbacks dynamically for "call me later" leads. Uses multithreading to handle multiple callbacks without blocking the terminal. Color-coded terminal output for better readability. Requirements Python 3.10+ Libraries: pip install requests python-dotenv colorama openai Environment variables (in .env file): ZOHO_ACCESS_TOKEN= VAPI_API_KEY= VAPI_ASSISTANT_IDS= VAPI_PHONE_NUMBER_ID= OPENAI_API_KEY= Configuration VAPI_ASSISTANT_IDS: List of AI assistants to rotate between calls. CALLABLE_STATUSES: Zoho lead statuses eligible for calling (attempted to contact, contacted, new, etc.). SKIP_STATUSES: Lead statuses to skip automatically (junk lead, contact in future). Usage Ensure the .env file is correctly configured. Run the script: python python.py The script will fetch leads from Zoho and start calling automatically. For leads with "call me later" status, you will be prompted to enter: Minutes to schedule callback Number of retries How It Works Fetch Leads: Gets all leads from Zoho CRM with relevant fields. Phone Formatting: Ensures all phone numbers are in international format. Call Initiation: Sends call requests to VAPI AI assistants. Fetch Call Status: Polls the call status until completion, failure, or timeout. Transcript Summarization: Uses GPT model to summarize the conversation and classify lead interest. Log Call in Zoho: Adds call log and updates lead status in Zoho CRM. Callback Scheduling: For "call me later" leads, schedules calls using multithreading without blocking main execution. Notes Terminal will remain active to handle scheduled callbacks dynamically. Logging is color-coded for clarity: Green ✅: Successful call or logging Red ❌: Failed attempts Yellow ⚠️: Warnings or missing data Cyan 🕒: Callback notifications Can handle multiple assistants using a round-robin cycle. Optional Enhancements Persist logs to a file or database. Add email notifications for call summaries. Integrate more robust error handling for API failures. Implement configurable call retry intervals.