{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Zoho Cliq Mypins Schemas",
"definitions": {
"NoResponse": {
"type": "object",
"description": "Represents an empty successful response where no payload is returned.",
"properties": {
"Response Code": {
"type": "string",
"description": "HTTP response code indicating no content is returned.",
"example": "204 No response"
}
}
},
"GenericResponse": {
"type": "object",
"description": "Generic successful response envelope.",
"properties": {
"url": {
"type": "string",
"description": "Endpoint URL associated with the response."
},
"type": {
"type": "string",
"description": "Resource type returned by the API."
},
"data": {
"type": "object",
"description": "Resource payload.",
"additionalProperties": true
}
},
"additionalProperties": true
},
"pin-category": {
"type": "object",
"description": "Represents a pin folder (chat folder) object. Fields marked conditional are only present when the matching include_fields value is requested.
\nNote: The default folder only contains category_id: \"default\" with no other fields.\n",
"properties": {
"category_id": {
"type": "string",
"description": "Unique ID of the folder, or \"default\" for the default folder."
},
"title": {
"type": "string",
"description": "Display title of the folder."
},
"symbol": {
"type": "string",
"description": "Emoji or zomoji symbol for the folder."
},
"state": {
"type": "string",
"description": "Whether the folder is expanded or collapsed.",
"enum": [
"expanded",
"collapsed"
]
},
"chats": {
"type": "array",
"description": "Conditional - only present when include_fields contains chats.",
"items": {
"$ref": "#/components/schemas/pinned-chat"
}
}
}
},
"pinned-chat": {
"type": "object",
"description": "Represents a pinned chat entry within a folder.",
"properties": {
"chat_id": {
"type": "string",
"description": "ID of the pinned chat."
},
"chat_type": {
"type": "string",
"description": "Type of the chat, such as direct_message, bot, channel, group_chat."
},
"name": {
"type": "string",
"description": "Display name of the chat."
},
"participant_count": {
"type": "integer",
"description": "Number of participants in the chat."
},
"recipients_summary": {
"type": "array",
"description": "Conditional - requires both chats and recipients_summary in include_fields.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "User ID of the participant."
},
"name": {
"type": "string",
"description": "Display name of the participant."
}
}
}
},
"last_message_info": {
"type": "object",
"description": "Conditional - requires both chats and last_message_info in include_fields.",
"properties": {
"id": {
"type": "string",
"description": "Message ID."
},
"sender": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"time": {
"type": "string",
"description": "ISO 8601 datetime of the message."
},
"type": {
"type": "string",
"description": "Message type."
},
"content": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
}
}
},
"is_pinned": {
"type": "boolean",
"description": "Whether the chat is currently pinned."
}
}
},
"get-pin-categories-response": {
"type": "object",
"description": "Response envelope for listing all pin folders.",
"properties": {
"url": {
"type": "string"
},
"type": {
"type": "string",
"example": "pin_categories"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/pin-category"
}
}
},
"example": {
"url": "/v3/pin-categories",
"type": "pin_categories",
"data": [
{
"category_id": "default"
},
{
"category_id": "4000000020001",
"state": "expanded",
"symbol": ":razz:",
"title": "Cliq!",
"chats": [
{
"chat_id": "1488288613043522033",
"chat_type": "channel",
"name": "Product Launch",
"participant_count": 12,
"is_pinned": true
}
]
}
]
}
},
"create-pin-category-request": {
"type": "object",
"description": "Request body for creating a new pin folder.",
"required": [
"title"
],
"properties": {
"title": {
"type": "string",
"maxLength": 255,
"description": "Display title of the chat folder.
\nMaximum Length: 255 characters.\n"
},
"symbol": {
"type": "string",
"maxLength": 50,
"description": "Emoji or zomoji symbol for the folder.
\nMaximum Length: 50 characters.
\nSend an empty string to create the folder without a symbol.\n"
},
"chat_ids": {
"type": "array",
"maxItems": 100,
"description": "Optional list of chat IDs to pin within the folder.
\nMaximum chat IDs: 100.
\nIf provided, these chats will be pinned in the order specified. Otherwise, the folder will be created empty.\n",
"items": {
"type": "string"
}
}
},
"example": {
"title": "Priority Workitems",
"symbol": ":razz:",
"chat_ids": [
"1488288613043522033"
]
}
},
"create-pin-category-response": {
"type": "object",
"description": "Response envelope after creating a pin folder.",
"properties": {
"url": {
"type": "string"
},
"type": {
"type": "string",
"example": "pin_categories"
},
"data": {
"$ref": "#/components/schemas/pin-category"
}
},
"example": {
"url": "/v3/pin-categories",
"type": "pin_categories",
"data": {
"category_id": "4000000020001",
"state": "expanded",
"symbol": ":razz:",
"title": "Priority Workitems"
}
}
},
"update-pin-category-request": {
"type": "object",
"description": "Request body for updating a pin folder. Send exactly one operation type per request.
\nOperation types:\n
title, symbol, and/or state.chat_id with optional pin_above and required last_sync_time.pin_above only (no chat_id) with required last_sync_time.chat_ids (array) with required last_sync_time.title, symbol, and/or state.expanded: The folder is expanded to show its contents.collapsed: The folder is collapsed to hide its contents.chat_id with optional pin_above and required last_sync_time.pin_above only (no chat_id) with required last_sync_time.chat_ids (array) with required last_sync_time.category_id represents the ID of the chat folder.\n"
}
},
"example": {
"category_id": "2890538000000011111"
}
},
"pin-chat-response": {
"type": "object",
"description": "Response envelope after pinning a chat.",
"properties": {
"type": {
"type": "string",
"example": "chat.pin"
},
"data": {
"type": "object",
"properties": {
"chat_id": {
"type": "string"
},
"category_id": {
"type": "string"
}
}
}
},
"example": {
"type": "chat.pin",
"data": {
"chat_id": "2890538000000012345",
"category_id": "2890538000000011111"
}
}
},
"unpin-chat-response": {
"type": "object",
"description": "Response envelope after unpinning a chat.",
"properties": {
"type": {
"type": "string",
"example": "chat.unpin"
},
"data": {
"type": "object",
"properties": {
"chat_id": {
"type": "string"
}
}
}
},
"example": {
"type": "chat.unpin",
"data": {
"chat_id": "2890538000000012345"
}
}
},
"error-response": {
"type": "object",
"description": "Error response returned by the My Pins API.",
"properties": {
"message": {
"type": "string",
"description": "Human-readable error description."
},
"code": {
"type": "string",
"description": "Machine-readable error code.",
"enum": [
"operation_failed",
"operation_not_allowed",
"param_missing",
"max_folders_error",
"client_not_synced",
"invalid_inputs",
"max_pins_error",
"chat_access_denied",
"chat_operation_failed"
]
}
}
}
}
}