Zoho Coql API

The Coql API from Zoho — 1 operation(s) for coql.

Documentation

Specifications

Code Examples

Other Resources

OpenAPI Specification

zoho-coql-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Helpcenter Coql API
  version: 1.0.0
tags:
- name: Coql
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
                      description: Human readable error message
                      maxLength: 2000
                    status:
                      type: string
                      description: Response status
                      enum:
                      - error
                  required:
                  - code
                  - details
                  - message
                  - status
                - type: object
                  title: DuplicateData
                  description: Duplicate data error response
                  additionalProperties: false
                  properties:
                    code:
                      type: string
                      description: Error code indicating duplicate data
                      enum:
                      - DUPLICATE_DATA
                    details:
                      oneOf:
                      - type: object
                        description: Duplicate data details with column name
                        additionalProperties: false
                        properties:
                          column_name:
                            type: string
                            description: The field API Name of the duplicate select column
                            maxLength: 150
                        required:
                        - column_name
                      - type: object
                        description: Duplicate data details with aggregate function
                        additionalProperties: false
                        properties:
                          column_name:
                            type: string
                            description: The field API Name of the duplicate column
                            maxLength: 150
                          aggregate:
                            type: string
                            description: The duplicate aggregate function used
                            enum:
                            - MAX
                            - MIN
                            - AVG
                            - SUM
                            - COUNT
                        required:
                        - column_name
                        - aggregate
                    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: DuplicateAlias
                  description: Duplicate alias error response
                  additionalProperties: false
                  properties:
                    code:
                      type: string
                      description: Error code indicating duplicate alias
                      enum:
                      - DUPLICATE_ALIAS
                    details:
                      type: object
                      description: Additional details about the duplicate alias error
                      additionalProperties: false
                      properties:
                        alias:
                          type: string
                          description: The duplicate alias used in the query
                          maxLength: 150
                        referred_columns:
                          type: array
                          description: List of columns that referred to the duplicate alias
                          minItems: 2
                          maxItems: 500
                          items:
                            type: string
                            description: The field API name used in the select clause referring to the duplicate alias
                            maxLength: 150
                    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: MandatoryNotFound
                  description: Mandatory field not found error response
                  additionalProperties: false
                  properties:
                    code:
                      type: string
                      description: Error code indicating mandatory field not found
                      enum:
                      - MANDATORY_NOT_FOUND
                    details:
                      type: object
                      description: Details about the missing mandatory field
                      additionalProperties: false
                      properties:
                        api_name:
                          type: string
                          description: API name of the missing mandatory field
                          maxLength: 500
                      required:
                      - api_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: InvalidData
                  description: Invalid data error response
                  additionalProperties: false
                  properties:
                    code:
                      type: string
                      description: Error code indicating invalid data
                      enum:
                      - INVALID_DATA
                    details:
                      oneOf:
                      - type: object
                        description: Invalid data details with expected data type
                        additionalProperties: false
                        properties:
                          expected_data_type:
                            type: string
                            description: The expected data type for the field
                            maxLength: 100
                          api_name:
                            type: string
                            description: API name of the field with invalid data
                            maxLength: 500
                          json_path:
                            type: string
                            description: JSON path to the invalid field
                            maxLength: 500
                        required:
                        - expected_data_type
                        - api_name
                        - json_path
                      - type: object
                        description: Invalid data details with supported values
                        additionalProperties: false
                        properties:
                          api_name:
                            type: string
                            description: API name of the field with invalid data
                            maxLength: 500
                          json_path:
                            type: string
                            description: JSON path to the invalid field
                            maxLength: 500
                          supported_values:
                            type: array
                            description: List of supported values for the field
                            maxItems: 1
                            items:
                              type: string
                              description: A supported value
                              enum:
                              - fields
                        required:
                        - api_name
                        - json_path
                        - supported_values
                      - type: object
                        description: Invalid data details for unsupported aggregate function
                        additionalProperties: false
                        properties:
                          reason:
                            type: string
                            description: Reason for the invalid data
                            maxLength: 500
                          column:
                            type: string
                            description: The column with unsupported function
                            maxLength: 500
                        required:
                        - reason
                        - column
                      - type: object
                        description: Invalid data details with expected data type and supported values
                        additionalProperties: false
                        properties:
                          expected_data_type:
                            type: string
                            description: The expected data type for the field
                            maxLength: 100
                          api_name:
                            type: string
                            description: API name of the field with invalid data
                            maxLength: 500
                          json_path:
                            type: string
                            description: JSON path to the invalid field
                            maxLength: 500
                          supported_values:
                            type: array
                            description: List of supported values for the field
                            maxItems: 1
                            items:
                              type: string
                              description: A supported value
                              enum:
                              - fields
                        required:
                        - expected_data_type
                        - api_name
                        - json_path
                        - supported_values
                      - type: object
                        description: Empty details for invalid data error
                        additionalProperties: false
                        properties: {}
                    message:
                      type: string

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