Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

Composite API

Purpose

To perform a composite API call, consisting of one or up to five sub-requests.

Request Details

Request URL

{api-domain}/crm/{version}/__composite_requests

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.composite_requests.CUSTOM
(and) Scope of the subrequest

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v3/__composite_requests"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.03xxxxxxxxxxxxxxxxxa5317.dxxxxxxxxxxxxxxxxxfa"
-d "@newdata.json"
Request JSON
  • rollback_on_failboolean, optional

    Represents whether to rollback the composite API request if any of the sub-requests fail. The default value is false.

  • concurrent_executionboolean, optional

    Represents whether to process all independent sub-requests (sub-requests with no dependencies/references) in parallel. The default value is true. If "rollback_on_fail" is true, then the default value of this key is false.

  • __composite_requestsJSON array, mandatory

    The JSON array containing the details of the sub-requests.

    • sub_request_id (string, optional) - The request ID for the corresponding sub-request. The accepted regex is [a-zA-Z0-9][a-zA-Z0-9_]*.

    • uri (string, mandatory) - The request URI of the corresponding sub-request. The accepted regex is /crm(/.*)?/v[0-9]+([.][0-9]+)?/.*.

    • method (string, mandatory) - The request method of the corresponding sub-request. The possible methods are GET, POST, PUT, PATCH, and DELETE.

    • params (JSON Object, optional) - The parameters for the corresponding sub-request.

    • body (JSON object, optional) - The request body of the corresponding sub-request.

    • headers (JSON object, optional) - Headers for the corresponding sub-request. Note that you cannot use the headers "authorization" or "x-crm-org" in this key.

Note
  • rollback_on_fail and concurrent_execution keys cannot both be true, simultaneously. For such a request, the system throws the AMBIGUITY_DURING_PROCESSING error.

  • All Delete APIs (except Notification APIs) are only supported with ID support in the URL. Bulk delete option is not supported.

  • When rollback_on_fail is false, workflows, approvals, and other automation actions are triggered as intended.

  • When rollback_on_fail is true:

    • Workflows:

      • 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.

      • For example, consider the case where a workflow is triggered every time a lead is created with the company name starting with 'S'. In sub-request 1, a lead is created, whose Company name starts with 'S', and sub-request 2 edits the newly created record's company name so that it does not start with 'S'. Only after executing both the sub-requests the workflow will be executed. But in this case, the workflow will not be triggered because the newly created Lead's company name is already updated in sub-request 2, and the criterion for the workflow is not met. Consider another case, where in sub-request 1, a lead is created, whose Company name is 'Silicon Solutions', and sub-request 2 edits this newly created record's website. If none of the other sub-requests change the company name of this newly created record, after executing all the sub-requests successfully, the workflow will be triggered.

  • Each composite API consumes one API credit, five concurrency credits, irrespective of the number of sub-requests.

  • Each composite API reduces the sub-concurrency by one, while the sub-requests consume their respective sub-concurrencies.

Allowed APIs

The following table gives the list of APIs allowed in a composite request. For these APIs, there are restrictions on the number of records that you can create, update, or delete in a composite request.

APINo. of records allowed
Get Org, Get Metadata, Convert a Lead, Get Layout Rules, Get Validation Rules, Get Custom Links, Get/Add/Update Roles, Get Profiles, Get/Update Blueprint, Get Variables/Variable Groups, Get Tags, Add/Remove Tags for a record, Get List of Attachments, Delete Photo, Get Currencies, Get Shared Record Details, Get Assignment Rules, Get/Add/Update Pipeline, Get Wizards, Get List of From Addresses, Delete Notifications,No restriction
Add/Update/Delete Users, Assign/Remove Territories for a Record, Update/Delink Related Records, Add/Delete Variables, Create/Update/Delete Notes, Create/Update/Merge Tags, Add/Update Currency, Add/Update/PATCH Notifications, Create/Update/Upsert/Delete Records,1
Get Territories, Get Notes, Get Email/Inventory Templates, Get Notifications, Get*/Search Records, Get Related Records, Get records through a COQL query, Get Deleted Records, Get Users25

* - While the sub-requests can use APIs from version 2 and up, GET records with CVID and sort_by parameters are only supported from version 3.

Sample Input

