{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-log-destinations-schema.json",
  "title": "LogDestinations",
  "description": "Per-org log destination CRUD.\n\nPer-type config (api_key, token, collector_url, etc.) is submitted\ninside ``configuration``. Sensitive keys are encrypted at rest via\n``LogDestination.SENSITIVE_CONFIG_KEYS`` and masked on read by\n``to_representation``.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-log-destinations-api-openapi.yml#/components/schemas/LogDestinations",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "description": "Primary key for log destination."
    },
    "name": {
      "type": "string",
      "description": "Customer-chosen name for this destination."
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/LogDestinationsTypeEnum"
        }
      ],
      "description": "The sink type (Datadog, etc.).\n\n* `datadog` - Datadog Logs\n* `splunk_hec` - Splunk HEC\n* `sumo_logic` - Sumo Logic HTTP Source\n* `generic_https` - Generic HTTPS Webhook"
    },
    "enabled": {
      "type": "boolean",
      "default": true
    },
    "configuration": {},
    "last_attempt_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "last_success_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "last_error": {
      "readOnly": true
    },
    "consecutive_failures": {
      "type": "integer",
      "readOnly": true
    },
    "total_records_delivered": {
      "type": "integer",
      "readOnly": true
    },
    "gap_skipped_count": {
      "type": "integer",
      "readOnly": true
    },
    "cursor_lag_seconds": {
      "type": "integer",
      "description": "Age (in seconds) of the oldest audit record waiting to be delivered. 0 means caught up — no pending records. Growing values indicate the drain is falling behind.",
      "readOnly": true
    }
  },
  "required": [
    "configuration",
    "consecutive_failures",
    "cursor_lag_seconds",
    "gap_skipped_count",
    "id",
    "last_attempt_at",
    "last_error",
    "last_success_at",
    "name",
    "total_records_delivered",
    "type",
    "url"
  ],
  "$defs": {
    "LogDestinationsTypeEnum": {
      "enum": [
        "datadog",
        "splunk_hec",
        "sumo_logic",
        "generic_https"
      ],
      "type": "string",
      "description": "* `datadog` - Datadog Logs\n* `splunk_hec` - Splunk HEC\n* `sumo_logic` - Sumo Logic HTTP Source\n* `generic_https` - Generic HTTPS Webhook"
    }
  }
}