{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arkova-ai/json-schema/arkova-ai-webhook-endpoint-with-secret-schema.json",
  "title": "WebhookEndpointWithSecret",
  "description": "Webhook endpoint with the HMAC signing secret. Returned ONLY by POST /webhooks at creation time. The secret cannot be retrieved later.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arkova-ai-webhooks-api-openapi.yml#/components/schemas/WebhookEndpointWithSecret",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/WebhookEndpoint"
    },
    {
      "type": "object",
      "properties": {
        "secret": {
          "type": "string",
          "description": "64-char hex HMAC-SHA256 signing secret. Save it now — it is shown once."
        },
        "warning": {
          "type": "string"
        }
      }
    }
  ],
  "$defs": {
    "WebhookEndpoint": {
      "type": "object",
      "description": "Webhook endpoint metadata. Signing secret is never returned on read.",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "anchor.submitted",
              "anchor.secured",
              "anchor.revoked",
              "anchor.expired",
              "anchor.superseded",
              "anchor.batch_secured",
              "credential.issued",
              "credential.verified",
              "credential.status_changed",
              "compliance.document_expiring",
              "job.completed",
              "compliance.certificate_expiring",
              "compliance.anchor_delayed",
              "compliance.signature_revoked",
              "compliance.timestamp_coverage_low",
              "attestation.created",
              "attestation.revoked",
              "folder.created",
              "folder.updated",
              "folder.deleted",
              "record.folder_changed",
              "anchor.revocation_anchored",
              "attestation.active",
              "suborg.created",
              "suborg.approved",
              "suborg.revoked",
              "suborg.credits_allocated",
              "suborg.credits_reclaimed",
              "suborg.suspended",
              "suborg.offboarded",
              "agent.registered",
              "agent.updated",
              "agent.revoked",
              "agent.key_created",
              "agent.log_anchored"
            ]
          }
        },
        "is_active": {
          "type": "boolean"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "self",
            "self_and_descendants"
          ],
          "description": "Delivery scope (SCRUM-3972). 'self' (default) delivers only this organization's own events. 'self_and_descendants' additionally delivers events owned by organizations whose parent is this organization and whose affiliation is APPROVED — one hop, never upward; such cross-organization payloads always carry org_public_id. Additive and nullable-safe per CLAUDE.md §1.8: omitting it preserves the pre-existing behaviour exactly. The cross-organization delivery it enables is behind a server-side gate that is currently OFF, so an endpoint set to 'self_and_descendants' today behaves exactly like 'self'."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}