Copied{
    "rollback_on_fail": true,
    "concurrent_execution" : false,
    "__composite_requests": [
        {
            "sub_request_id":"1",
            "method":"POST",
            "uri":"/crm/v3/Leads",
            "headers":{},
            "body":
            {
                "data":[
                    {
                        "Last_Name":"Boyle"
                    }
                ]
            }
        },
        {
            "sub_request_id":"2",
            "method":"PUT",
            "uri":"/crm/v3/Leads/@{1:$.data[0].details.id}",
            "body":{
                "data":[
                    {
                        "Company":"ABC"
                    }
                ]
            }
        },
        {
            "sub_request_id":"3",
            "method":"GET",
            "params":{
                "fields":"Last_Name,Company,Email",
                "per_page":"3",
                "page":"1"
            },
            "uri":"/crm/v3/Leads/@{2:$.data[0].details.id}"
        },
        {
            "sub_request_id":"4",
            "method":"GET",
            "params":{
                "fields":"Last_Name, Modified_Time"
            },
            "headers":{
                "If-Modified-Since":"2020-08-22T12:30:00+05:30"
            },
            "uri":"/crm/v3/Leads"
        },
        {
            "sub_request_id":"5",
            "method":"GET",
            "params":{
                "fields":"Last_Name, Modified_Time"
            },
            "uri":"/crm/v3/Leads/554023000001736019"
        }
    ]
}

Possible Errors

  • API_NOT_SUPPORTEDHTTP 400

    You have invoked the API from an unsupported version
    Resolution: You can only use Composite API from V3.

  • INVALID_DATAHTTP 400

    You have specified an invalid value for either rollback_on_fail or concurrent_execution
    Resolution: The possible values for these keys are either "true" or "false".

  • INVALID_DATAHTTP 400

    You have not specified a JSON array for the "composite_requests" key.
    Resolution: Input a valid JSON array in the key.

  • MANDATORY_NOT_FOUNDHTTP 400

    You have not specified the mandatory key "__composite_requests", or given a null value.
    Resolution: Input a valid JSON array in this key.

  • AMBIGUITY_DURING_PROCESSINGHTTP 400

    "rollback_on_fail" and "concurrent_execution" keys cannot be true in the same request.
    Resolution: Specify the value of either of the keys as false, according to your requirement.

  • INVALID_DATAHTTP 400

    You have used more than 5 sub-requests.
    Resolution: You can only use a maximum of 5 sub-requests for a composite API.

Sample Response

Copied{
  "__composite_requests": [
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-12T23:43:25-11:00",
            "Content-Disposition": "attachment; filename=response.json",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4751295",
            "clientsubVersion": "a27707afc2e1d00d9d9f62aa55194b04"
          },
          "status_code": 201,
          "body": {
            "data": [
              {
                "code": "SUCCESS",
                "details": {
                  "Modified_Time": "2022-02-12T22:43:32-11:00",
                  "Modified_By": {
                    "name": "Patricia Boyle",
                    "id": "554023000000235011"
                  },
                  "Created_Time": "2022-02-12T22:43:32-11:00",
                  "id": "554023000002365002",
                  "Created_By": {
                    "name": "Patricia Boyle",
                    "id": "554023000000235011"
                  }
                },
                "message": "record added",
                "status": "success"
              }
            ]
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    },
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-12T23:43:25-11:00",
            "Content-Disposition": "attachment; filename=response.json",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4751295",
            "clientsubVersion": "a27707afc2e1d00d9d9f62aa55194b04"
          },
          "status_code": 200,
          "body": {
            "data": [
              {
                "code": "SUCCESS",
                "details": {
                  "Modified_Time": "2022-02-12T22:43:32-11:00",
                  "Modified_By": {
                    "name": "Patricia Boyle",
                    "id": "554023000000235011"
                  },
                  "Created_Time": "2022-02-12T22:43:32-11:00",
                  "id": "554023000002365002",
                  "Created_By": {
                    "name": "Patricia Boyle",
                    "id": "554023000000235011"
                  }
                },
                "message": "record updated",
                "status": "success"
              }
            ]
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    },
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-12T23:43:25-11:00",
            "Content-Disposition": "attachment; filename=response.json",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4751295",
            "clientsubVersion": "a27707afc2e1d00d9d9f62aa55194b04"
          },
          "status_code": 200,
          "body": {
            "data": [
              {
                "Company": "ABC",
                "Email": null,
                "Last_Name": "Boyle",
                "id": "554023000002365002",
                "$canvas_id": null
              }
            ]
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    },
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-12T23:43:25-11:00",
            "Content-Disposition": "attachment; filename=response.json",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4751295",
            "clientsubVersion": "a27707afc2e1d00d9d9f62aa55194b04"
          },
          "status_code": 200,
          "body": {
            "data": [
              {
                "Last_Name": "Boyle",
                "id": "554023000002365002"
              },
              {
                "Last_Name": "Max",
                "id": "554023000001736019"
              },
              {
                "Last_Name": "Deborah Grogan",
                "id": "554023000001054002"
              },
              {
                "Last_Name": "Leads test",
                "id": "554023000000948001"
              }
            ],
            "info": {
              "per_page": 25,
              "count": 4,
              "page": 1,
              "more_records": false
            }
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    },
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-12T23:43:25-11:00",
            "Content-Disposition": "attachment; filename=response.json",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4751295",
            "clientsubVersion": "a27707afc2e1d00d9d9f62aa55194b04"
          },
          "status_code": 200,
          "body": {
            "data": [
              {
                "Last_Name": "Max",
                "id": "554023000001736019",
                "$canvas_id": null
              }
            ]
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    }
  ]
}

