{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/keep-md/json-schema/keep-md-source-schema.json",
  "title": "Source",
  "description": "A compact content-source manifest. Config and tag rules are returned only with include=settings or include=sensitive. Cursor is returned only with include=sensitive.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/keep-md-openapi.json#/components/schemas/Source",
  "type": "object",
  "required": [
    "id",
    "type",
    "status",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "rss",
        "youtube_channel",
        "x_articles",
        "email_inbox",
        "web_monitor"
      ]
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "error"
      ]
    },
    "contentMode": {
      "type": "string",
      "enum": [
        "posts",
        "articles",
        "both"
      ]
    },
    "pollEveryMin": {
      "type": "integer"
    },
    "nextPollAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "lastRunAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "lastSuccessAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "lastError": {
      "type": [
        "string",
        "null"
      ]
    },
    "inboxAddress": {
      "type": [
        "string",
        "null"
      ]
    },
    "config": {
      "type": "object",
      "description": "Source configuration. Present with include=settings or include=sensitive. Secret fields and credential-like URL parameters are replaced with [redacted] unless include=sensitive was requested.",
      "additionalProperties": true
    },
    "cursor": {
      "type": "object",
      "description": "Internal source cursor. Present only when include=sensitive was requested.",
      "additionalProperties": true
    },
    "createdAt": {
      "type": "integer"
    },
    "updatedAt": {
      "type": "integer"
    }
  },
  "additionalProperties": true
}