{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passtru/json-schema/passtru-verification-session-schema.json",
  "title": "VerificationSession",
  "x-generated": "2026-12-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passtru-openapi.yml#/components/schemas/VerificationSession",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "object",
    "app_id",
    "environment",
    "status",
    "terminal",
    "mode",
    "requested_checks",
    "foundation_placeholders",
    "receipt_summary",
    "expires_at",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "const": "verification_session"
    },
    "app_id": {
      "type": "string"
    },
    "environment": {
      "$ref": "#/$defs/PublicEnvironment"
    },
    "external_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/PublicSessionStatus"
    },
    "terminal": {
      "type": "boolean"
    },
    "mode": {
      "enum": [
        "hosted",
        "iframe",
        "inline"
      ]
    },
    "requested_checks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "foundation_placeholders": {
      "type": "object"
    },
    "document_release": {
      "anyOf": [
        {
          "$ref": "#/$defs/DocumentReleaseEligibility"
        },
        {
          "type": "null"
        }
      ]
    },
    "receipt_summary": {
      "$ref": "#/$defs/ReceiptSummary"
    },
    "handoff": {
      "anyOf": [
        {
          "$ref": "#/$defs/VerificationHandoff"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "canceled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_webhook_event_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "problem": {
      "anyOf": [
        {
          "$ref": "#/$defs/ProblemDetails"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "DocumentReleaseEligibility": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "document_id",
        "object",
        "eligible"
      ],
      "properties": {
        "document_id": {
          "type": "string"
        },
        "object": {
          "const": "document_release_eligibility"
        },
        "eligible": {
          "type": "boolean"
        },
        "trust_class": {
          "type": [
            "string",
            "null"
          ]
        },
        "mime_types": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_bytes": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "blocked_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "manual_fallback": {
          "type": "boolean"
        }
      }
    },
    "ProblemDetails": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "status",
        "detail",
        "code",
        "retryable",
        "docs_url",
        "errors"
      ],
      "properties": {
        "type": {
          "type": "string",
          "default": "https://docs.passtru.io/errors/problem"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "minimum": 400,
          "maximum": 599
        },
        "detail": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "instance": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "docs_url": {
          "type": "string",
          "format": "uri"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "PublicEnvironment": {
      "enum": [
        "sandbox",
        "live"
      ]
    },
    "PublicSessionStatus": {
      "enum": [
        "created",
        "requires_action",
        "processing",
        "waiting_for_webhook",
        "completed",
        "failed",
        "canceled",
        "expired"
      ]
    },
    "ReceiptSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "enum": [
            "unsupported",
            "pending",
            "verified",
            "failed"
          ]
        },
        "mode": {
          "type": [
            "string",
            "null"
          ]
        },
        "unsupported_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "problem": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProblemDetails"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "VerificationHandoff": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "token_type": {
          "enum": [
            "sdk",
            "hosted",
            "iframe"
          ]
        },
        "token": {
          "type": [
            "string",
            "null"
          ],
          "description": "Inline SDK token. Present only for inline mode."
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}