{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/exactlane-dev/json-schema/exactlane-dev-usage-event-create-schema.json",
  "title": "UsageEventCreate",
  "description": "Client-attested acknowledgement that a finished owned check report was consumed. POST after a finished check while the same credential still owns the run. Exactlane validates and records decision and report_consumed; it does not derive them.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/exactlane-dev-api-openapi.json#/components/schemas/UsageEventCreate",
  "additionalProperties": false,
  "properties": {
    "autonomous": {
      "type": "boolean"
    },
    "check_run_id": {
      "description": "Owned finished check run id from POST /v0/checks or GET /v0/checks/{run_id}",
      "maxLength": 64,
      "minLength": 1,
      "type": "string"
    },
    "decision": {
      "description": "Client-attested operational decision supplied by the caller. Exactlane produces compatibility evidence; the caller owns the operational decision. Exactlane validates and records this value but does not derive it from the report, and there is no universal verdict-to-decision mapping.",
      "enum": [
        "CONTINUE",
        "UPDATE_INTEGRATION",
        "HOLD"
      ],
      "type": "string"
    },
    "integration_ref": {
      "description": "Opaque caller integration identifier (letters, digits, dot, underscore, colon, hyphen)",
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    },
    "is_demo": {
      "type": "boolean"
    },
    "is_health_check": {
      "type": "boolean"
    },
    "is_retry": {
      "type": "boolean"
    },
    "occurred_at": {
      "description": "RFC3339 timestamp. Must not be more than five minutes in the future or older than 45 days.",
      "format": "date-time",
      "type": "string"
    },
    "platform_triggered": {
      "type": "boolean"
    },
    "report_consumed": {
      "description": "Required caller attestation that the finished report was consumed. Exactlane does not infer this from the check.",
      "type": "boolean"
    },
    "trigger": {
      "description": "Client-attested real-work category. Public values: NEW_WORK, DEPENDENCY_CHANGE, REQUIREMENTS_CHANGE, INTEGRATION_FAILURE, OTHER_REAL_WORK. Other strings return 422 INVALID_TRIGGER.",
      "enum": [
        "NEW_WORK",
        "DEPENDENCY_CHANGE",
        "REQUIREMENTS_CHANGE",
        "INTEGRATION_FAILURE",
        "OTHER_REAL_WORK"
      ],
      "type": "string"
    },
    "workflow_ref": {
      "description": "Opaque caller workflow identifier (letters, digits, dot, underscore, colon, hyphen). Unique with integration_ref per principal; a second distinct body returns 409 DUPLICATE_WORKFLOW_EVENT.",
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "check_run_id",
    "integration_ref",
    "workflow_ref",
    "trigger",
    "decision",
    "report_consumed",
    "autonomous",
    "is_demo",
    "is_retry",
    "is_health_check",
    "platform_triggered",
    "occurred_at"
  ],
  "type": "object"
}