Zoho CRM Coql

COQL APIs to fetch records data based on queries. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 1 operation(s).

OpenAPI Specification

zoho-crm-coql-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Coql",
    "description": "COQL APIs to fetch records data based on queries",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API Version"
        }
      }
    }
  ],
  "paths": {
    "/coql": {
      "post": {
        "operationId": "executeCOQLQuery",
        "summary": "Execute COQL query",
        "description": "Executes a COQL select query to fetch records data.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Leads.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Contacts.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Accounts.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Deals.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Tasks.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Events.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Calls.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Products.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Vendors.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Campaigns.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Cases.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Solutions.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Pricebooks.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Quotes.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Salesorders.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Purchaseorders.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Custom.READ",
              "ZohoCRM.coql.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Leads.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Contacts.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Accounts.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Deals.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Tasks.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Events.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Calls.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Products.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Vendors.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Campaigns.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Cases.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Solutions.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Pricebooks.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Quotes.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Salesorders.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Purchaseorders.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.Custom.READ",
              "ZohoCRM.coql.READ",
              "ZohoCRM.settings.fields.READ"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "description": "Request Body to get records data using COQL",
                "properties": {
                  "select_query": {
                    "type": "string",
                    "description": "COQL select query to fetch records data",
                    "maxLength": 2147483647
                  },
                  "include_meta": {
                    "type": "array",
                    "description": "List of metadata to include in the response. Currently only supports 'fields' to get field metadata for select columns.",
                    "maxItems": 1,
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "description": "Metadata type to include",
                      "enum": [
                        "fields"
                      ]
                    }
                  }
                },
                "required": [
                  "select_query"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success response with matching records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Response containing matching records and pagination info",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "description": "Root key containing list of records",
                      "minItems": 1,
                      "maxItems": 200,
                      "items": {
                        "type": "object",
                        "description": "Individual record data",
                        "additionalProperties": true
                      }
                    },
                    "info": {
                      "type": "object",
                      "description": "Pagination and count information",
                      "additionalProperties": false,
                      "properties": {
                        "count": {
                          "type": "integer",
                          "format": "int32",
                          "description": "Number of records returned"
                        },
                        "more_records": {
                          "type": "boolean",
                          "description": "Indicates if there are more records available"
                        }
                      },
                      "required": [
                        "count",
                        "more_records"
                      ]
                    },
                    "fields": {
                      "type": "object",
                      "description": "Field metadata for the select columns. Keys are field API names and values are field metadata objects.",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/CoqlFieldSchema"
                      }
                    }
                  },
                  "required": [
                    "data",
                    "info"
                  ]
                }
              }
            }
          },
          "204": {
            "description": "Success response when there are no matching records"
          },
          "400": {
            "description": "Error response due to invalid query",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "title": "SyntaxError",
                      "description": "Syntax error response",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating syntax error",
                          "enum": [
                            "SYNTAX_ERROR"
                          ]
                        },
                        "details": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "description": "Empty details for syntax error"
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "description": "Details about the syntax error clause",
                              "properties": {
                                "clause": {
                                  "type": "string",
                                  "description": "The clause where the syntax error occurred",
                                  "maxLength": 1000
                                }
                              },
                              "required": [
                                "clause"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "description": "Details about the syntax error location",
                              "properties": {
                                "line": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "Line number where the error occurred"
                                },
                                "column": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "Column number where the error occurred"
                                },
                                "near": {
                                  "type": "string",
                                  "description": "Text near the error location",
                                  "maxLength": 1000
                                }
                              },
                              "required": [
                                "line",
                                "column",
                                "near"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "description": "Details about unsupported operator in syntax error",
                              "properties": {
                                "operator": {
                                  "type": "string",
                                  "description": "The unsupported operator",
                                  "maxLength": 100
                                }
                              },
                              "required": [
                                "operator"
                              ]
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "description": "Details about syntax error with near text only",
                              "properties": {
                                "near": {
                                  "type": "string",
                                  "description": "Text near the error location",
                                  "maxLength": 1000
                                }
                              },
                              "required": [
                                "near"
                              ]
                            }
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "Human readable error message",
                          "maxLength": 2000
                        },
                        "status": {
                          "type": "string",
                          "description": "Response status",
                          "enum": [
                            "error"
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "details",
                        "message",
                        "status"
                      ]
                    },
                    {
                      "type": "object",
                      "title": "LimitExceeded",
                      "description": "Limit exceeded error response",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating limit exceeded",
                          "enum": [
                            "LIMIT_EXCEEDED"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "description": "Additional details about the limit exceeded error",
                          "additionalProperties": true
                        },
                        "message": {
                          "type": "string",
                          "description": "Human readable error message",
                          "maxLength": 2000
                        },
                        "status": {
                          "type": "string",
                          "description": "Response status",
                          "enum": [
                            "error"
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "details",
                        "message",
                        "status"
                      ]
                    },
                    {
                      "type": "object",
                      "title": "InvalidQuery",
                      "description": "Invalid query error response",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating invalid query",
                          "enum": [
                            "INVALID_QUERY"
                          ]
                        },
                        "details": {
                          "oneOf": [
                            {
                              "type": "object",
                              "description": "Invalid Column Details",
                              "additionalProperties": false,
                              "properties": {
                                "column_name": {
                                  "type": "string",
                                  "description": "The field API Name with invalid data",
                                  "maxLength": 150
                                }
                              },
                              "required": [
                                "column_name"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid Column LimitDetails",
                              "additionalProperties": false,
                              "properties": {
                                "limit": {
                                  "type": "string",
                                  "maxLength": 150,
                                  "description": "The maximum allowed limit for the column if applicable"
                                }
                              },
                              "required": [
                                "limit"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid Column Clause Details",
                              "additionalProperties": false,
                              "properties": {
                                "column_name": {
                                  "type": "string",
                                  "description": "The field API Name with invalid data",
                                  "maxLength": 150
                                },
                                "clause": {
                                  "type": "string",
                                  "maxLength": 150,
                                  "description": "The clause associated with the invalid column"
                                }
                              },
                              "required": [
                                "column_name",
                                "clause"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid Module Details",
                              "additionalProperties": false,
                              "properties": {
                                "module": {
                                  "type": "string",
                                  "description": "The field API Name with invalid data",
                                  "maxLength": 150
                                }
                              },
                              "required": [
                                "module"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid CV ID Details",
                              "additionalProperties": false,
                              "properties": {
                                "cvid": {
                                  "type": "string",
                                  "description": "The field API Name with invalid data",
                                  "maxLength": 150
                                }
                              },
                              "required": [
                                "cvid"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid Operator Details",
                              "additionalProperties": false,
                              "properties": {
                                "reason": {
                                  "type": "string",
                                  "description": "Reason for the invalid query",
                                  "maxLength": 1000
                                },
                                "column_name": {
                                  "type": "string",
                                  "description": "Name of the column involved in the invalid query",
                                  "maxLength": 500
                                },
                                "operator": {
                                  "type": "string",
                                  "description": "Invalid operator used in the query",
                                  "enum": [
                                    ">",
                                    "<",
                                    ">=",
                                    "<=",
                                    "=",
                                    "!=",
                                    "is null",
                                    "is not null"
                                  ]
                                }
                              },
                              "required": [
                                "reason",
                                "column_name",
                                "operator"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid Alias Details",
                              "additionalProperties": false,
                              "properties": {
                                "column_name": {
                                  "type": "string",
                                  "description": "The field API Name with invalid alias",
                                  "maxLength": 150
                                },
                                "alias": {
                                  "type": "string",
                                  "description": "The invalid alias name used",
                                  "maxLength": 1000
                                }
                              },
                              "required": [
                                "alias",
                                "column_name"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Empty details for invalid query",
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "description": "Invalid query details with criteria information",
                              "additionalProperties": false,
                              "properties": {
                                "cv_criteria": {
                                  "type": "boolean",
                                  "description": "Indicates if custom view criteria is involved"
                                },
                                "column_name": {
                                  "type": "string",
                                  "description": "The field API Name with invalid criteria",
                                  "maxLength": 150
                                },
                                "value": {
                                  "type": "string",
                                  "description": "The value used in the invalid criteria",
                                  "maxLength": 500
                                },
                                "operator": {
                                  "type": "string",
                                  "description": "The operator used in the invalid criteria",
                                  "enum": [
                                    "=",
                                    "!=",
                                    ">",
                                    "<",
                                    ">=",
                                    "<=",
                                    "like",
                                    "not like",
                                    "in",
                                    "not in",
                                    "between",
                                    "is null",
                                    "is not null"
                                  ]
                                }
                              },
                              "required": [
                                "cv_criteria",
                                "column_name",
                                "value",
                                "operator"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid query details for subquery returning incompatible values",
                              "additionalProperties": false,
                              "properties": {
                                "sub_query_sequence": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "The sequence number of the subquery"
                                },
                                "operator": {
                                  "type": "string",
                                  "description": "The operator incompatible with multiple subquery values",
                                  "enum": [
                                    "=",
                                    "!=",
                                    ">",
                                    "<",
                                    ">=",
                                    "<="
                                  ]
                                }
                              },
                              "required": [
                                "sub_query_sequence",
                                "operator"
                              ]
                            },
                            {
                              "type": "object",
                              "description": "Invalid query details for subquery with multiple columns",
                              "additionalProperties": false,
                              "properties": {
                                "sub_query_sequence": {
                                  "type": "integer",
                                  "format": "int32",
                                  "description": "The sequence number of the subquery"
                                },
                                "column_name": {
                                  "type": "array",
                                  "description": "The columns specified in the subquery",
                                  "minItems": 2,
                                  "maxItems": 500,
                                  "items": {
                                    "type": "string",
                                    "description": "Column name in the subquery",
                                    "maxLength": 150
                                  }
                                }
                              },
                              "required": [
                                "sub_query_sequence",
                                "column_name"
                              ]
                            }
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "Human readable error message",
                          "maxLength": 2000
                        },
                        "status": {
                          "type": "string",
                          "description": "Response status",
                          "enum": [
                            "error"
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "details",
                        "message",
                        "status"
                      ]
                    },
                    {
                      "type": "object",
                      "title": "InvalidAlias",
                      "description": "Invalid alias error response",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Error code indicating invalid alias",
                          "enum": [
                            "INVALID_ALIAS"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "description": "Additional details about the invalid alias error",
                          "additionalProperties": false,
                          "properties": {
                            "alias": {
                              "type": "string",
                              "description": "The invalid alias name used",
                              "enum": [
                                ""
                              ]
                            },
                            "column_name": {
                              "type": "string",
                              "description": "The field API Name with invalid alias",
                              "maxLength": 150
                            }
                          }
                        },
                        "message": {
                          "type": "string",
                          "de

# --- truncated at 32 KB (113 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoho-crm/refs/heads/main/openapi/zoho-crm-coql-openapi.json