Zoho Cliq · Schema

Zoho Cliq Pinmessages Schemas

MessagingTeam CollaborationChatBotsWebhooksSlash CommandsCommunication
View JSON Schema on GitHub

JSON Schema

pinmessages.json Raw ↑
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Zoho Cliq Pinmessages 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-information": {
      "type": "object",
      "description": "Metadata about the pin itself.",
      "properties": {
        "expiry_time": {
          "description": "When the pin expires. <code>-1</code> means no expiry. <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> datetime string when an expiry is set.\n",
          "oneOf": [
            {
              "type": "integer",
              "example": -1
            },
            {
              "type": "string",
              "example": "2026-04-19T19:09:44+05:30"
            }
          ]
        },
        "creator": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "id": {
              "type": "string"
            }
          }
        },
        "created_time": {
          "type": "string",
          "format": "date-time"
        },
        "last_modified_time": {
          "type": "string",
          "format": "date-time"
        },
        "is_primary": {
          "type": "boolean",
          "description": "<code>true</code> if this is the primary (top) pinned message."
        }
      }
    },
    "pinned-message": {
      "type": "object",
      "description": "A pinned message object. Contains the original message fields (id, type, content, sender, time, mentions) along with pin-specific fields.",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "example": "text"
        },
        "content": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            }
          }
        },
        "sender": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "id": {
              "type": "string"
            }
          }
        },
        "time": {
          "type": "string",
          "format": "date-time"
        },
        "mentions": {
          "type": "array",
          "description": "Present only when the message contains mentions.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            }
          }
        },
        "is_pinned": {
          "type": "boolean",
          "description": "Always <code>true</code> for pinned messages."
        },
        "pin_information": {
          "$ref": "#/components/schemas/pin-information"
        }
      }
    },
    "get-pinned-messages-response": {
      "type": "object",
      "description": "Response envelope for listing all pinned messages.",
      "properties": {
        "url": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "example": "pinmessages"
        },
        "sync_token": {
          "type": "string",
          "description": "Pass in subsequent requests to fetch only pins updated since the last sync."
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/pinned-message"
          }
        }
      },
      "example": {
        "url": "/company/16557244/v3/chats/1488288613043522033/pin-messages",
        "type": "pinmessages",
        "sync_token": "NTB8MTc3MzkyNzUxMjcwNnw0MDAwMDAwMDExMDAz",
        "data": [
          {
            "is_pinned": true,
            "pin_information": {
              "expiry_time": -1,
              "creator": {
                "name": "Tim Harrison",
                "id": "16557777"
              },
              "created_time": "2026-03-19T19:08:32+05:30",
              "last_modified_time": "2026-03-19T19:08:32+05:30",
              "is_primary": true
            },
            "sender": {
              "name": "Tim Harrison",
              "id": "16557777"
            },
            "type": "text",
            "content": {
              "text": "{@16557498}"
            },
            "time": "2026-03-19T10:02:52+05:30",
            "id": 1.7738947728961294e+23,
            "mentions": [
              {
                "name": "@sharan 203",
                "id": "16557498",
                "type": "user"
              }
            ]
          }
        ]
      }
    },
    "get-primary-pinned-message-response": {
      "type": "object",
      "description": "Response envelope when fetching the primary pinned message.",
      "properties": {
        "url": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "example": "pinmessages"
        },
        "data": {
          "$ref": "#/components/schemas/pinned-message"
        }
      },
      "example": {
        "url": "/company/16557244/v3/chats/1488288613043522033/pin-messages",
        "type": "pinmessages",
        "data": {
          "type": "text",
          "id": "1746000123456789001",
          "time": "2026-04-30T09:00:00Z",
          "sender": {
            "id": "1234567890",
            "name": "Alice Johnson"
          },
          "content": {
            "text": "Please review the Q2 report before Friday."
          },
          "is_pinned": true,
          "pin_information": {
            "expiry_time": -1,
            "creator": {
              "id": "9876543210",
              "name": "Bob Smith"
            },
            "created_time": "2026-04-30T09:15:00Z",
            "last_modified_time": "2026-04-30T09:15:00Z",
            "is_primary": true
          }
        }
      }
    },
    "add-pinned-message-request": {
      "type": "object",
      "description": "Request body for pinning a message in a chat.",
      "required": [
        "message_id",
        "expiry_time",
        "notify"
      ],
      "properties": {
        "message_id": {
          "type": "string",
          "description": "ID of the message to pin. This message must already exist in the chat and cannot be deleted.\n"
        },
        "expiry_time": {
          "description": "When the pin should expire. Accepts <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> datetime strings (e.g., <code>\"2026-04-19T19:09:44+05:30\"</code>) or epoch timestamps (e.g., <code>1745068184000</code>). Use <code>-1</code> for no expiry.\n",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            }
          ]
        },
        "notify": {
          "type": "boolean",
          "description": "Set to <code>true</code> to send a notification to chat participants about the new pin. Defaults to <code>false</code>.\n"
        },
        "primary": {
          "type": "boolean",
          "description": "Set to <code>true</code> to pin as the primary (top) message. Defaults to <code>false</code>. If this is the first pin in the chat, it automatically becomes primary regardless of this value.\n"
        }
      },
      "example": {
        "message_id": "1773894772896_12958180473",
        "expiry_time": "2026-04-19T19:09:44+05:30",
        "notify": false
      }
    },
    "add-pinned-message-response": {
      "type": "object",
      "description": "Response envelope after pinning a message.",
      "properties": {
        "url": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "example": "pinmessages"
        },
        "data": {
          "$ref": "#/components/schemas/pinned-message"
        }
      },
      "example": {
        "url": "/v3/chats/1488288613043522033/pin-messages",
        "type": "pinmessages",
        "data": {
          "pin_information": {
            "expiry_time": "2026-04-19T19:09:44+05:30",
            "creator": {
              "name": "Tim Harrison",
              "id": "16557777"
            },
            "created_time": "2026-03-19T19:08:32+05:30",
            "last_modified_time": "2026-03-19T19:08:32+05:30",
            "is_primary": false
          },
          "is_pinned": true,
          "sender": {
            "name": "Tim Harrison",
            "id": "16557777"
          },
          "type": "text",
          "content": {
            "text": "Please review the deployment checklist before the release."
          },
          "time": "2026-03-19T10:02:52+05:30",
          "id": "1773894772896_12958180473"
        }
      }
    },
    "reorder-pinned-message-request": {
      "type": "object",
      "description": "Request body for reordering a pinned message in the list.",
      "required": [
        "message_id",
        "last_sync_time"
      ],
      "properties": {
        "message_id": {
          "type": "string",
          "description": "ID of the pinned message to move."
        },
        "pin_above": {
          "type": "string",
          "description": "ID of the message above which to position. If omitted, the message is moved to the last position."
        },
        "last_sync_time": {
          "description": "Required for reorder operation. Accepts <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> datetime strings (e.g., <code>\"2026-04-19T19:09:44+05:30\"</code>) or epoch timestamps (e.g., <code>1745068184000</code>). The server rejects the request if this is stale.\n",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            }
          ]
        }
      },
      "example": {
        "message_id": "1773894772896_12958180473",
        "pin_above": "1773895219462_47318365091",
        "last_sync_time": 1745068184000
      }
    },
    "delete-pinned-messages-request": {
      "type": "object",
      "description": "Request body for deleting specific pinned messages.",
      "required": [
        "message_ids"
      ],
      "properties": {
        "message_ids": {
          "type": "array",
          "description": "List of message IDs to unpin. These messages must currently be pinned in the chat. If this field is omitted or an empty array is provided, all pinned messages in the chat are removed.\n<br><b>Maximum 25 message IDs can be provided in a single request.</b>\n",
          "minItems": 1,
          "maxItems": 25,
          "items": {
            "type": "string"
          }
        }
      },
      "example": {
        "message_ids": [
          "17719462_4731836509",
          "17737286_1295818047",
          "17732346_9876543210"
        ]
      }
    },
    "error-response": {
      "type": "object",
      "description": "Error response returned by the Pin Messages API.",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable error description."
        },
        "code": {
          "type": "string",
          "description": "Machine-readable error code.",
          "enum": [
            "operation_not_allowed",
            "operation_failed",
            "client_not_synced",
            "pinned_message_limit_reached"
          ]
        }
      }
    }
  }
}