{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/proxymail-qa/json-schema/proxymail-qa-custom-field-input-schema.json",
  "title": "CustomFieldInput",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/proxymail-qa-openapi.json#/components/schemas/CustomFieldInput",
  "type": "object",
  "required": [
    "name",
    "match",
    "value"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "maxLength": 36,
      "description": "The custom field to change."
    },
    "enabled": {
      "type": "boolean",
      "description": "Ignored here, and allowed so a custom field can be sent back as listed. PATCH this path to turn one on or off."
    },
    "name": {
      "type": "string",
      "maxLength": 80
    },
    "match": {
      "type": "object",
      "required": [
        "on",
        "text"
      ],
      "additionalProperties": false,
      "description": "How to recognise the field: words its label or name contains (3 to 100 characters, or 2 in Chinese, Japanese or Korean), with up to 9 more phrases in also, such as its label in other languages; or its exact test ID, name or id attribute; or, for a ready-made custom field, kind with its section as text. Saving replaces the custom field, so send every phrase to keep.",
      "properties": {
        "on": {
          "type": "string",
          "enum": [
            "words",
            "test_id",
            "name",
            "html_id",
            "kind"
          ]
        },
        "text": {
          "type": "string",
          "maxLength": 100
        },
        "also": {
          "type": "array",
          "maxItems": 9,
          "items": {
            "type": "string",
            "maxLength": 100
          },
          "description": "words only: more phrases that recognise the same field, such as its label in the site's other languages."
        }
      }
    },
    "site": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 300,
      "description": "Its host or a site pattern, such as staging.acme.dev or https://*.acme.dev/*, or null for every site. It needn't be one of the project's sites yet; a blocked site is refused."
    },
    "path": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200,
      "description": "A page path such as /signup. It covers /signup, /signup/business and the same page under a language, such as /de/signup. Leave it out, or send null, for every page of the site."
    },
    "field_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "text",
        "textarea",
        "number",
        "select",
        "checkbox",
        "radio",
        null
      ]
    },
    "value": {
      "$ref": "#/$defs/CustomValue"
    },
    "tag_answer": {
      "type": "boolean",
      "description": "An option or one of a list only: tag the account with the answer."
    }
  },
  "$defs": {
    "CustomValue": {
      "type": "object",
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "What goes in the field. text: { text }. template: { template } with {first_name}, {last_name}, {full_name}, {username}, {email}, {company}, {country} or {digits:N} (N from 1 to 12). option: { option }, the option to pick. list: { items }, 2 to 20, one picked for each account. options: { options }, 1 to 20, every one for every account: ticks the boxes of a group (matched by their shared name or words in the question they answer) or selects them in a drop-down that takes several answers, and boxes not listed are unticked, though a consent box, a marketing box or a box with its own custom field is left as it is. Never a radio group. checkbox: { checked }. generate: Proxy Mail QA makes up a value that suits the field (the same for the same account), on any field but a checkbox, never a personal ID field. leave: leave the field as it is. ready_made: { section }, matched on kind (or test_id when a sign-up form made it), Proxy Mail QA’s own safe value, where it has one: phone (a number set aside for fiction, or `phones`: the team’s own test number per country), id.national, id.tax, id.passport, business.vat and business.tax (a fake value only where one can never be a real person’s, or `ids_from`: a KYC vendor’s sandbox values), gender, referral_source, language, business.role, business.team_size and business.type (one of the field’s options) and consent.terms (ticked unless `checked` is false).",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "text",
            "template",
            "option",
            "list",
            "options",
            "checkbox",
            "generate",
            "leave",
            "ready_made"
          ]
        },
        "text": {
          "type": "string",
          "maxLength": 200
        },
        "template": {
          "type": "string",
          "maxLength": 200
        },
        "option": {
          "type": "string",
          "maxLength": 100
        },
        "items": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 100
          },
          "minItems": 2,
          "maxItems": 20
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 100
          },
          "minItems": 1,
          "maxItems": 20
        },
        "checked": {
          "type": "boolean",
          "description": "checkbox, or ready_made consent.terms (true by default)."
        },
        "section": {
          "type": "string",
          "enum": [
            "phone",
            "id.national",
            "id.tax",
            "id.passport",
            "business.vat",
            "business.tax",
            "gender",
            "referral_source",
            "language",
            "business.role",
            "business.team_size",
            "business.type",
            "consent.terms"
          ],
          "description": "ready_made only: the field catalogue section it fills."
        },
        "ids_from": {
          "type": "string",
          "enum": [
            "safe",
            "stripe",
            "plaid",
            "onfido",
            "veriff",
            "didit",
            "cashfree",
            "setu"
          ],
          "description": "ready_made ID and tax numbers only: safe (the default) or a KYC vendor’s sandbox values."
        },
        "phones": {
          "type": "array",
          "maxItems": 20,
          "description": "ready_made phone only: the team’s own test numbers, one per country, for accounts in countries with no numbers set aside for fiction. Never a real person’s number.",
          "items": {
            "type": "object",
            "required": [
              "country",
              "number"
            ],
            "additionalProperties": false,
            "properties": {
              "country": {
                "type": "string",
                "pattern": "^[A-Za-z]{2}$"
              },
              "number": {
                "type": "string",
                "maxLength": 30,
                "description": "4 to 30 digits, spaces, brackets or dashes, with an optional leading +."
              }
            }
          }
        }
      }
    }
  }
}