{
"$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.
\nMaximum length: 30 characters.\n"
},
"description": {
"type": "string",
"maxLength": 300,
"description": "Description for the function.
\nMaximum length: 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.
\nAllowed values:\n
function_type cannot be changed after creation.\n"
},
"execution_type": {
"type": "string",
"enum": [
"deluge",
"webhook"
],
"description": "Execution type of the function.execution_url when the function is triggered. Provide execution_url when using this type.execution_type is webhook.execution_type is webhook.chat, message, user.\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.chat, message, user.\n",
"items": {
"type": "string",
"enum": [
"chat",
"message",
"user"
]
}
}
}
}
}
}