Frequently Asked Questions on GraphQL APIs | Kaizen Series | Zoho CRM

Frequently Asked Questions on GraphQL APIs | Kaizen Series | Zoho CRM

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

Hi all,
Hello and welcome to another week of Kaizen!
In this post, we will be discussing Frequently Asked Questions on Zoho CRM GraphQL APIs.  GraphQL is a query language that provides a more flexible and efficient way to access data and metadata within your Zoho CRM organization. 

Why should I try GraphQL APIs?

 Using GraphQL with Zoho CRM allows you to fetch exactly the data you need in a single request, reducing over-fetching and under-fetching. It also enables you to combine multiple operations in one request, which can improve performance and reduce network overhead.

How do I authorize GraphQL requests?

Similar to Zoho CRM REST APIs, GraphQL APIs use OAuth 2.0 for authorization.
For self-clients, you can use the self-client option in the API console to get an authorization grant code. This code can be exchanged for an access token and a refresh token. Once you receive the access token, send the token in your HTTP authorization header with the value "Zoho-oauthtoken {access_token}" for each request. Check out our Postman collection for GraphQL APIs for examples.

Are GraphQL APIs available for all Zoho CRM editions?

GraphQL APIs are available in Enterprise, Zoho One Enterprise, CRM Plus and Ultimate edition of Zoho CRM. Note that it is not available in any trial editions.

What is the difference between REST APIs and GraphQL APIs?

REST APIs let clients talk to servers using standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE. Instead of fetching a fixed dataset like with REST, GraphQL APIs allows you to ask for precisely the data you want. We have covered this topic in detail in our previous Kaizen post that compares REST APIs and GraphQL APIs

Do I need to do any initial setup to start using GraphQL APIs?

To start using GraphQL APIs, you have to enable GraphQL APIs for your Zoho CRM profile through the enable GraphQL API call. 
  • Request URL : {api-domain}/crm/graphql/actions/enable
  • Method : POST
  • Scope: ZohoCRM.GraphQL.UPDATE
This API call generates the GraphQL schema. GraphQL schema defines the capabilities of a server, the data it contains and the actions that can be done on it. Note that it is sufficient to invoke this API call once for each profile

What are the operations supported in Zoho CRM GraphQL APIs?

   Currently, Zoho CRM GraphQL APIs support only query operations. Query operation is analogous to the GET method in REST APIs.

How do I configure requests for Zoho CRM’s GraphQL APIs?

How do I write a basic query in GraphQL? 

The below query can be used to fetch Last_Name in Leads module.

Request body 

query {

    Records {

        Leads {_data {Last_Name {value}}}

    }

}

 

Output 

{"data":{"Records":{"Leads":{"_data":[

  {"Last_Name":{"value":"Kitzman"}},

  {"Last_Name":{"value":"Frey"}}

  // ...

]}}}}


What are the supported metadata types that can be fetched using GraphQL APIs?

Using GraphQL APIs you can fetch metadata from Modules, Users, KanbanView, UserProperties, ProfilePermissions, Profiles, Rolesand Widgets

Can I fetch metadata and data of a particular module in a single query using GraphQL APIs?

Yes, using GraphQL it is possible to fetch both metadata and data in a single query. 
 For example, the below query can be used to fetch Last_Name from Leads module and metadata information of the Last_Name field in the Leads module.

Request body

{

  Records {

    Leads { _data { Last_Name { value } } }

  }

  Meta {

    Modules(filter: { api_name: "Leads" }) {

      _data {

        fields(filter: { api_names: "Last_Name" }) {

_data {

                        id

                        api_name

                        display_label

                        json_type

                        data_type

}}}}}}

 

 Output 

{

  "data": {

    "Records": {

      "Leads": {

        "_data": [

          { "Last_Name": { "value": "Kitzman" } },

          { "Last_Name": { "value": "Frey" } }

          // ...

        ]

      }

    },

    "Meta": {

      "Modules": {

        "_data": [

          {

            "fields": {

              "_data": [

                {

                  "id": "6660682000000002595",

                  "api_name": "Last_Name",

                  "display_label": "Last Name",

                  "json_type": "string",

                  "data_type": "text"

   }]}}]}}}}

 

We have covered this in detail in this Kaizen post: Using GraphQL APIs to fetch data in a consolidated way.

Are there any limits applicable for a GraphQL API query?

