{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/withverifa-com/json-schema/withverifa-com-create-session-request-schema.json",
  "title": "CreateSessionRequest",
  "description": "Create a new verification session.\n\nEvery top-level parameter and every key inside `fields` also accepts a\nkebab-case alias (`inquiry-template-id` for `workflow_id`,\n`reference-id` for `external_ref`, etc. — see the per-field\ndescriptions). The endpoint additionally accepts a JSON:API-style\nenvelope `{\"data\": {\"type\": \"...\", \"attributes\": {...}}}`; the inner\n`attributes` object is treated as the request body.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/withverifa-com-openapi.yml#/components/schemas/CreateSessionRequest",
  "type": "object",
  "properties": {
    "external_ref": {
      "type": "string",
      "maxLength": 255,
      "description": "Your internal reference for this user or transaction."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "description": "Any type"
      },
      "description": "Arbitrary key-value metadata attached to the session. Up to 50\nkeys; each individual value is capped at **16 KB** of UTF-8 when\nserialized. Requests exceeding either bound return `422`.\n"
    },
    "country": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2,
      "description": "ISO 3166-1 alpha-2 country code for document expectations."
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 64
      },
      "description": "Per-session check overrides. If omitted, the workflow's default\nchecks are used.\n"
    },
    "workflow_id": {
      "type": "string",
      "maxLength": 64,
      "description": "Workflow to use for this session."
    },
    "redirect_url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "URL to redirect the user to after capture is complete."
    },
    "send_email": {
      "type": "boolean",
      "default": false,
      "description": "Send an email invitation to the applicant with a link to complete\nverification. Requires `applicant_email` to be set (either at the\ntop level or under `metadata.applicant_email`).\n"
    },
    "applicant_email": {
      "type": "string",
      "format": "email",
      "description": "Email address to send the verification invitation to. Only used\nwhen `send_email` is `true`. Falls back to `metadata.applicant_email`\nif not provided at the top level.\n"
    },
    "applicant_name": {
      "type": "string",
      "maxLength": 100,
      "description": "Display name for the applicant. Used to personalize the opener\nof the invitation email (\"Jane Doe, please click...\"). Only used\nwhen `send_email` is `true`.\n"
    },
    "display_name": {
      "type": "string",
      "maxLength": 100,
      "description": "Override the brand name shown in the invitation email's subject\nline and body for this session only. Defaults to your organization's\nconfigured email display name, or your organization name. Useful\nwhen sending under a sub-brand. Only used when `send_email` is `true`.\n"
    },
    "support_url": {
      "type": "string",
      "format": "uri",
      "maxLength": 500,
      "description": "Override the support link shown in the invitation email's recovery\nsentence (\"contact support to have a new link sent\") for this\nsession only. Defaults to your organization's configured\nverification support URL. Must be an `http` or `https` URL.\nOnly used when `send_email` is `true`.\n"
    },
    "expires_in": {
      "type": "integer",
      "minimum": 10,
      "maximum": 4320,
      "description": "Session expiration in minutes. Determines how long the capture URL\nremains valid. Minimum 10 minutes, maximum 4320 (72 hours).\nDefaults to 1440 (24 hours) if not specified.\n"
    },
    "fields": {
      "$ref": "#/$defs/PrefillFields"
    }
  },
  "$defs": {
    "PrefillFields": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string",
          "maxLength": 100,
          "description": "First name (alias `name-first`)."
        },
        "last_name": {
          "type": "string",
          "maxLength": 100,
          "description": "Last name (alias `name-last`)."
        },
        "date_of_birth": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "ISO 8601 date `YYYY-MM-DD` (alias `birthdate`)."
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 500,
          "description": "Applicant email (alias `email-address`)."
        },
        "phone": {
          "type": "string",
          "maxLength": 100,
          "description": "E.164 phone number recommended (alias `phone-number`)."
        },
        "ssn": {
          "type": "string",
          "maxLength": 11,
          "description": "9-digit US SSN (alias `social-security-number`). Dashes and spaces\nare accepted and preserved as-provided.\n"
        },
        "address_line1": {
          "type": "string",
          "maxLength": 500,
          "description": "Street address line 1 (alias `address-street-1`)."
        },
        "address_line2": {
          "type": "string",
          "maxLength": 500,
          "description": "Street address line 2 (alias `address-street-2`)."
        },
        "address_city": {
          "type": "string",
          "maxLength": 100,
          "description": "City (alias `address-city`)."
        },
        "address_state": {
          "type": "string",
          "maxLength": 100,
          "description": "State / subdivision (alias `address-subdivision`)."
        },
        "address_zip": {
          "type": "string",
          "maxLength": 100,
          "description": "Postal code (alias `address-postal-code`)."
        },
        "address_country": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2,
          "description": "ISO 3166-1 alpha-2 country code (alias `address-country-code`)."
        }
      },
      "description": "Optional pre-fill values written into session capture data on create.\nValues are stored encrypted at rest. Pre-filling does not auto-complete\ncapture steps — the user still walks through the capture flow. Each\nfield accepts both the canonical snake_case name and the kebab-case\nalias shown in parentheses.\n",
      "title": "PrefillFields"
    }
  }
}