{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rial-io/json-schema/rial-io-create-verification-request-schema.json",
  "title": "CreateVerificationRequest",
  "description": "Body for `POST /v1/verifications`. All fields optional — sensible defaults: `max_captures: 1`, `expires_in_seconds: 3600`. Every photo gets the screen and AI checks; an audit adds found-online; describing the photo (`expected_object`, `context`) turns the context check on. Capture quantity comes as EITHER `max_captures` (N anonymous captures) OR `steps` (guided slots with key/description/min/max) — never both. `context` is what the analysis pipeline cross-references against the capture; `metadata` is opaque pass-through echoed back on every webhook event.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rial-io-openapi.json#/components/schemas/CreateVerificationRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "max_captures": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "description": "How many anonymous photos to ask for. Use this or `steps`, never both. Default 1."
    },
    "steps": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "image"
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "min": {
                "type": "integer",
                "minimum": 0,
                "default": 1,
                "description": "Minimum photos. 0 makes the step optional. Default 1."
              },
              "max": {
                "type": "integer",
                "minimum": 1,
                "default": 1,
                "description": "Maximum photos. Default 1."
              },
              "allow_upload": {
                "type": "boolean",
                "description": "Also allow picking a file from the gallery instead of the camera."
              },
              "accept": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "image/jpeg",
                    "image/png",
                    "image/webp",
                    "image/heic",
                    "image/heif"
                  ]
                },
                "minItems": 1,
                "description": "Accepted media types."
              },
              "max_size_bytes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 26214400,
                "description": "Maximum size per photo, in bytes."
              },
              "expected_object": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "What must appear in this photo. Overrides the verification-level value."
              },
              "condition_aspects": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "minItems": 1,
                "maxItems": 6,
                "description": "Aspects to score on this photo. Overrides the verification-level value."
              }
            },
            "required": [
              "key",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "required": {
                "type": "boolean",
                "default": true,
                "description": "Default true."
              },
              "validation": {
                "type": "object",
                "properties": {
                  "min_length": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2000
                  },
                  "max_length": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "free_text",
                      "numeric_id",
                      "alphanumeric_id",
                      "email"
                    ],
                    "default": "free_text"
                  }
                },
                "default": {
                  "format": "free_text"
                },
                "additionalProperties": false,
                "description": "Length and format rules: `free_text`, `numeric_id`, `alphanumeric_id` or `email`."
              },
              "variant": {
                "type": "string",
                "enum": [
                  "short",
                  "long"
                ],
                "description": "`short` (one line) or `long`."
              }
            },
            "required": [
              "key",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "upload"
                ]
              },
              "input": {
                "type": "string",
                "enum": [
                  "signature"
                ],
                "description": "`signature` shows a signature pad instead of a file picker."
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "min": {
                "type": "integer",
                "minimum": 0,
                "default": 1,
                "description": "Minimum files. 0 makes the step optional. Default 1."
              },
              "max": {
                "type": "integer",
                "minimum": 1,
                "default": 1,
                "description": "Maximum files. Default 1."
              },
              "accept": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "image/jpeg",
                    "image/png",
                    "image/webp",
                    "image/heic",
                    "image/heif"
                  ]
                },
                "minItems": 1,
                "default": [
                  "image/jpeg",
                  "image/png",
                  "image/webp",
                  "image/heic",
                  "image/heif"
                ],
                "description": "Accepted media types."
              },
              "max_size_bytes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 26214400,
                "default": 10485760,
                "description": "Maximum size per file, in bytes."
              }
            },
            "required": [
              "key",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "video"
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "min": {
                "type": "integer",
                "minimum": 0,
                "default": 1,
                "description": "Minimum clips. 0 makes the step optional. Default 1."
              },
              "max": {
                "type": "integer",
                "minimum": 1,
                "default": 1,
                "description": "Maximum clips. Default 1."
              },
              "expected_object": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "What the clip must show. Every sampled frame is checked against it and the clip reads as object match / no match by persistence."
              },
              "expected_scene": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "What the clip as a whole must show, in order (\"a walk around the car with the hood open, ending on the engine bay\"). Judged once per clip over a contact sheet of its frames; the clip reads as scene match / no match with the reason. Absent: no scene check."
              },
              "audio": {
                "type": "boolean",
                "default": false,
                "description": "Record the microphone with the clip. The person is asked for microphone access on this step; a refusal still records the video, without sound. Default false."
              },
              "condition_aspects": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "minItems": 1,
                "maxItems": 6,
                "description": "Aspects to score on the clip. Judged once per clip over a contact sheet of its frames, like `expected_scene`; scored 0..10 with a reason each. Overrides the verification-level value."
              },
              "max_duration_sec": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60,
                "default": 60,
                "description": "Maximum length of each clip, in seconds."
              }
            },
            "required": [
              "key",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "choice"
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "required": {
                "type": "boolean",
                "default": true,
                "description": "Default true."
              },
              "multiple": {
                "type": "boolean",
                "default": false,
                "description": "Allow picking more than one option."
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9][a-z0-9_-]*$"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "key",
                    "label"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 50,
                "description": "Options to pick from, each with `key` and `label`."
              }
            },
            "required": [
              "key",
              "type",
              "options"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Visible title of the step."
              },
              "screen": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 8000
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false,
                "description": "Groups consecutive steps on one screen: `key` and `title` shared by the group."
              },
              "when": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9][a-z0-9_-]*$"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false,
                "description": "Show this step only when the step `key` was answered with `value`."
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                "description": "Stable id of the step. Its answer or photos come back under this key."
              },
              "type": {
                "type": "string",
                "enum": [
                  "address"
                ]
              },
              "country": {
                "type": "string",
                "enum": [
                  "BR"
                ],
                "description": "`BR` shows Brazilian address fields."
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "default": "",
                "description": "Instruction shown to the person."
              },
              "required": {
                "type": "boolean",
                "default": true,
                "description": "Default true."
              }
            },
            "required": [
              "key",
              "type"
            ],
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "description": "Guided steps in order: photos, text questions, uploads, choices, addresses. Use this or `max_captures`."
    },
    "expires_in_seconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 86400,
      "default": 3600,
      "description": "How long the capture link stays open, in seconds. Default 3600 (one hour), max 86400."
    },
    "seal": {
      "type": "boolean",
      "default": true,
      "description": "Stamp the delivered photos with a C2PA seal. Default true."
    },
    "mode": {
      "type": "string",
      "enum": [
        "verification",
        "audit"
      ],
      "description": "`verification` (photo taken live, default) or `audit` (a file that already exists, uploaded through the API)."
    },
    "context": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          }
        }
      },
      "required": [
        "kind",
        "summary"
      ],
      "description": "What the photo is supposed to show, for the `context` check: `kind` names the thing, `summary` describes it in one line."
    },
    "webhook_url": {
      "type": "string",
      "format": "uri",
      "description": "HTTPS URL that receives `verification.created` and `verification.completed`."
    },
    "notify_email": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 254,
      "format": "email",
      "description": "Email that receives the result. `null` opts this verification out; absent uses your account default."
    },
    "report_language": {
      "type": "string",
      "enum": [
        "es",
        "en"
      ]
    },
    "notify_subject_template": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "description": "Subject of the result email. `{variable}` placeholders allowed."
    },
    "notify_body_template": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "description": "Body of the result email. `{variable}` placeholders allowed."
    },
    "completion_message": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 2000,
      "description": "Full plain-text message shown after submitting content. HTML, markdown and variables are not interpreted. Omit on create or send null on PATCH to use the default."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "description": "Your own key/value strings, returned with every result and webhook. Example: `{ \"claim_id\": \"CLM-9912\" }`."
    },
    "requires_location": {
      "type": "boolean",
      "description": "Require a GPS fix on the first photo without comparing it to an address."
    },
    "security_level": {
      "type": "string",
      "enum": [
        "none",
        "low",
        "medium",
        "high"
      ],
      "description": "How much the phone asks of the person at each shot, from `low` to `high`; `none` runs no capture checks. Absent: `none`."
    },
    "expected_location": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300,
      "description": "Street address the photo must be taken at. Turns on `location_match`."
    },
    "expected_object": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "What must appear in the photo, e.g. `\"car\"`. Turns on `object_match`."
    },
    "condition_aspects": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
      },
      "minItems": 1,
      "maxItems": 6,
      "description": "One to six aspects to score from 0 to 10, e.g. `[\"paint\", \"tires\"]`. Turns on `condition`."
    },
    "expected_info": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "individual",
            "csv"
          ],
          "default": "individual"
        },
        "shared": {
          "type": "object",
          "properties": {
            "expected_location": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "expected_object": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "condition_aspects": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "minItems": 1,
              "maxItems": 6
            },
            "ocr_type": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          "additionalProperties": false
        },
        "subject": {
          "type": "object",
          "properties": {
            "expected_location": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            },
            "expected_object": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "condition_aspects": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "minItems": 1,
              "maxItems": 6
            },
            "ocr_type": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "asset_ref": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "person": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "email": {
                  "type": "string",
                  "maxLength": 254,
                  "format": "email"
                },
                "phone_e164": {
                  "type": "string",
                  "pattern": "^\\+[1-9]\\d{6,14}$"
                },
                "external_ref": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "description": "Structured alternative to `expected_location`, `expected_object` and `condition_aspects`. Send one form or the other."
    },
    "brand_slug": {
      "type": "string",
      "minLength": 2,
      "maxLength": 40,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "Brand profile shown on the capture page. Absent = your default brand."
    }
  }
}