{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/romm/json-schema/romm-notification-channel-schema-schema.json",
  "title": "NotificationChannelSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/romm-notification-channels-api-openapi.yml#/components/schemas/NotificationChannelSchema",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "type": {
      "$ref": "#/$defs/NotificationChannelType"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "enabled": {
      "type": "boolean",
      "title": "Enabled"
    },
    "min_level": {
      "$ref": "#/$defs/NotificationChannelMinLevel"
    },
    "topics": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/NotificationTopic"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topics"
    },
    "target": {
      "type": "string",
      "title": "Target"
    },
    "service": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Service"
    },
    "service_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Service Name"
    },
    "fields": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "items": {
                  "type": "string",
                  "maxLength": 2000
                },
                "type": "array",
                "maxItems": 20
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fields"
    },
    "stored_secrets": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stored Secrets"
    },
    "has_secret": {
      "type": "boolean",
      "title": "Has Secret"
    },
    "confirmed": {
      "type": "boolean",
      "title": "Confirmed"
    },
    "last_delivered_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Delivered At"
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Error"
    },
    "consecutive_failures": {
      "type": "integer",
      "title": "Consecutive Failures"
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "type",
    "name",
    "enabled",
    "min_level",
    "topics",
    "target",
    "service",
    "service_name",
    "fields",
    "stored_secrets",
    "has_secret",
    "confirmed",
    "last_delivered_at",
    "last_error",
    "consecutive_failures",
    "created_at"
  ],
  "$defs": {
    "NotificationChannelMinLevel": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "error"
      ],
      "title": "NotificationChannelMinLevel",
      "description": "The least severe notification a channel forwards; success ranks as info."
    },
    "NotificationChannelType": {
      "type": "string",
      "enum": [
        "apprise",
        "webhook",
        "email"
      ],
      "title": "NotificationChannelType"
    },
    "NotificationTopic": {
      "type": "string",
      "enum": [
        "scans",
        "tasks",
        "streaming",
        "devices",
        "account",
        "custom"
      ],
      "title": "NotificationTopic",
      "description": "The groups a notification channel picks what it forwards by."
    }
  }
}