{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-patched-web-hooks-schema.json",
  "title": "PatchedWebHooks",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-webhooks-api-openapi.yml#/components/schemas/PatchedWebHooks",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "description": "Primary key for webhook"
    },
    "name": {
      "type": "string",
      "description": "Webhook name"
    },
    "organization": {
      "type": "string",
      "description": "A unique identifier for the organization."
    },
    "event_types": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EventTypesEnum"
      },
      "description": "Events that trigger this hook"
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/WebHooksTypeEnum"
        }
      ],
      "description": "The type of this web hook.\n\n* `slack` - Slack Notification\n* `generic` - Generic"
    },
    "configuration": {
      "description": "\nThe configuration necessary for this web hook.  The contents of this depend on the\ntype of web hook:\n\nGeneric Web Hooks:\n- url: (required) the URL to deliver the webhook to.\n- verify: if False, cert verification is disabled (defaults to True).\n- username: basic auth username, a password must also be provided (defaults to None).\n- password: basic auth password, a username must also be provided.   Stored encrypted (defaults to None).\n- token: Bearer token.  Stored encrypted (defaults to None).\n\nSlack Web Hooks:\n- token: (required) the token for connecting to Slack.\n- channel: (required) the Slack channel to deliver messages to.  Stored encrypted.\n- username: (required) the username to post under in Slack.\n"
    },
    "last_run": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "the last time this webhook was run."
    },
    "last_error": {
      "description": "\nThe last error that occurred when sending this webhook.   This includes\n- timestamp: the timestamp associated with the failure.\n- code: the error for this error, if any.\n- text: the error text for this error.\n"
    }
  },
  "$defs": {
    "EventTypesEnum": {
      "enum": [
        "parameter_created",
        "parameter_updated",
        "parameter_deleted",
        "template_created",
        "template_updated",
        "template_deleted",
        "project_created",
        "project_updated",
        "project_deleted",
        "environment_created",
        "environment_updated",
        "environment_deleted",
        "value_created",
        "value_updated",
        "value_deleted"
      ],
      "type": "string",
      "description": "* `parameter_created` - Parameter created\n* `parameter_updated` - Parameter updated\n* `parameter_deleted` - Parameter deleted\n* `template_created` - Template created\n* `template_updated` - Template updated\n* `template_deleted` - Template deleted\n* `project_created` - Project created\n* `project_updated` - Project updated\n* `project_deleted` - Project deleted\n* `environment_created` - Environment created\n* `environment_updated` - Environment updated\n* `environment_deleted` - Environment deleted\n* `value_created` - Value created\n* `value_updated` - Value updated\n* `value_deleted` - Value deleted"
    },
    "WebHooksTypeEnum": {
      "enum": [
        "slack",
        "generic"
      ],
      "type": "string",
      "description": "* `slack` - Slack Notification\n* `generic` - Generic"
    }
  }
}