{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/zoho-writer/main/json-schema/document.json",
  "title": "ZohoWriterDocument",
  "description": "A document object in the Zoho Writer API",
  "type": "object",
  "properties": {
    "document_id": {
      "type": "string",
      "description": "Unique identifier for the document"
    },
    "document_name": {
      "type": "string",
      "description": "Name of the document"
    },
    "document_type": {
      "type": "string",
      "description": "Type of document (e.g. fillable, merge, sign)"
    },
    "type": {
      "type": "string",
      "description": "Document subtype"
    },
    "role": {
      "type": "string",
      "description": "Role of the authenticated user with respect to this document"
    },
    "owner_id": {
      "type": "string",
      "description": "ID of the document owner"
    },
    "creator_id": {
      "type": "string",
      "description": "ID of the creator"
    },
    "created_by": {
      "type": "string",
      "description": "Display name of the creator"
    },
    "lastmodified_by": {
      "type": "array",
      "description": "List of users who last modified the document",
      "items": {
        "type": "object",
        "properties": {
          "email_id": { "type": "string", "format": "email" },
          "user_id": { "type": "string" },
          "display_name": { "type": "string" },
          "profile_photo": { "type": "string", "format": "uri" }
        }
      }
    },
    "created_time": {
      "type": "string",
      "description": "ISO 8601 timestamp of when the document was created"
    },
    "modified_time": {
      "type": "string",
      "description": "ISO 8601 timestamp of when the document was last modified"
    },
    "last_opened_time": {
      "type": "string",
      "description": "ISO 8601 timestamp of when the document was last opened"
    },
    "created_time_in_millisecond": {
      "type": "integer",
      "description": "Creation time as Unix epoch milliseconds"
    },
    "modified_time_in_millisecond": {
      "type": "integer",
      "description": "Modification time as Unix epoch milliseconds"
    },
    "is_published": {
      "type": "boolean",
      "description": "Whether the document is publicly published"
    },
    "is_shared": {
      "type": "boolean",
      "description": "Whether the document has been shared"
    },
    "is_favourite": {
      "type": "boolean",
      "description": "Whether the document is marked as a favourite"
    },
    "is_orgpublished": {
      "type": "boolean",
      "description": "Whether the document is published to the organization"
    },
    "open_url": {
      "type": "string",
      "format": "uri",
      "description": "URL to open the document in Zoho Writer"
    },
    "preview_url": {
      "type": "string",
      "format": "uri",
      "description": "URL to preview the document"
    },
    "download_url": {
      "type": "string",
      "format": "uri",
      "description": "URL to download the document"
    },
    "published_url": {
      "type": "string",
      "format": "uri",
      "description": "Public URL if the document is published"
    },
    "thumbnail_url": {
      "type": "string",
      "format": "uri",
      "description": "URL to the document thumbnail image"
    },
    "permalink": {
      "type": "string",
      "format": "uri",
      "description": "Permanent link to the document"
    },
    "permissions": {
      "type": "object",
      "description": "Access rights for the current user",
      "properties": {
        "can_edit": { "type": "boolean" },
        "can_share": { "type": "boolean" },
        "can_delete": { "type": "boolean" }
      }
    },
    "parent_info": {
      "type": "object",
      "description": "Folder information for the document",
      "properties": {
        "folder_id": { "type": "string" },
        "folder_name": { "type": "string" }
      }
    },
    "library_id": { "type": "string" },
    "collaboration_id": { "type": "string" },
    "version": { "type": "string" },
    "status": { "type": "string" }
  },
  "required": ["document_id", "document_name"]
}
