Kaizen #61 - Composite API

Kaizen #61 - Composite API

Hello everyone!

Have you ever wanted to make different API calls in a single request? 
Save up on some API credits while still fulfilling your business case?
Reduce the round-trip time of a request?

We have got you!
The Composite API does it all!

What is a Composite API?

The Composite API allows you to combine up to five API requests in a single API call. You can also choose to execute all the APIs in a single database transaction, if required.

Before we look at this API in detail, let us get to know a few terms for better understanding.

  • Sub-requests - the individual API requests you use in a composite request.
  • Single database transaction - execution is considered complete only after all the sub-requests are executed. 
  • Round-trip time(RTT) - the time taken for the request to reach the server from the client and render a response in the client.
  • Rollback - when one of the sub-requests fails, the previous sub-requests that were executed will be reverted, and the composite API will be rolled back.
  • Concurrent execution - processing all the sub-requests at the same time, i.e, in parallel.
  • Index of the sub-requests - represents the order of execution. The execution begins at the 0th index.

How does the composite API reduce the round-trip time(RTT)?

Consider that you want to fetch the module metadata of leads, insert a contact, and fetch a quote. When you combine these calls in a composite request, the RTT is much lesser than the three individual requests from and to the client.

Concurrent and parallel execution

You can execute the sub-requests sequentially or in parallel, depending on your business needs.
The Boolean keys rollback_on_fail and concurrent_execution decide the execution flow of the composite API.
  • concurrent_execution - Represents whether you want to execute all the sub-requests in parallel. 
  • rollback_on_fail - Represents whether you want to rollback the entire composite request when one sub-request fails.

Note that these two keys cannot have the value "true" at the same time. That is, when the concurrent execution is true, a rollback cannot happen.

Let us discuss the two scenarios based on the values of these keys.
  1. Sub Requests are executed under the same transaction (rollback can be performed)
  2. Sub Requests are not executed under the same transaction

1. Sub-requests are executed under the same transaction (rollback can be performed)

  • When to use? 
    When there are dependent sub-requests and the execution of one depends on the response of another sub-request. Here, you must reference the sub-request whose data you want to use in another sub-request.
    For example, you want to upsert a record in the Contacts module(sub-request 1), upsert a record in the Accounts module(sub-request 2), and convert a lead while associating it to the previously upserted contact and account(sub-request 3). Sub-request 3 depends on the execution of sub-requests 1 and 2. This allows you to rollback the composite request when one of the sub-requests fails. That is, the contact and account will not be upserted. 
  • concurrent_execution - false
  • rollback_on_fail - true

Here is the JSON for the composite request:

{
    "rollback_on_fail": true,
    "concurrent_execution" : false,
    "__composite_requests": [
        {
            "sub_request_id":"1",
            "method":"POST",
            "uri":"/crm/v3/Contacts/upsert",
            "headers":{},
            "body":
            {
                "data":[
                    {
                        "Last_Name":"composite",
                        "Email":"composite@test.test"
                    }
                ]
            }
        },
        {
            "sub_request_id":"2",
            "method":"POST",
            "uri":"/crm/v3/Accounts/upsert",
            "body":{
                "data":[
                    {
                        "Account_Name":"C1",
                        "Email":"composite2@test.test"
                    }
                ]
            }
        },
        {
            "sub_request_id":"3",
            "method":"POST",
            "uri":"/crm/v3/Leads/111111000000095001/actions/convert",
            "body":{
                "data":[
                    {
                        "Accounts":"@{2:$.data[0].details.id}",
                        "Contacts":"@{1:$.data[0].details.id}"
                    }
                ]
            }
        }
    ]
}

2. Sub Requests are not executed under the same transaction 

a. concurrent execution is false
  • When to use? 
    When there are sub-requests that are internally dependent through an automation action.
    For example, you have configured a workflow that is triggered when the vendor's name is Zylker. In sub-request 1, you update an existing vendor's name from Zoho to Zylker. In sub-request 2, you create a contact associating the recently-updated vendor using its ID. Both appear like independent requests, but have internal dependency through the workflow. That is, to trigger the workflow, you must execute sub-request 1 first, followed by the second. Hence, you cannot use concurrent execution.
  • concurrent_execution - false
  • rollback_on_fail - false
{
    "concurrent_execution" : false,
    "__composite_requests": [
        {
            "sub_request_id":"1",
            "method":"PUT",
            "uri":"/crm/v3/Vendors/111111000000050313",
            "headers":{},
            "body":
            {
                "data":[
                    {
                        "Email":"v@gmail.com",
                        "Vendor_Name":"V1"
                    }
                ]
            }
        },
        {
            "sub_request_id":"2",
            "method":"POST",
            "uri":"/crm/v3/Contacts",
            "body":{
                "data":[
                    {
                        "Vendor_Name":"111111000000050313",
                        "Last_Name":"composite",
                        "Email":"composite2@test.test"
                    }
                ]
            }
        }
    ]
}