Yes, Zoho CRM imposes certain limits on the GraphQL API to ensure fair usage. 
  • Credits: A single query can consume up to a maximum of 10 credits
  • Complexity: Complexity is a measure of workload a query exerts on the server based on the number of fields and depth of the query. The maximum complexity allowed for a single query is 1000. 
  • Depth: The nesting level of a queried field is referred to as depth. The limit for metadata is seven, and for data is three.
Refer to the official documentation on GraphQL credits.

Is it possible to retrieve selective data using GraphQL APIs?

Records

You can use the where argument to filter records from each module.  Each field can support type specific operators and can be combined with Boolean logic and wildcards.

For example. to fetch Email, Last_Name, ID, Phone and Mobile of  contacts where last name starts with "Ni" and mobile contains the digit 5 or phone number equals 555-678-9999

Request body

{

  Records {

    Contacts(where: {

      and: [

        { Last_Name: { like: "Ni%" } },

        {

          or: [

            { Phone: { equals: "555-678-9999" } },

            { Mobile: { like: "%5%" } }

          ]

        }

      ]

    }) {

      _data {

        Email { value }

        Last_Name { value }

        id { value }

        Phone { value }

        Mobile { value }

  }}}}

 

Introspecting the GraphQL schema in Postman will reveal the details of fields and supported operators for each module. Check out our previous Kaizen, where we explained this using videos.

Metadata

You can use the filter argument to filter metadata resources.

For example, the query below fetches metadata of Deals module and api_name of its layouts and fields

Request body

query {

  Meta {

    Modules(filter: { api_name: "Deals" }) {

      _data {

        id

        singular_label

        plural_label

        layouts {

          _data {

            id

            api_name

          }

        }

        fields {

          _data {

            api_name

     }}}}}}

How do I paginate results in GraphQL?

In GraphQL, we use the offset and limit argument to paginate results.
You can use offset to fetch the next page of results by passing the value from your previous response, starting with null for the initial set.  For each page, the number of records has a limit: up to 100 records for root queries or 10 for nested data.
The value to be passed in offset is obtained by querying for previous_offset and next_offset inside _info object.

Is it possible to sort records in GraphQL? 

The order_by argument can be used to sort the response set after fetching records to ascending or descending order.

For example, the below query fetches the fields Deal_Name, Expected_Revenue, and Probability from Deals module in descending order of probability.


Request body

query {

  Records {

    Deals(order_by: { Probability: { order: DESC } }) {

      _data {

        Deal_Name { value }

        Expected_Revenue { value }

        Probability { value }

}}}}

When should I choose Zoho CRM GraphQL APIs over Zoho CRM REST APIs, and vice versa? 

Use Zoho CRM GraphQL APIs when:

  • You need to fetch complex, nested data from multiple resources (e.g., accounts with linked contacts and deals) in a single request and avoid under-fetching of required data/metadata.

  • You need to minimize over-fetching of data/metadata by selecting only specific resources, fields of the resources, and relationships of the resources.

  • You need to query data and metadata together efficiently. 

Use Zoho CRM REST APIs when :

  • You need to perform simple CRUD operations (e.g., fetch/update a single product).

  • Your use case involves straightforward endpoints without nested data/metadata.

  • You need to do add/update/delete operations.

