{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/percia-ai/json-schema/percia-ai-hook-created-schema.json",
  "title": "HookCreated",
  "description": "The new hook plus its signing secret, shown only here.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/percia-ai-openapi.yml#/components/schemas/HookCreated",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": [
        "string",
        "null"
      ]
    },
    "watchId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Null = every watch you own."
    },
    "events": {
      "type": "array",
      "items": {
        "enum": [
          "goal.met",
          "*"
        ]
      }
    },
    "status": {
      "enum": [
        "active",
        "disabled"
      ],
      "description": "disabled = Percia stopped sending (the receiver answered 410, or deliveries kept failing). Create the hook again."
    },
    "lastError": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stable code: why it was disabled, or why the last delivery failed."
    },
    "lastDeliveredAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "secret": {
      "type": "string",
      "description": "`whsec_...`. Verify deliveries with it (webhooks guide). Shown once."
    }
  },
  "required": [
    "id",
    "events",
    "status",
    "createdAt",
    "secret"
  ]
}