b. concurrent execution is true
Case 1: With independent sub-requests

  • When to use? 
    When your sub-requests are independent of each other and you want to save time by executing them in parallel. For example, fetching the leads, fetching the metadata of another module etc,.
  • concurrent_execution - true
  • rollback_on_fail - false

Case 2: With dependent and independent sub-requests

  • When to use? 
    When you have dependent and independent requests, and you want to execute independent requests in parallel to reduce execution time. For example, you want to create a lead(sub-request 1), create a contact referencing an account(sub-request 2) which will be created in another sub-request, and create an account(sub-request 3). Here, sub-requests 1 and 3 will be executed in parallel, and sub-request 2 will be executed after receiving the response from 3.
  • concurrent_execution - true
  • rollback_on_fail - false

Here is the sample input.

{
    "concurrent_execution" : true,
    "__composite_requests": [
        {
            "sub_request_id":"1",
            "method":"POST",
            "uri":"/crm/v3/Leads",
            "headers":{},
            "body":
            {
                "data":[
                    {
                        "Last_Name":"composite",
                        "Email":"composite@test.test"
                    }
                ]
            }
        },
        {
            "sub_request_id":"2",
            "method":"POST",
            "uri":"/crm/v3/Contacts",
            "body":{
                "data":[
                    {
                        "Account_Name":"@{1:$.data[0].details.id}",
                        "Last_Name":"composite",
                        "Email":"composite2@test.test"
                    }
                ]
            }
        },
        {
            "sub_request_id":"3",
            "method":"POST",
            "uri":"/crm/v3/Accounts",
            "body":{
                "data":[
                    {
                        "Account_Name":"A1"
                    }
                ]
            }
        }
    ]
}

Points to remember

  • rollback_on_fail and concurrent_execution keys cannot hold the value "true" at the same time.
  • You can only use a set of allowed APIs in the composite request. Refer to the Allowed APIs section on the help page.
  • When rollback_on_fail is true, the automation actions are executed only when all the sub-requests are served and a rollback is not performed. If one or more sub-requests fail and a rollback happens, the automation actions are not triggered.
  • Each composite API consumes one API credit, five concurrency credits, irrespective of the number of sub-requests.

How are responses and errors handled in the composite API

  • A composite API renders a success response when all the sub-requests are executed irrespective of their success or failure.
  • Every sub-request will have its corresponding error or success response, irrespective of the flow(concurrent or sequential).
  • You can get the details of the erroneous sub-request from the index in the response.

We hope you found this post useful. Let us know your thoughts in the comments.

