{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.wherever.audio/schemas/webhooks/library-refreshed/v1.json",
  "type": "object",
  "properties": {
    "origin": {
      "type": "string",
      "enum": [
        "user",
        "agent",
        "link",
        "system",
        "sync"
      ],
      "description": "Who caused the event."
    },
    "actionId": {
      "description": "Shared by every event one action produced.",
      "type": "string"
    },
    "test": {
      "description": "Present only on synthetic events from a test send.",
      "type": "boolean",
      "const": true
    },
    "trigger": {
      "type": "string",
      "examples": [
        "refreshAll",
        "restore",
        "listKept",
        "import"
      ],
      "description": "Known values: `refreshAll`, `restore`, `listKept`, `import`. Receivers must accept others."
    },
    "feeds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "succeeded": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "failed": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "newEpisodes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "durationMs": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "failedShows": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "$ref": "https://docs.wherever.audio/schemas/webhooks/references/show/v1.json"
      }
    },
    "cancelled": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "origin",
    "trigger",
    "feeds",
    "succeeded",
    "failed",
    "newEpisodes",
    "durationMs",
    "failedShows"
  ],
  "title": "library.refreshed data",
  "description": "A bulk refresh finished.",
  "x-stability": "stable"
}
