{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/keep-md/json-schema/keep-md-source-create-request-schema.json",
  "title": "SourceCreateRequest",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/keep-md-openapi.json#/components/schemas/SourceCreateRequest",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "rss",
        "youtube_channel",
        "x_articles",
        "email_inbox",
        "web_monitor"
      ]
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Required for web_monitor. Public webpage or sitemap URL."
    },
    "kind": {
      "type": "string",
      "enum": [
        "page",
        "sitemap"
      ],
      "description": "Required for web_monitor. Checks daily; first capture silently establishes a baseline. Maximum 10 monitors per account."
    },
    "name": {
      "type": "string"
    },
    "pollEveryMin": {
      "type": "integer",
      "minimum": 1
    },
    "feedUrl": {
      "type": "string",
      "format": "uri"
    },
    "channel": {
      "type": "string"
    },
    "channelId": {
      "type": "string"
    },
    "handle": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "username": {
      "type": "string"
    },
    "contentMode": {
      "type": "string",
      "enum": [
        "posts",
        "articles",
        "both"
      ]
    },
    "backfillMode": {
      "type": "string",
      "enum": [
        "from_now",
        "days",
        "articles"
      ]
    },
    "backfillDays": {
      "type": "integer",
      "minimum": 0
    },
    "backfillItems": {
      "type": "integer",
      "minimum": 1
    },
    "initialImportCount": {
      "type": "integer",
      "minimum": 1
    },
    "rollupEnabled": {
      "type": "boolean"
    },
    "expandFullContent": {
      "type": "boolean"
    },
    "autoSummarize": {
      "type": "boolean"
    },
    "defaultTags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "smartTagRules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SmartTagRule"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "SmartTagRule": {
      "type": "object",
      "required": [
        "tag"
      ],
      "properties": {
        "tag": {
          "type": "string"
        },
        "include": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    }
  }
}