{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fourthline/json-schema/fourthline-workflows-v2-webhook-event-schema.json",
  "title": "WorkflowsV2WebhookEvent",
  "description": "One Identity Verification API v2 webhook notification. Each POST body is this object. Properties with a null value are omitted.",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fourthline-webhooks-api-openapi.yml#/components/schemas/WorkflowsV2WebhookEvent",
  "type": "object",
  "required": [
    "workflowId",
    "workflow",
    "details"
  ],
  "properties": {
    "workflowId": {
      "type": "string",
      "format": "uuid",
      "description": "The unique identifier of the workflow. <br /><br />Format: uuid <br /><br />Example: `f97f23d2-d0ca-4d15-9de4-d2e19c89b9aa`"
    },
    "workflow": {
      "type": "string",
      "description": "The Hub workflow configuration name for the products in this flow. <br /><br />Example: `BiometricsOnly`, `PaymentsOnly`, `IdvWorkflow`"
    },
    "flowVariant": {
      "$ref": "#/$defs/flowVariant"
    },
    "details": {
      "$ref": "#/$defs/WorkflowNotificationDetails"
    }
  },
  "$defs": {
    "BAVDetails": {
      "type": "object",
      "description": "Bank Account Verification (BAV) notification. API product key `Payments`. Sent for BAV payment products.",
      "required": [
        "name",
        "status",
        "timestamp"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Product domain name. Always `Payments` for BAV notifications (Bank Account Verification).",
          "enum": [
            "Payments"
          ]
        },
        "status": {
          "type": "string",
          "description": "The current [BAV product status](https://docs.fourthline.com/v2.0/docs/product-statuses).",
          "enum": [
            "new",
            "pending",
            "pending_verification",
            "kyc_required",
            "timed_out",
            "completed",
            "failed"
          ]
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when this notification was created or last updated."
        },
        "messages": {
          "type": [
            "array",
            "null"
          ],
          "description": "Status messages for the payment product. Omitted or empty when there are no messages.",
          "items": {
            "$ref": "#/$defs/ValidationMessage"
          }
        },
        "transferData": {
          "type": [
            "object",
            "null"
          ],
          "description": "Payment transfer details. Present when the payment completed successfully.",
          "properties": {
            "iban": {
              "type": [
                "string",
                "null"
              ],
              "description": "IBAN for manual transfers."
            },
            "name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Recipient name."
            },
            "transferReference": {
              "type": [
                "string",
                "null"
              ],
              "description": "Reference number for the transfer."
            },
            "currency": {
              "type": [
                "string",
                "null"
              ],
              "description": "Currency code. <br /><br />Example: `EUR`"
            },
            "amountRequested": {
              "type": [
                "string",
                "null"
              ],
              "description": "Amount formatted as a string with two decimal places. <br /><br />Example: `0.10`"
            }
          }
        }
      }
    },
    "IdentityVerificationDetails": {
      "type": "object",
      "description": "Identity Verification notification (`details.name` is `IdentityVerification`). Sent for Identity Verification products (Documents, Biometrics, Location, AML).",
      "required": [
        "name",
        "status",
        "timestamp"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Product domain name. Always `IdentityVerification` for this notification type.",
          "enum": [
            "IdentityVerification"
          ]
        },
        "status": {
          "type": "string",
          "description": "The workflow verification status sent on the Identity Verification notification. Product status values are listed in [Identity Verification product statuses](https://docs.fourthline.com/v2.0/docs/product-statuses#identity-verification-statuses). <br /><br />`timed_out` means the workflow was not started within three days after it was created or was started but not completed within seven days after it was started.",
          "enum": [
            "new",
            "pending",
            "timed_out",
            "invalid_data",
            "inconsistent_data",
            "success",
            "rejected",
            "fraud",
            "completed",
            "error",
            "retry_limit_reached",
            "user_consent_required",
            "signed"
          ]
        },
        "hash": {
          "type": "string",
          "description": "The MD5 hash of the [ZIP report](https://docs.fourthline.com/v2.0/docs/workflow-reports#zip-archive-contents), as a lowercase hexadecimal string. Present after the report is generated. Absent otherwise. <br /><br />Format: MD5, lowercase hex <br /><br />Example: `ee5b60aed741bc1f5349a654a5757290`"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when this notification was created or last updated."
        },
        "messages": {
          "type": "array",
          "description": "Status and validation messages for the product.",
          "items": {
            "$ref": "#/$defs/ValidationMessage"
          }
        },
        "sla": {
          "$ref": "#/$defs/SlaDetails"
        }
      }
    },
    "QESDetails": {
      "type": "object",
      "description": "Qualified Electronic Signature (QES) notification. API product key `Signatures`.",
      "required": [
        "name",
        "status",
        "timestamp"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Product domain name. Always `Signatures` for QES notifications.",
          "enum": [
            "Signatures"
          ]
        },
        "status": {
          "type": "string",
          "description": "The current [QES product status](https://docs.fourthline.com/v2.0/docs/product-statuses#qualified-electronic-signature-statuses).",
          "enum": [
            "new",
            "pending",
            "user_consent_required",
            "selfie_required",
            "kyc_required",
            "confirmation_required",
            "signed",
            "pending_verification",
            "invalid_signature",
            "error",
            "timed_out",
            "completed",
            "failed"
          ]
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when this notification was created or last updated."
        },
        "messages": {
          "type": "array",
          "description": "Status messages for the signature product.",
          "items": {
            "$ref": "#/$defs/ValidationMessage"
          }
        },
        "errorAttempts": {
          "type": "array",
          "description": "Each error attempt for this signature. Each entry has `attemptId` and `timestamp`. Read the status code from [Get workflow status](ref:get-workflow-status) in `products[].messages[]`, and match `attemptId`. `details.messages[]` includes `statusCode` and does not include `attemptId`.",
          "items": {
            "$ref": "#/$defs/SignatureErrorAttempt"
          }
        }
      }
    },
    "SignatureErrorAttempt": {
      "type": "object",
      "description": "One error attempt during Qualified Electronic Signature. Contains `attemptId` and `timestamp`.",
      "required": [
        "attemptId",
        "timestamp"
      ],
      "properties": {
        "attemptId": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the error attempt. <br /><br />Format: uuid"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "When the error attempt occurred. <br /><br />Format: ISO 8601 UTC date and time"
        }
      }
    },
    "SlaDetails": {
      "type": "object",
      "description": "SLA timing for Identity Verification notifications. Included on Identity Verification `details` when processing has finished, including `inconsistent_data`. Omitted while the workflow is still in progress, for example `pending`. Properties with a null value are omitted.",
      "properties": {
        "kycReceived": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the workflow started (KYC data received)."
        },
        "slaStart": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when received data was validated successfully and automatic validations started."
        },
        "slaEnd": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the workflow ended."
        },
        "slaPause": {
          "type": "string",
          "format": "date-time",
          "description": "Legacy timestamp for a paused SLA period. Omitted when processing was not paused."
        },
        "slaSeconds": {
          "type": "integer",
          "description": "Number of seconds that correspond to the SLA bucket for the case."
        },
        "withinSla": {
          "type": "boolean",
          "description": "Whether the case was processed within SLA limits."
        },
        "slaBucket": {
          "type": "string",
          "description": "Name of the SLA bucket that applies to the case. <br /><br />Example: `bucket1`",
          "enum": [
            "bucket1",
            "bucket2",
            "bucket3"
          ]
        }
      }
    },
    "ValidationMessage": {
      "type": "object",
      "description": "A status or validation message included in `details.messages`.",
      "properties": {
        "description": {
          "type": "string",
          "description": "Human-readable description of the validation result or issue."
        },
        "statusCode": {
          "type": "integer",
          "description": "Numeric status code for the message. <br /><br />Example: `200`"
        },
        "areaOfAttention": {
          "type": "string",
          "description": "Which data area requires attention. Omitted when it has no value."
        }
      }
    },
    "WorkflowNotificationDetails": {
      "description": "Product-specific notification payload. The shape depends on `details.name`.",
      "oneOf": [
        {
          "$ref": "#/$defs/IdentityVerificationDetails"
        },
        {
          "$ref": "#/$defs/BAVDetails"
        },
        {
          "$ref": "#/$defs/QESDetails"
        }
      ]
    },
    "flowVariant": {
      "type": "string",
      "description": "Returned on the event, next to `workflowId`, when the workflow offers both eID and verification with a physical ID document. When the workflow does not offer both, the property is absent. Confirm the value with Get workflow status. <br /><br />Enum: <br />• `eIDVerification`: the client completed eID <br />• `DocumentVerification`: the client completed verification with a physical ID document",
      "enum": [
        "eIDVerification",
        "DocumentVerification"
      ]
    }
  }
}