Show full

Show less

Possible Errors For the sub-requests

  • MANDATORY_NOT_FOUND

    You have not specified the mandatory key in one of the sub-requests, the data type is not consistent with the field, or not compliant with the regex.
    Resolution: Input all manadatory values for every sub-request following the regex. Make sure the data type of the input matches with the field's.

  • INVALID_DATA

    You have specified an invalid sub_request_id
    Resolution: Specify a valid sub_request_id. The accepted regex is [a-zA-Z0-9][a-zA-Z0-9_]*.

  • INVALID_DATA

    You have specify an invalid value for one of the keys
    Resolution: Specify valid values for all the keys. Refer to the sample input section for more details.

  • DUPLICATE_DATA

    You have specified the same sub_request_id for more than one sub_request
    Resolution: Specify unique sub_request_id for all sub-requests.

  • NOT_ALLOWED

    You have specified a version higher than that of the composite API's for one or more sub-requests in their URLs
    Resolution: Specify a version equal to or less than that of the composite API for all the sub-requests.

  • NOT_SUPPORTED

    You have tried to invoke an API that is not supported by composite API
    Resolution: Refer to the supported APIs section above for the list of allowed APIs in a composite request.

  • LIMIT_EXCEEDED

    You have exceeded the limit in the sub-request
    Resolution: There are restrictions on the number of records that you can create, update, or delete in a composite request. Refer to the "Allowed APIs" section for the limits applicable to each API.

  • INVALID_REFERENCE

    You have given an improper reference in the request body
    Resolution: Refer to the notes section and sample input section for details on how to give a proper reference.

  • INVALID_REFERENCE

    The response used in the given reference does not have a proper value
    Resolution: Specify a valid reference.

  • INVALID_REFERENCE

    You have given a reference which is yet to be executed
    Resolution: This error is thrown for sequential execution ("concurrent_execution" is false). Arrange the sub-requests so that the reference can be given properly.

  • INVALID_REFERENCE

    The given reference refers to the same sub-request as it is referred to in
    Resolution: Give a reference from another sub-request.

  • INVALID_REFERENCE

    The sub-request referred to in the reference has failed
    Resolution: This error is thrown for parallel execution ("concurrent_execution" is true). You can only use successful sub-requests as references.

  • LOOPING_FOUND

    The sub-requests are referring to each other
    Resolution: This error is thrown for parallel execution ("concurrent_execution" is true). Sub-requests cannot have references to each other. Specify the references such that there is no looping.

  • ROLLBACK_PERFORMED

    The sub-request was rolled back because another sub-request in the composite API has failed
    Resolution: This error is thrown only when "rollback_on_fail" is true. Make the necessary corrections so that the failed API can be successful.

  • PROCESSING_STOPPED

    The sub-request was rolled back because another sub-request in the composite API has failed
    Resolution: This error is thrown only when "rollback_on_fail" is true and there were unexecuted sub-requests when the transaction was rolled back. Make the necessary corrections so that the failed API can be successful.

  • REQUEST_TIMEOUT

    The execution time taken to complete all the sub-requests concurrently has exceeded the default timeout period of five minutes
    Resolution: Check the network for connectivity issues, or other reasons for execution time exceeding five minutes. The already triggered sub-request may be successfully executed in the back-end, even if this error is populated.

  • REQUEST_TIMEOUT

    This error is thrown when connection time-out occurs during NIO flow and CRM is yet to receive the request
    Resolution: This error is thrown for parallel execution ("concurrent_execution" is true). Check the network for connectivity issues.

  • INTERNAL_ERROR

    Internal server error
    Resolution: Contact your system administrator or the support team.