We trust that this post addressed your doubts on GraphQL APIs. If you have any questions please let us know in the comment section or reach out to us at support@zohocrm.com.

    • 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

    • Zoho Devops

      We have a Zoho one account which we have integrated with an SAS educational product, sold on a subscription model, using webhooks and API calls. We make some use of custom fields and cross module lookups and relationships. We utilize CRM, Books and billing
    • Fuel up your sales with the Zoho SalesIQ + Bigin integration

      Hi everyone! We’re happy to bring you the all-new Zoho SalesIQ + Bigin integration. With this, every prospect from your website instantly becomes a contact in Bigin, complete with transcripts and follow-up tasks, so you never lose a lead again. Let's
    • Add a 'Log a Call' link to three dot icon in Canvas

      Hi, There's a three dot element when creating a canvas called 'More'. I would like to modify this to add a link that says 'Log a Call' in order to quickly record the details of a cellphone call. I'd also like this to be a simple 'contact' selection and
    • Introducing AI-powered Assessments & Zoho's native LLM, Zia

      We’ve shipped a cleaner, faster way to create assessments in Zoho Recruit. 🚀 Instead of manually building question banks or copying old templates, you can now generate ready-to-use assessments in just a few clicks, all tailored to the role you’re hiring
    • Ability to Reset Visitor Fields During an Active Chat Flow

      Hello Zoho SalesIQ Team, We hope you are doing well. We would like to propose a feature enhancement to Zoho SalesIQ regarding the management of visitor fields within Zobot flows. Use Case: Our bot asks the visitor to provide information about a 3rd person
    • External ID in Zoho CRM

      Hello everyone! We know that Zoho CRM allows you to integrate third-party apps and manipulate data through APIs. While you integrate a third-party application, you may want to store the third-party reference IDs in Zoho CRM's records. To meet this need
    • Some emails are not being delivered

      I have this problem where some of my mail just seems to disappear. When I send it, it appears as sent with no mention of any problem, but my recipient never gets it, not even in the Spam folder. Same for receiving, I have a secondary e-mail address, and
    • New in Zoho Chat : Search for contacts, files, links & conversations with the all new powerful 'Smart Search' bar.

      With the newly revamped 'Smart Search' bar in Zoho Chat, we have made your search for contacts, chats, files and links super quick and easy using Search Quantifiers.   Search for a contact or specific conversations using quantifiers, such as, from: @user_name - to find chats or channel conversations received from a specific user. to: @user_name - to find chats or channel conversations sent to a specific user. in: #channel_name - to find a particular instance in a channel. in: #chat_name - to find
    • Template modifiactions

      Hello, I am struggling with the templates in ZOHO Books. Especially with the placement of some items, like company address, ship to, bill to etc.  For example: One item I like from template X (placement of ship to and bill to next to each other in the
    • Aggregating the First Value in the Group By of a dataset

      Hi I am trying to get the following Aggregate Formula to work in my chart, but cannot seem to get the right format. I have a series of data that I am running an include_groupby and want to SUM only a column in the first row of each group. So for example.
    • Admin Control Over Profile Picture Visibility in Zoho One

      Hello Zoho Team, We hope you are doing well. Currently, as per Zoho’s design, each user can manage the visibility of their profile picture from their own Zoho Accounts page: accounts.zoho.com → Personal Information → Profile Picture → Profile Picture
    • Track Zoho Campaign and Workflow sales impact

      I am attempting to measure the performance of our marketing workflows and campaigns by comparing the date each campaign was sent to a contact with the purchase date of the contact. For example, if Contact A was sent Email A on 9/1 and made a purchase
    • Tables for Europe Datacenter customers?

      It's been over a year now for the launch of Zoho Tables - and still not available für EU DC customers. When will it be available?
    • What is a line break code for zoho?

      Hi, I am archiving data by adding values from a single line field from one form to a multi-line field in another form. So I need a code/function that starts a new line on that multi-line field so it does not just keep adding it on the same line. Example, doing something like this means that it will be on a same line. archive.field1 = archive.field1 + input.Field1 I need a code so the input.Field1 can just start on the next line. Instead of "value 1, 2,3,4,5" It will be: "1 2 3 4 etc.".  something
    • Automatic Project Owner change

      Is there a way to change Project Owner automatically once a specific Milestone in a project is marked as completed. Different Teams are working on projects in our Org, they have their own Milestones to complete and so we transfer the project from team
    • Button to add product to cart

      Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
    • Problem with Submit Button Design

      I have made a template to apply to my forms and under the button controls, I have it set to "standard" and yet it's still filling the container. This is super frustrating and looks weird. Why do we not have full control over button size? How can I fix
    • Zoho CRM- Authorize your Microsoft Teams account issue

      Hi, I tried to link Zoho CRM with Teams and I got the following message: Clicking "Authorize now" sent me to the following page, Microsoft tried to start a session but, after 3 seconds the page closed and nothing happened. I get the same message each
    • 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
    • Is there a way to associate an email in ZOHO Main to a Vendor record in ZOHO CRM

      My situation is as below, I have a vendor in ZOHO CRM lets say "Vend A" and an associated contact, "Cont A" If Cont A sends me an email using the email I've registered in the contact record the standard OOTB email sync will work. But the vendor has some
    • Bank charges are applied. Please select a bank account.

      Hello, I'm trying to add bank charges to a customer payment, but I get the error message "Bank charges are applied. Please select a bank account." I found this old thread, where it says that I need to "select a Bank account for the 'Deposit To' dropdown
    • Kaizen #207 - Answering your Questions | Advanced Queries using COQL API

      Hi everyone, and welcome to another Kaizen week! As part of Kaizen #200 milestone, many of you shared topics you would like us to cover, and we have been addressing them one by one over the past few weeks. Today, we are picking up one of those requests
    • Présentation de SecureForms dans Zoho Vault

      Soyons francs : demander à quelqu’un de transmettre un mot de passe ou des informations sensibles n’est jamais une tâche facile. On attend, on relance, parfois de nombreuses fois. Et quand l’information arrive, elle se retrouve souvent dispersée dans
    • Introducing Connected Records to bring business context to every aspect of your work in Zoho CRM for Everyone

      Hello Everyone, We are excited to unveil phase one of a powerful enhancement to CRM for Everyone - Connected Records, available only in CRM's Nextgen UI. With CRM for Everyone, businesses can onboard all customer-facing teams onto the CRM platform to
    • Granular Email Forwarding Controls in Zoho Mail (Admin Console and Zoho One)

      Hello Zoho Mail Team, How are you? At present, the Zoho Mail Admin Console allows administrators to configure email forwarding for an entire mailbox, forwarding all incoming emails to another address. This is helpful for delegation or backup purposes,
    • Sales order & purchase order item links for item details

      This is fantastic for checking lots of things, I use it a lot. It would be great to see it extended to invoices & bills On another note, may as well throw in my favourite whinge ..... Wish you guys would get the PO receive differences sorted urgently,
    • Custom Fonts in Zoho CRM Template Builder

      Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
    • Zoho Workdrive - Communication / Chat Bar

      Hi Team, Please consider adding an option to allow admins to turn on or off the Zoho Communication Bar. Example of what I mean by Communication Bar: It's such a pain sometimes when I'm in WorkDrive and I want to share a link to a file with a colleague
    • Introducing Profile Summary: Faster Candidate Insights with Zia

      We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
    • Kaizen #190 - Queries in Custom Related Lists

      Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss yet another interesting enhancement to Queries. As you all know, Queries allow you to dynamically retrieve data from CRM as well as third-party services directly within
    • Need the ability to have read only fields on a form.

      There needs to be functionality in Creator that allows a field on a form to be read only. Most screen building software applications have this capability. I know you can hide certain fields from specific users and that you can also make the whole form read only but that's not the functionality I need. I want to be able to create a form where certain fields are editable and other are for display purposes only (read only). For example if the form was displaying information on an item that the user
    • Reverse payment on accidentally closed invoice.

      An invoice was closed accidentally with the full payment added. However, only partial payment was paid. How can I reopen the invoice and reverse this to update it to show partial payment?
    • New integration: Track booking page appointments in Google Analytics 4

      Hello all, Greetings from the Zoho Bookings team! We’re excited to introduce our new Google Analytics 4 (GA4) integration designed to help you track booking activity, understand customer behavior, and measure marketing performance, all in one place. What
    • Zoho Books Sandbox environment

      Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
    • How to list emails in a folder, e.g. Inbox, on multiple pages when using Zoho mail webpage?

      Something as shown in the figure. There are totally 50 emails in Sent folder. If "Mail per page" equals 20, then the Sent folder is split into 3 pages. When I wander through Sent folder, I can just select a specific page to jump to. BTW, it seems that
    • How to add image to items list in Invoice or Estimate?

      Hello! I have just started using Zoho Invoice to create estimates and, possibly to switch from our current CRM/ERP Vendor to Zoho. I have a small company that is installing CCTV systems and Alarm systems. My question is, can I add images of my "items" to item list in Zoho Invoice and Estimates and their description? I would like to show my clients the image of items in our estimates so they can decide if they like these items. And I tell you, often they choose more expensive products just because
    • Zoho Calendar soft bounce on @hotmail.com and @yahoo.com email addresses

      Hello, our Zoho calendar recently does not send the calendar invites to emails with hotmail and yahoo domains and comes back with a "soft bounce". other domains like Gmail works fine. Also sending "email" to the same emails to the above domains work well
    • How can I filter a field integration?

      Hi,  I have a field integration from CRM "Products" in a form, and I have three product Categories in CRM. I only need to see Products of a category. Thanks for you answers.
    • ERROR CODE :512 - 5.4.4 DNS error:NXDOMAIN.

      Suddenly we cant send mail, we are getting this error for all outbound mail to multiple domains.
    • Can Zoho Flows repeat Actions more than once?

      I'm attempting to make an intentional Zoho Flow loop using the below layout. However, when "WithinLimit" condition is met, the program fails to execute the action "Get & Add Request Co..." again. Is this by design? Is Zoho Flows unable to repeat actions
    • Next Page