Zoho Cliq · Schema

Zoho Cliq Functions Schemas

MessagingTeam CollaborationChatBotsWebhooksSlash CommandsCommunication
View JSON Schema on GitHub

JSON Schema

functions.json Raw ↑
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Zoho Cliq Functions Schemas",
  "definitions": {
    "NoResponse": {
      "type": "object",
      "description": "Represents an empty successful response where no payload is returned.",
      "properties": {
        "Response Code": {
          "type": "string",
          "example": "204 No response"
        }
      }
    },
    "FunctionResponse": {
      "type": "object",
      "description": "Response schema for function create, get, and update operations.",
      "properties": {
        "url": {
          "type": "string",
          "description": "API endpoint URL for the function resource.",
          "example": "/api/v3/functions"
        },
        "type": {
          "type": "string",
          "description": "Resource type.",
          "example": "function"
        },
        "data": {
          "type": "object",
          "description": "Function details.",
          "properties": {
            "name": {
              "type": "string",
              "example": "createTask"
            },
            "id": {
              "type": "string",
              "example": "53719000002124011"
            },
            "function_type": {
              "type": "string",
              "example": "button"
            },
            "handlers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  }
                }
              }
            },
            "creator": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            },
            "execution_type": {
              "type": "string",
              "example": "deluge"
            },
            "status": {
              "type": "string",
              "example": "enabled"
            },
            "type": {
              "type": "string",
              "example": "custom"
            },
            "description": {
              "type": "string"
            },
            "scope": {
              "type": "string",
              "example": "personal"
            }
          }
        }
      },
      "example": {
        "url": "/api/v3/functions",
        "type": "function",
        "data": {
          "name": "createTask",
          "id": "53719000002124011",
          "function_type": "button",
          "handlers": [
            {
              "type": "button_handler"
            }
          ],
          "creator": {
            "name": "James",
            "id": "65113112"
          },
          "execution_type": "deluge",
          "status": "enabled",
          "type": "custom",
          "description": "Creates a task in integrated system",
          "scope": "personal"
        }
      }
    },
    "GenericResponse": {
      "type": "object",
      "description": "Generic API response envelope.",
      "properties": {
        "url": {
          "type": "string",
          "example": "/api/v3/resource"
        },
        "type": {
          "type": "string",
          "example": "object"
        },
        "data": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "FunctionListResponse": {
      "type": "object",
      "description": "Response schema for listing functions.",
      "properties": {
        "deleted": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "url": {
          "type": "string",
          "example": "/api/v3/functions"
        },
        "next_token": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "example": "function"
        },
        "total_count": {
          "type": "integer"
        },
        "sync_token": {
          "type": "string"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "example": {
        "url": "/api/v3/functions",
        "next_token": "NTB8LTF8NTM3MTkwMDAwMDAyNDUwMTE=",
        "type": "function",
        "sync_token": "NTB8MTc3NzQzMjg2NjI1MXw1MzcxOTAwMDAwMjEyNDAxMQ==",
        "data": [
          {
            "name": "createTask",
            "id": "53719000002124011",
            "function_type": "button",
            "handlers": [
              {
                "type": "button_handler"
              }
            ],
            "creator": {
              "name": "James",
              "id": "65113112"
            },
            "execution_type": "deluge",
            "status": "enabled",
            "type": "custom",
            "description": "Creates a task in integrated system",
            "scope": "personal"
          },
          {
            "name": "SubmitFeedback",
            "id": "53719000002124012",
            "function_type": "form",
            "handlers": [
              {
                "type": "form_submit_handler"
              }
            ],
            "creator": {
              "name": "James",
              "id": "65113112"
            },
            "execution_type": "deluge",
            "status": "enabled",
            "type": "custom",
            "description": "Processes feedback form submissions from users",
            "scope": "personal"
          }
        ]
      }
    },
    "FunctionHandlerDetailsResponse": {
      "type": "object",
      "description": "Response schema returned when fetching the full details of a specific function handler.",
      "properties": {
        "url": {
          "type": "string",
          "description": "Endpoint URL of the handler resource."
        },
        "type": {
          "type": "string",
          "description": "Resource type identifier.",
          "example": "button_handler"
        },
        "data": {
          "type": "object",
          "description": "Full configuration and runtime parameter details of the handler.",
          "properties": {
            "script": {
              "type": "string",
              "description": "Deluge source code of the handler."
            },
            "return_type": {
              "type": "string",
              "description": "Return type expected from the handler script.",
              "example": "MAP"
            },
            "params": {
              "type": "array",
              "description": "List of runtime parameters passed to the handler script.",
              "items": {
                "type": "object",
                "properties": {
                  "param_name": {
                    "type": "string",
                    "description": "Name of the parameter."
                  },
                  "param_type": {
                    "type": "string",
                    "description": "Data type of the parameter (e.g., MAP, STRING, BOOLEAN)."
                  }
                }
              }
            }
          },
          "additionalProperties": true
        }
      },
      "example": {
        "url": "/api/v3/functions/53719000002124011/handlers/button_handler",
        "type": "button_handler",
        "data": {
          "script": "// Triggered when a user clicks the \"Approve Task\" instant button\n// [Approve Task](invoke.function|ApproveTask)\nresponse = Map();\ntask_name = arguments.get(\"task_name\");\nassignee = arguments.get(\"assignee\");\nresponse.put(\"text\", \"\u2705 Task '\" + task_name + \"' has been approved and assigned to \" + assignee + \". They'll be notified shortly.\");\nreturn response;",
          "return_type": "MAP",
          "params": [
            {
              "param_name": "access",
              "param_type": "MAP"
            },
            {
              "param_name": "environment",
              "param_type": "MAP"
            },
            {
              "param_name": "chat",
              "param_type": "MAP"
            },
            {
              "param_name": "user",
              "param_type": "MAP"
            },
            {
              "param_name": "message",
              "param_type": "MAP"
            },
            {
              "param_name": "target",
              "param_type": "MAP"
            },
            {
              "param_name": "arguments",
              "param_type": "MAP"
            },
            {
              "param_name": "event",
              "param_type": "STRING"
            },
            {
              "param_name": "location",
              "param_type": "MAP"
            }
          ]
        }
      }
    },
    "FunctionHandlerResponse": {
      "type": "object",
      "description": "Response schema for function handler operations.",
      "properties": {
        "url": {
          "type": "string",
          "example": "/api/v3/functions/53719000002124011/handlers/button_handler"
        },
        "type": {
          "type": "string",
          "example": "execution_handler"
        },
        "data": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "example": "button_handler"
            },
            "script": {
              "type": "string",
              "example": "response = Map();\nresponse.put(\"text\", \"Task approved successfully!\");\nreturn response;"
            },
            "function_id": {
              "type": "string",
              "example": "53719000002124011"
            }
          }
        }
      },
      "example": {
        "url": "/api/v3/functions/53719000002124011/handlers/button_handler",
        "type": "execution_handler",
        "data": {
          "name": "button_handler",
          "script": "response = Map();\nresponse.put(\"text\", \"Task approved successfully!\");\nreturn response;",
          "function_id": "53719000002124011"
        }
      }
    },
    "v3-function-create": {
      "type": "object",
      "description": "Payload for creating a new function.",
      "required": [
        "name",
        "description",
        "function_type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 30,
          "description": "Unique name for the function.<br>\n<b>Maximum length</b>: 30 characters.\n"
        },
        "description": {
          "type": "string",
          "maxLength": 300,
          "description": "Description for the function.<br>\n<b>Maximum length</b>: 300 characters.\n"
        },
        "function_type": {
          "type": "string",
          "enum": [
            "button",
            "form",
            "widget_button"
          ],
          "description": "Type of the function which determines where it can be invoked from.<br>\n<b>Allowed values:</b>\n<ul>\n  <li><b>button</b> - Triggered by button clicks in messages.</li>\n  <li><b>form</b> - Triggered by form submissions and interactions.</li>\n  <li><b>widget_button</b> - Triggered by button clicks inside widgets.</li>\n</ul>\n<b>Note</b>: <code>function_type</code> cannot be changed after creation.\n"
        },
        "execution_type": {
          "type": "string",
          "enum": [
            "deluge",
            "webhook"
          ],
          "description": "Execution type of the function.<br>\n<ul>\n  <li><b>deluge</b> (default) - Handler logic is written in Deluge and executed on Zoho's platform.</li>\n  <li><b>webhook</b> - Cliq sends a POST request to your <code>execution_url</code> when the function is triggered. Provide <code>execution_url</code> when using this type.</li>\n</ul>\n"
        },
        "execution_url": {
          "type": "string",
          "maxLength": 225,
          "description": "The URL that Cliq sends a POST request to when the function is triggered. Required when <code>execution_type</code> is <code>webhook</code>.<br>\n<b>Maximum length</b>: 225 characters.\n"
        }
      }
    },
    "base64_regex": {
      "type": "string",
      "description": "Base64-encoded pagination or sync token used for cursor-based pagination and incremental data sync."
    },
    "v3-function-edit": {
      "type": "object",
      "description": "Payload for updating a function. `function_type` cannot be changed after creation.",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 30,
          "description": "Updated function name.<br>\n<b>Maximum length</b>: 30 characters.\n",
          "example": "createTask"
        },
        "description": {
          "type": "string",
          "maxLength": 300,
          "description": "Updated function description.<br>\n<b>Maximum length</b>: 300 characters.\n",
          "example": "Creates a task in integrated system"
        },
        "execution_url": {
          "type": "string",
          "maxLength": 225,
          "description": "Updated webhook execution URL for the function. Only applicable when the function's <code>execution_type</code> is <code>webhook</code>.<br>\n<b>Maximum length</b>: 225 characters.\n"
        }
      }
    },
    "FUNCTION_ID": {
      "type": "string",
      "description": "Unique numeric identifier of a Function. Used in function management and handler endpoints."
    },
    "longid_regex": {
      "type": "string",
      "description": "Numeric long integer identifier used to reference platform components such as Commands, Functions, Widgets, Message Actions, Schedulers, and Extensions."
    },
    "v3-exehandler-edit": {
      "type": "object",
      "description": "Payload for updating an existing function handler.",
      "properties": {
        "script": {
          "type": "string",
          "description": "Updated Deluge script source code for the handler. Maximum size is 250KB. Only applicable for Deluge functions."
        },
        "permissions": {
          "type": "array",
          "maxItems": 5,
          "description": "List of data attributes to include in the webhook payload. Only applicable for Webhook functions. Not all permissions are valid for every handler type - refer to the <a href=\"/cliq/help/restapi/v3/functions/#createFunctionHandler\">Create a handler</a> table for availability.<br>\n<b>Available values</b>: <code>chat</code>, <code>message</code>, <code>user</code>.\n",
          "items": {
            "type": "string",
            "enum": [
              "chat",
              "message",
              "user"
            ]
          }
        }
      }
    },
    "FUNCTION_HANDLER_TYPE_regex": {
      "type": "string",
      "description": "Name of a function handler.",
      "enum": [
        "button_handler",
        "form_submit_handler",
        "form_change_handler",
        "form_dynamic_select_handler",
        "form_view_handler",
        "widget_button_handler"
      ]
    },
    "v3-exehandler-create": {
      "type": "object",
      "description": "Payload for creating a new function handler.",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "button_handler",
            "form_submit_handler",
            "form_change_handler",
            "form_dynamic_select_handler",
            "form_view_handler",
            "widget_button_handler"
          ],
          "description": "Type of the function handler which determines the trigger for execution.<br>\n<b>Allowed values:</b>\n<ul>\n  <li><b>button_handler</b> - Triggered by button clicks in messages.</li>\n  <li><b>form_submit_handler</b> - Triggered by form submissions.</li>\n  <li><b>form_change_handler</b> - Triggered by changes in form fields.</li>\n  <li><b>form_dynamic_select_handler</b> - Triggered to populate dynamic field options in forms.</li>\n  <li><b>form_view_handler</b> - Renders the form UI when a user navigates to the form's permalink URL.</li>\n  <li><b>widget_button_handler</b> - Triggered by button clicks inside widgets.</li>\n</ul>\n"
        },
        "script": {
          "type": "string",
          "description": "Deluge script source code for the handler. Maximum size is 250KB. Only applicable for Deluge functions.\n"
        },
        "permissions": {
          "type": "array",
          "maxItems": 5,
          "description": "List of data attributes to include in the webhook payload when the handler fires. Only applicable for Webhook functions. Not all permissions are valid for every handler type - refer to the <a href=\"/cliq/help/restapi/v3/functions/#createFunctionHandler\">Create a handler</a> table for availability.<br>\n<b>Available values</b>: <code>chat</code>, <code>message</code>, <code>user</code>.\n",
          "items": {
            "type": "string",
            "enum": [
              "chat",
              "message",
              "user"
            ]
          }
        }
      }
    }
  }
}