Status Codes for a Composite Request

The following are the status codes in the response of a composite request.

  • When "rollback_on_fail" is true:

    • Status code is 400, when a rollback is performed (one or all the sub-requests failed).

    • Status code is 200, when a rollback is not performed.

  • When "rollback_on_fail" is false:

    • Status code is 400, when none of the sub-requests is triggered.

    • Status code is 207, when a few of the sub-requests are triggered.

    • Status code is 200, when all the sub-requests are triggered. Note that a composite request is considered a success when all the sub-requests are triggered, irrespective of the success or failure of each of these sub-requests.

Sample input when rollback_on_fail is "true"

Copied{
  "rollback_on_fail": true,
  "concurrent_execution": false,
  "__composite_requests": [
    {
      "sub_request_id": "1",
      "method": "POST",
      "uri": "/crm/v3/Leads",
      "headers": {},
      "body": {
        "data": [
          {
            "Last_Name": "Sam"
          }
        ]
      }
    },
    {
      "sub_request_id": "2",
      "params": {
        "fields": "Last_Name,Company,Email",
        "per_page": "3",
        "page": "1",
        "ids": "@{1:$.data[0].details.id}"
      },
      "method": "GET",
      "uri": "/crm/v3/Leads"
    },
    {
      "sub_request_id": "3",
      "method": "GET",
      "uri": "/crm/v3/Leads",
      "params": {
        "fields": "Last_Name,Company,Email",
        "page": 1
      },
      "body": {
        "data": [
          {
            "Last_Name": "Sam"
          }
        ]
      }
    },
    {
      "sub_request_id": "4",
      "method": "POST",
      "body": {
        "select_query": "select Last_Name from Leads where Last_Name is not null limit 26"
      },
      "uri": "/crm/v3/coql"
    },
    {
      "sub_request_id": "5",
      "method": "GET",
      "params": {
        "fields": "Last_Name,Company,Email"
      },
      "uri": "crm/v3/Leads"
    }
  ]
}

Sample Response for a rollback

Copied{
  "__composite_requests": [
    {
      "code": "ROLLBACK_PERFORMED",
      "details": {
        "rollbacked_by_sub_request_index": 3
      },
      "message": "the transaction was rolled back since another sub request in the same transaction failed.",
      "status": "error"
    },
    {
      "code": "ROLLBACK_PERFORMED",
      "details": {
        "rollbacked_by_sub_request_index": 3
      },
      "message": "the transaction was rolled back since another sub request in the same transaction failed.",
      "status": "error"
    },
    {
      "code": "ROLLBACK_PERFORMED",
      "details": {
        "rollbacked_by_sub_request_index": 3
      },
      "message": "the transaction was rolled back since another sub request in the same transaction failed.",
      "status": "error"
    },
    {
      "code": "SUCCESS",
      "details": {
        "response": {
          "headers": {
            "X-ACCESSTOKEN-RESET": "2022-02-02T11:43:59+05:30",
            "X-Content-Type-Options": "nosniff",
            "Content-Disposition": "attachment; filename=response.json",
            "X-Download-Options": "noopen",
            "content-type": "application/json;charset=utf-8",
            "clientVersion": "4725537",
            "clientsubVersion": "1fbb2cd4aec39c18e65a4eebcff5a8cc"
          },
          "status_code": 400,
          "body": {
            "code": "LIMIT_EXCEEDED",
            "details": {
              "by": "limit",
              "limit": 25
            },
            "message": "limit exceeded",
            "status": "error"
          }
        }
      },
      "message": "composite sub request executed successfully",
      "status": "success"
    },
    {
      "code": "PROCESSING_STOPPED",
      "details": {
        "rollbacked_by_sub_request_index": 3
      },
      "message": "the transaction was rolled back since another sub request in the same transaction failed.",
      "status": "error"
    }
  ]
}