{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/keep-md/json-schema/keep-md-item-schema.json",
  "title": "Item",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/keep-md-openapi.json#/components/schemas/Item",
  "type": "object",
  "required": [
    "id",
    "url",
    "status",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "favicon": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "createdAt": {
      "type": "integer"
    },
    "lastSeenAt": {
      "type": "integer"
    },
    "updatedAt": {
      "type": "integer"
    },
    "timesAdded": {
      "type": "integer"
    },
    "notes": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tagSlugs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "collectionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "collectionIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "collectionName": {
      "type": "string"
    },
    "collectionSlug": {
      "type": "string"
    },
    "summaryMarkdown": {
      "type": "string"
    },
    "contentAvailable": {
      "type": "boolean"
    },
    "contentMarkdown": {
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/ItemContent"
    },
    "highlights": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Highlight"
      }
    },
    "connectedNotes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "processedAt": {
      "type": "integer"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "Highlight": {
      "type": "object",
      "required": [
        "id",
        "itemId",
        "text",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "itemId": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "prefix": {
          "type": "string"
        },
        "suffix": {
          "type": "string"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "startOffset": {
          "type": "integer"
        },
        "endOffset": {
          "type": "integer"
        },
        "createdAt": {
          "type": "integer"
        },
        "updatedAt": {
          "type": "integer"
        }
      },
      "additionalProperties": true
    },
    "ItemContent": {
      "type": "object",
      "required": [
        "schemaVersion",
        "items"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "enum": [
            2
          ]
        },
        "meta": {
          "type": "object",
          "additionalProperties": true
        },
        "items": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ItemContentPart"
          }
        },
        "media": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "$ref": "#/$defs/MediaRef"
          }
        }
      }
    },
    "ItemContentPart": {
      "type": "object",
      "required": [
        "format",
        "markdown"
      ],
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "markdown"
          ]
        },
        "markdown": {
          "type": "string"
        },
        "meta": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "MediaRef": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "role",
        "url",
        "order"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "image"
          ]
        },
        "role": {
          "type": "string",
          "enum": [
            "lead",
            "inline",
            "gallery",
            "thumbnail",
            "attachment"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "order": {
          "type": "integer",
          "minimum": 0
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "alt": {
          "type": "string"
        },
        "width": {
          "type": "integer",
          "minimum": 1
        },
        "height": {
          "type": "integer",
          "minimum": 1
        },
        "mimeType": {
          "type": "string"
        },
        "byteSize": {
          "type": "integer",
          "minimum": 1
        },
        "contentHash": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}