Cheers!


    Access your files securely from anywhere


          All-in-one knowledge management and training platform for your employees and customers.







                                Zoho Developer Community




                                                      • Desk Community Learning Series


                                                      • Digest


                                                      • Functions


                                                      • Meetups


                                                      • Kbase


                                                      • Resources


                                                      • Glossary


                                                      • Desk Marketplace


                                                      • MVP Corner


                                                      • Word of the Day


                                                      • Ask the Experts



                                                                • Sticky Posts

                                                                • 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.
                                                                • Kaizen #226: Using ZRC in Client Script

                                                                  Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
                                                                • Kaizen #222 - Client Script Support for Notes Related List

                                                                  Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
                                                                • Kaizen #217 - Actions APIs : Tasks

                                                                  Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
                                                                • Kaizen #216 - Actions APIs : Email Notifications

                                                                  Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are


                                                                Manage your brands on social media



                                                                      Zoho TeamInbox Resources



                                                                          Zoho CRM Plus Resources

                                                                            Zoho Books Resources


                                                                              Zoho Subscriptions Resources

                                                                                Zoho Projects Resources


                                                                                  Zoho Sprints Resources


                                                                                    Qntrl Resources


                                                                                      Zoho Creator Resources



                                                                                          Zoho CRM Resources

                                                                                          • CRM Community Learning Series

                                                                                            CRM Community Learning Series


                                                                                          • Kaizen

                                                                                            Kaizen

                                                                                          • Functions

                                                                                            Functions

                                                                                          • Meetups

                                                                                            Meetups

                                                                                          • Kbase

                                                                                            Kbase

                                                                                          • Resources

                                                                                            Resources

                                                                                          • Digest

                                                                                            Digest

                                                                                          • CRM Marketplace

                                                                                            CRM Marketplace

                                                                                          • MVP Corner

                                                                                            MVP Corner









                                                                                              Design. Discuss. Deliver.

                                                                                              Create visually engaging stories with Zoho Show.

                                                                                              Get Started Now


                                                                                                Zoho Show Resources

                                                                                                  Zoho Writer

                                                                                                  Get Started. Write Away!

                                                                                                  Writer is a powerful online word processor, designed for collaborative work.

                                                                                                    Zoho CRM コンテンツ




                                                                                                      Nederlandse Hulpbronnen


                                                                                                          ご検討中の方





                                                                                                                    • Recent Topics

                                                                                                                    • Connect ZOHO social with Google Data Studio and download data from ZOHO social

                                                                                                                      Dear ZOHO team, I am writing this message to enquire about how to connect ZOHO social with Google data studio since our company would like to use Google data studio to generate reports. Is it a way to download data from ZOHO social? Best regards, Chris
                                                                                                                    • Zoho People Whats New - Q2 2026

                                                                                                                      Hello Users! We're excited to share the latest updates introduced in Zoho People during Q2 2026. This release brings a range of new features and enhancements designed to simplify HR operations, automate routine processes, and deliver a smarter, more connected
                                                                                                                    • Manage booking pages from your Android phone

                                                                                                                      Hello everyone! We are happy to announce that users can now add and manage booking pages from their Bigin Android app. It is a multi-step form that users can create for purposes like booking appointments, scheduling calls or meetings, conducting webinars,
                                                                                                                    • Zoho Team Inbox - roadmap

                                                                                                                      Hi, would be good to understand the Teaminbox roadmap, in particular: 1. API / Zoho Deluge connections. We have a process where the each email needs to be either tagged or assigned daily. It would be great if we could automate a 5pm alert for any exemptions
                                                                                                                    • Zoho CRM Community Digest - July 2026 | Part 1

                                                                                                                      Hello everyone, July is here! The first two weeks brought six CRM updates ranging from privacy-ready webforms to a significantly more powerful Layout Rules engine, two community wins worth a look (a dashboard workaround for spotting leads with no activities,
                                                                                                                    • How do I migrate from Office 365 to Zoho Mail?

                                                                                                                      Check out Advik Email Migration Wizard, this software is specially developed to move mailboxes from Office 365 to Zoho Webmail. In addition you can migrate from Gmail, Yahoo, Rediffmail and 80+ webmail servers to ZOHO MAIL. Isn't it amazing? This is an all in one email migration solution. Steps to export emails from Office 365 to Zoho Webmail are as follows; Run Advik Email Migration Tool in your system. Select Office 365 as source and enter its login credentials. Select mailbox folders and choose
                                                                                                                    • Topics not loading in individual contact records in Zoho Marketing Automation

                                                                                                                      When working correctly, an individual contact record in ZMA shows a "Topics" section in the "Subscription" tab of the individual record. However, in 2+ different Zoho accounts and different browsers, the "Topics" section doesn't load and instead it spins
                                                                                                                    • Help: Capture full page URL in hidden field when same Zoho Form is embedded on multiple pages (iframe)

                                                                                                                      Hi all, Goal Use one Zoho Form across multiple pages and record the exact page URL (incl. subdomain + path + hash) where the user submitted it. Example pages: https://www.example.com/cargo/ https://www.example.com/cargo/containers/#contact https://cargo.example.com/auto/
                                                                                                                    • how to get transcripts with speaker and time marks?

                                                                                                                      Hello, I downloaded the transcript of a recent meeting and noticed that the TXT file does not bring the speaker name and the time mark. Is there any way to make it happen using ootb resources from Zoho Meeting? best
                                                                                                                    • SalesIQ's Summer '26 Release: For The Moments That Matter

                                                                                                                      Every customer journey is made up of moments. The moment someone discovers your business. The moment they need help. The moment you decide to reach out. The moment a simple chat turns into something more. And the moments that continue long after the conversation
                                                                                                                    • Cannot deploy digital employee-

                                                                                                                      I followed the guide here https://help.zoho.com/portal/en/kb/salesiq-2-0/for-administrators/operators/articles/zia-agents-in-zoho-salesiq#Supported_SalesIQ_Tools but no matter how many times I try I cannot for the love of god make it work I get this error
                                                                                                                    • Displaying only unread tickets in ticket view

                                                                                                                      Hello, I was wondering if someone might be able to help me with this one. We use filters to display our ticket list, typically using a saved filter which displays the tickets which are overdue or due today. What I'd really like is another filter that
                                                                                                                    • 【受付開始】Zoholics Japan 2026 開催のご案内

                                                                                                                      Zoho が年に一度開催するユーザー向けイベント「Zoholics」。 今年は 「AI-Powered DX with Zoho」 をテーマに、2026年9月25日(金)に 東京駅直結の会場とオンラインのハイブリッド形式で開催します。 今すぐ申し込む AIの活用が加速する今、業務効率化やDX推進に取り組む企業にとって、 「どのようにAIを業務へ取り入れ、成果につなげるか」が重要なテーマとなっています。 Zoholicsでは、Zohoの最新AI機能や製品アップデートに加え、実際の活用事例や業務改善のヒントをご紹介します。
                                                                                                                    • Print checks for owner's draw

                                                                                                                      Hi.  Can I use Zoho check printing for draws to Owner's Equity?  This may be a specific case of the missing Pay expenses via Check feature.  If it's not available, are there plans to add this feature?
                                                                                                                    • Reconciliation: don't auto-select transactions outside the entered Period

                                                                                                                      When initiating a reconciliation for a defined Period (say April 1 to April 30), Zoho Books auto-checks transactions whose Statement Detail dates fall after the period end date. With "Show based on grouped bank statements" enabled (the default), the screen
                                                                                                                    • How can be requests for new job managed in Zoho recruit?

                                                                                                                      If we use both Zoho people and recruit, can our managers (heads of department) use Zoho products to create requests for new job to HR department? The current workflow is following: a head of department needs some extra HR, he creates a request describing the job and send it to HR director, HR director approves a request and forward to a HR manager. I see only one way to partly solve the problem - grant the heads of departments recruit administrator permissions, so they could create new jobs. It is
                                                                                                                    • Linking the Overview window between reports on a dashboard

                                                                                                                      Is there a way to link the Overview window for two or more charts on a dashboard? We have several dashboards where users often want to set the window for 3 or 4 reports to the same time period. Doing it manually is time-consuming and cumbersome, but I
                                                                                                                    • Subforms and automation

                                                                                                                      If a user updates a field how do we create an automation etc. We have a field for returned parts and i want to get an email when that field is ticked. How please as Zoho tells me no automation on subforms. The Reason- Why having waited for ever for FSM
                                                                                                                    • "code":3001 ["Failed to update data."]

                                                                                                                      I would like to seek your expertise - I might be wrong on my approach also.. I highly appreciate your advice. 1 problem remains is when a new row was added on the existing one [from another form that trigger upon Successful form submission ], it gets
                                                                                                                    • BUG: If you put "Blueprint" at the top of Workqueue, tab switching leads to long loading and no display

                                                                                                                    • WORKFLOW ISSUE: Zoho Finance Extension

                                                                                                                      Workflows are no longer triggering in my extension. This is true for the testing environment and 5 other organizations it is installed on. There are no conditions set for the workflow, and this is true for both create and delete related actions. Workflows
                                                                                                                    • Drive Zoho CRM adoption and usage through our native integration with Zoho DAP

                                                                                                                      You chose Zoho CRM for its depth: its powerful automation, its rich analytics, and its extensive customizability. But there's a hidden last mile in every rollout: the gap between the software's capabilities and your team's daily execution. When new hires
                                                                                                                    • Moving from Office365 to Zoho Mail

                                                                                                                      I have few mailboxes on Office365. One of the mailbox is coming up for renewal. How can I move this mailbox to Zoho Mail and continue to have other mail boxes continue to use Office365 mail? Thanks, -Naveen
                                                                                                                    • Best sales insights for target accounts?

                                                                                                                      Question for all the sales power-users out there: I would like to gain insights from Zoho CRM for a rotating list of target accounts. Each Outside Salesperson has 5 target accounts, and they can change these targets quarterly with management approval.
                                                                                                                    • WhatsApp Vendors

                                                                                                                      Hello, so WhatsApp works with the below, mainly with the customer side modules. Can we get functionality on the vendor side modules? WhatsApp is often the preferred method of communication with some vendors. Credit Notes Payment Receipts Sales Receipts
                                                                                                                    • Text on Zoho Sign confirmation dialouge is very small compared to text used everywhere else on Zoho Sign.

                                                                                                                      I've reported multiple times through Zoho's support email that the text on this notification is very small in contrast to all the other text on the Zoho Sign app. I think it's a bug and it just needs the font size to be increased. It's very minor but
                                                                                                                    • Time Zone is incorrect

                                                                                                                      Time zone is not working properly...I've checked it twice. I'm eastern U.S. time it's currently 12:22 pm EST. CRM shows 3:22 pm EST.
                                                                                                                    • Over-the-Air (OTA) Updates for V3 Attendee Apps | Zoho Backstage

                                                                                                                      Keeping participants on the latest version of your event app shouldn’t depend on App Store or Play Store review timelines. With Over-the-Air (OTA) updates for our V3 attendee app, the latest version is delivered directly to participants through an in-app
                                                                                                                    • Please Remove the Confirmation Popup

                                                                                                                      Currently, every time a recruiter changes the status of a candidate in Zoho Recruit, a popup confirmation appears that requires clicking “OK, Got it” before proceeding. This creates unnecessary friction in the workflow, especially for users handling high
                                                                                                                    • Zoho Projects: Q2 Updates 2026

                                                                                                                      Dear Users, During the first quarter, we launched our most advanced version of Zoho Projects, namely Zoho Projects Infinity. With support for Custom Modules, Custom Dashboards & Reports, along with built-in AI tools, we enabled users to create their own
                                                                                                                    • Overview on users IMAP settings

                                                                                                                      We have about 30 users who all have the channels/email/email configuration/IMAP integration/O365 enabled and emails are synchronized. Here my problem: Passwords for the email accounts are expiring on individual bases and most of the users forget to update
                                                                                                                    • What is a realistic turnaround time for account review for ZeptoMail?

                                                                                                                      On signing up it said 2-3 business days. I am on business-day 6 and have had zero contact of any kind. No follow-up questions, no approval or decline. Attempts to "leave a message" or use the "Contact Us" form have just vanished without a trace. It still
                                                                                                                    • Alternate color rows

                                                                                                                      After I changed the background color to a dark gray and changed the alternate rows to a light gray. I have discovered that I can no longer change the text in the light gray rows to Bold.
                                                                                                                    • Tax/Vat Number Field As Standard - Customer & Vendor

                                                                                                                      Hello, when are you'll going to have the customer & vendor tax/vat number as a standard field under the relevant profile pages? I find it strange that after 6 years of using Zoho Inventory that I still have to use a custom field for a tax/vat number,
                                                                                                                    • Restricting coupon codes and plans to specific customers

                                                                                                                      Having the ability to restrict coupon codes, plans and add ons to specific customers (new or existing) e.g. sending an invite link out to a certain customer or allowing a certain group of customers the ability to use a certain promo code or sign up to
                                                                                                                    • Coupon Management Lacks functionality

                                                                                                                      Hey Zoho Team, Let me start of by saying I'm a huge fan of the entire Zoho suite. I have a couple of thoughts about the way coupons are handled and believe there they are in need of some improvement. There are a couple of key issues: 1. Coupons need to
                                                                                                                    • Free Webinar Alert! Zoho Mail + Zoho CRM: Turn inbox replies into CRM deals

                                                                                                                      Hello Zoho Community! Are your sales conversations happening in Zoho Mail while your customer data lives in Zoho CRM? Join our upcoming webinar to learn how integrating the two can help you automate follow-ups, capture leads faster, and keep every customer
                                                                                                                    • Introducing the Employee Portal for internal job posting

                                                                                                                      Employee referrals and internal applications are one of the most trusted hiring channels. But in many organizations, employees only hear about openings through messages, word of mouth, or after the role has already been open for a while. When employees
                                                                                                                    • Marketing Tip #42: Keep policy pages updated and accessible

                                                                                                                      Policy pages may not be the most exciting part of your store, but they play a big role in building trust. Before buying, many customers look for information on shipping, returns, refunds, privacy, and terms. If these pages are missing, outdated, or hard
                                                                                                                    • Extend the Image Choice Field

                                                                                                                      Hi, The New Yes/No field is great for what it does, and the Image Choice Field is good but could be better with some functions from the Yes/No field. Take an example, rather than just Yes/No you want Yes/No/Maybe (Or more than 3 choices), but unlike the
                                                                                                                    • Next Page