{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cleve-ai/json-schema/cleve-ai-note-schema.json",
  "title": "Note",
  "description": "A note with its full plain-text content.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cleve-ai-openapi.yml#/components/schemas/Note",
  "allOf": [
    {
      "$ref": "#/$defs/NoteSummary"
    },
    {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Full plain-text body."
        },
        "permission": {
          "type": "string",
          "enum": [
            "owner",
            "editor",
            "viewer"
          ],
          "description": "What the caller may do with the note."
        },
        "canManageSharing": {
          "type": "boolean"
        }
      }
    }
  ],
  "$defs": {
    "NoteKind": {
      "type": "string",
      "enum": [
        "note",
        "memory",
        "welcome",
        "imported"
      ],
      "description": "`memory` notes hold what Cleve remembers about you; `imported` notes came from an import."
    },
    "NoteSummary": {
      "type": "object",
      "required": [
        "_id",
        "_creationTime",
        "content",
        "isPinned",
        "updatedAt"
      ],
      "properties": {
        "_id": {
          "type": "string",
          "description": "Note ID."
        },
        "_creationTime": {
          "type": "number",
          "description": "Creation time, milliseconds since the Unix epoch."
        },
        "userId": {
          "type": "string",
          "description": "ID of the note's owner."
        },
        "title": {
          "type": "string"
        },
        "content": {
          "type": "string",
          "description": "Plain-text preview of the body."
        },
        "kind": {
          "$ref": "#/$defs/NoteKind"
        },
        "isPinned": {
          "type": "boolean"
        },
        "isPublic": {
          "type": "boolean",
          "description": "Whether link sharing is on."
        },
        "isPublished": {
          "type": "boolean",
          "description": "Whether the note is published to the web."
        },
        "publishedAt": {
          "type": "number",
          "description": "Publish time, milliseconds since the Unix epoch."
        },
        "folderId": {
          "type": "string",
          "description": "Folder the note is in, if any."
        },
        "updatedAt": {
          "type": "number",
          "description": "Last update, milliseconds since the Unix epoch."
        },
        "orgId": {
          "type": "string",
          "description": "Workspace ID."
        }
      }
    }
  }
}