{ "$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\n", "properties": { "title": { "type": "string", "maxLength": 255, "description": "New folder title. Maximum 255 characters." }, "symbol": { "type": "string", "maxLength": 50, "description": "New emoji or zomoji. Maximum 50 characters. Send an empty string to clear." }, "state": { "type": "string", "enum": [ "expanded", "collapsed" ], "description": "Toggle the folder's expanded or collapsed state." }, "chat_id": { "type": "string", "description": "ID of the chat to reorder within the folder." }, "chat_ids": { "type": "array", "maxItems": 100, "description": "Replacement list of chat IDs. Replaces all existing chats in the folder. Maximum 100 items.", "items": { "type": "string" } }, "pin_above": { "type": "string", "description": "ID of the item above which to place the target. Used for both chat and folder reordering.
\nIf omitted, the item is moved to the end.\n" }, "last_sync_time": { "description": "Required for reorder and bulk update operations. Accepts ISO 8601 datetime strings or epoch timestamps. The server rejects the request if this is stale.\n", "oneOf": [ { "type": "string" }, { "type": "integer" } ] } } }, "update-pin-category-details-request": { "type": "object", "description": "Request body for updating a pin folder. Send exactly one operation type per request.

\nOperation types:\n\n", "properties": { "title": { "type": "string", "maxLength": 255, "description": "Update title of the chat folder.
\nMaximum Length: 255 characters.\n" }, "symbol": { "type": "string", "maxLength": 50, "description": "Update emoji or zomoji symbol for the folder.
\nMaximum Length: 50 characters.
\nSend an empty string to remove the symbol.\n" }, "state": { "type": "string", "enum": [ "expanded", "collapsed" ], "description": "Toggle the folder's expanded or collapsed state.
\nAllowed values:
\n\n" } }, "example": { "title": "Deliverables for Q3", "symbol": ":smile:", "state": "collapsed" } }, "reorder-chat-in-category-request": { "type": "object", "description": "Request body for updating a pin folder. Send exactly one operation type per request.

\nOperation types:\n\n", "required": [ "chat_id", "last_sync_time" ], "properties": { "chat_id": { "type": "string", "description": "Unique ID of the chat to be reordered within the chat folder.\n" }, "pin_above": { "type": "string", "description": "Unique ID of the chat above which the specified chat should be placed. If not provided, the chat will be moved to the end of the chat folder.\n" }, "last_sync_time": { "description": "\nFormat: Accepts either ISO 8601 datetime strings or epoch timestamps.\n" } }, "example": { "chat_id": "1488288613043522033", "pin_above": "1488288613043522034", "last_sync_time": "2024-01-01T12:00:00Z" } }, "reorder-category-request": { "type": "object", "description": "Request body for updating a pin folder. Send exactly one operation type per request.

\nOperation types:\n\n", "required": [ "last_sync_time" ], "properties": { "pin_above": { "type": "string", "description": "Unique ID of the chat folder above which the specified chat folder should be placed.
\nIf not provided, the folder will be moved to the end of the chat folder list.\n" }, "last_sync_time": { "description": "\nFormat: Accepts either ISO 8601 datetime strings or epoch timestamps.\n" } }, "example": { "pin_above": "4000000020002", "last_sync_time": "2024-01-01T12:00:00Z" } }, "bulk-update-chats-in-category-request": { "type": "object", "description": "Request body for updating a pin folder. Send exactly one operation type per request.

\nOperation types:\n\n", "required": [ "chat_ids", "last_sync_time" ], "properties": { "chat_ids": { "type": "array", "maxItems": 100, "description": "\nUse the Retrieve Chat Folders API to get the current list of pinned chats in a folder and then modify that list as needed and send it back in this request to update the folder's contents.

\nFor new Chat IDs, you can retrieve them from the List Chats API or List Channels API from the chat object returned in message payloads.\n", "items": { "type": "string" } }, "last_sync_time": { "description": "\nFormat: Accepts either ISO 8601 datetime strings or epoch timestamps.\n" } }, "example": { "chat_ids": [ "1488288613043522033", "1488288613043522034" ], "last_sync_time": "2024-01-01T12:00:00Z" } }, "pin-chat-request": { "type": "object", "description": "Request body for pinning a chat. All fields are optional.", "properties": { "category_id": { "type": "string", "description": "Unique ID of the chat folder to pin the chat under. If omitted, the chat will be pinned under My Pins section (default folder).

\nTo learn how to retrieve this ID, see Retrieve Chat Folders API, where 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" ] } } } } }