{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zvid-io/json-schema/zvid-io-webhook-list-schema.json",
  "title": "WebhookList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zvid-io-webhooks-api-openapi.yml#/components/schemas/WebhookList",
  "type": "object",
  "properties": {
    "webhooks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Webhook"
      }
    },
    "usage": {
      "$ref": "#/$defs/WebhookUsage"
    }
  },
  "required": [
    "webhooks",
    "usage"
  ],
  "additionalProperties": true,
  "$defs": {
    "Webhook": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "events": {
          "type": "array",
          "items": {
            "enum": [
              "render.completed",
              "render.failed"
            ]
          }
        },
        "status": {
          "enum": [
            "active",
            "disabled"
          ]
        },
        "secret": {
          "type": "string",
          "description": "Returned by creation and single-webhook lookup; omitted from list/update responses."
        },
        "consecutiveFailures": {
          "type": "integer"
        },
        "lastSuccessAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastFailureAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastFailureReason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "url",
        "events",
        "status"
      ],
      "additionalProperties": true
    },
    "WebhookUsage": {
      "type": "object",
      "properties": {
        "used": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "planName": {
          "type": "string"
        }
      },
      "required": [
        "used",
        "limit",
        "planName"
      ],
      "additionalProperties": true
    }
  }
}