{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-recaptcha/json-schema/google-recaptcha-google-cloud-recaptchaenterprise-v1-annotate-assessment-request-schema.json",
  "title": "GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest",
  "description": "The request message to annotate an Assessment.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-recaptcha-projects-api-openapi.yml#/components/schemas/GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest",
  "type": "object",
  "properties": {
    "phoneAuthenticationEvent": {
      "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1PhoneAuthenticationEvent",
      "description": "Optional. If using an external multi-factor authentication provider, provide phone authentication details for fraud detection purposes."
    },
    "hashedAccountId": {
      "description": "Optional. A stable hashed account identifier to apply to the assessment. This is an alternative to setting `hashed_account_id` in `CreateAssessment`, for example when a stable account identifier is not yet known in the initial request.",
      "type": "string",
      "format": "byte"
    },
    "accountId": {
      "description": "Optional. A stable account identifier to apply to the assessment. This is an alternative to setting `account_id` in `CreateAssessment`, for example when a stable account identifier is not yet known in the initial request.",
      "type": "string"
    },
    "transactionEvent": {
      "$ref": "#/$defs/GoogleCloudRecaptchaenterpriseV1TransactionEvent",
      "description": "Optional. If the assessment is part of a payment transaction, provide details on payment lifecycle events that occur in the transaction."
    },
    "reasons": {
      "description": "Optional. Reasons for the annotation that are assigned to the event.",
      "items": {
        "enum": [
          "REASON_UNSPECIFIED",
          "CHARGEBACK",
          "CHARGEBACK_FRAUD",
          "CHARGEBACK_DISPUTE",
          "REFUND",
          "REFUND_FRAUD",
          "TRANSACTION_ACCEPTED",
          "TRANSACTION_DECLINED",
          "PAYMENT_HEURISTICS",
          "INITIATED_TWO_FACTOR",
          "PASSED_TWO_FACTOR",
          "FAILED_TWO_FACTOR",
          "CORRECT_PASSWORD",
          "INCORRECT_PASSWORD",
          "SOCIAL_SPAM"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "annotation": {
      "enum": [
        "ANNOTATION_UNSPECIFIED",
        "LEGITIMATE",
        "FRAUDULENT",
        "PASSWORD_CORRECT",
        "PASSWORD_INCORRECT"
      ],
      "type": "string",
      "description": "Optional. The annotation that is assigned to the Event. This field can be left empty to provide reasons that apply to an event without concluding whether the event is legitimate or fraudulent."
    }
  },
  "$defs": {
    "GoogleCloudRecaptchaenterpriseV1PhoneAuthenticationEvent": {
      "description": "Details on a phone authentication event",
      "properties": {
        "eventTime": {
          "description": "Optional. The time at which the multi-factor authentication event (challenge or verification) occurred.",
          "format": "google-datetime",
          "type": "string"
        },
        "phoneNumber": {
          "type": "string",
          "description": "Required. Phone number in E.164 format for which a multi-factor authentication challenge was initiated, succeeded, or failed."
        }
      },
      "type": "object"
    },
    "GoogleCloudRecaptchaenterpriseV1TransactionEvent": {
      "type": "object",
      "description": "Describes an event in the lifecycle of a payment transaction.",
      "properties": {
        "value": {
          "description": "Optional. The value that corresponds with this transaction event, if one exists. For example, a refund event where $5.00 was refunded. Currency is obtained from the original transaction data.",
          "type": "number",
          "format": "double"
        },
        "reason": {
          "description": "Optional. The reason or standardized code that corresponds with this transaction event, if one exists. For example, a CHARGEBACK event with code 6005.",
          "type": "string"
        },
        "eventType": {
          "description": "Optional. The type of this transaction event.",
          "type": "string",
          "enum": [
            "TRANSACTION_EVENT_TYPE_UNSPECIFIED",
            "MERCHANT_APPROVE",
            "MERCHANT_DENY",
            "MANUAL_REVIEW",
            "AUTHORIZATION",
            "AUTHORIZATION_DECLINE",
            "PAYMENT_CAPTURE",
            "PAYMENT_CAPTURE_DECLINE",
            "CANCEL",
            "CHARGEBACK_INQUIRY",
            "CHARGEBACK_ALERT",
            "FRAUD_NOTIFICATION",
            "CHARGEBACK",
            "CHARGEBACK_REPRESENTMENT",
            "CHARGEBACK_REVERSE",
            "REFUND_REQUEST",
            "REFUND_DECLINE",
            "REFUND",
            "REFUND_REVERSE"
          ]
        },
        "eventTime": {
          "format": "google-datetime",
          "description": "Optional. Timestamp when this transaction event occurred; otherwise assumed to be the time of the API call.",
          "type": "string"
        }
      }
    }
  }
}