{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/gtm/main/json-schema/gtm-data-quality-response-schema.json",
  "title": "DataQualityResponse",
  "description": "Data Quality response body. `data` is an ARRAY of per-item result resources, in STRICT POSITIONAL 1:1 ORDER with the request's `items` — `data[i]` is the result for `items[i]`, and each resource's `id` is that index (`id == i`). The array is never reordered or filtered; a failed item still occupies its slot. Each element's `type` is the OUTCOME: a successfully processed item is its domain resource (`type` = the request domain) whose `attributes` carries the echoed `input`, the `parsed` and `normalized` stage products, and the final prepared `value`; an item that failed to process is a `PrepareError` resource (`type` = `PrepareError`) whose `attributes` carries the failure `detail`. Success and failure are distinct types (value XOR error), so a single item is never ambiguously both. Item failures are independent — the rest of the batch still succeeds (partial success at HTTP 200).",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gtm-data-quality-api-v1-api-openapi.yml#/components/schemas/DataQualityResponse",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DataQualityResultResource"
      },
      "description": "The primary data of the document"
    }
  },
  "$defs": {
    "AddressComponents": {
      "type": "object",
      "properties": {
        "streetNumber": {
          "type": "string",
          "description": "Street number (e.g., `123`)."
        },
        "street": {
          "type": "string",
          "description": "Street name (e.g., `Main St`)."
        },
        "unit": {
          "type": "string",
          "description": "Unit / suite / apartment designator (e.g., `Ste 200`)."
        },
        "poBox": {
          "type": "string",
          "description": "PO Box identifier, if present."
        },
        "city": {
          "type": "string",
          "description": "City name."
        },
        "county": {
          "type": "string",
          "description": "County or district."
        },
        "state": {
          "type": "string",
          "description": "State / province / region."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal / ZIP code."
        },
        "postalExtension": {
          "type": "string",
          "description": "Postal code extension (e.g., ZIP+4)."
        },
        "country": {
          "type": "string",
          "description": "Country name or ISO code."
        }
      },
      "description": "Structured address components, shared by address input (`components`) and the address output value. All fields optional to support messy/partial values on both sides (for example, separate CRM columns with no country)."
    },
    "AddressEnrichment": {
      "type": "string",
      "enum": [
        "NORMALIZE",
        "VERIFY",
        "ADDRESS_TYPE",
        "GEOCODE"
      ],
      "description": "Enrichment signals available for the address domain.",
      "x-enumDescriptions": {
        "NORMALIZE": "Standardization and correction of the address.",
        "VERIFY": "Postal deliverability confirmation. Populates `value.verify`.",
        "ADDRESS_TYPE": "Residential or commercial classification. Populates `value.addressType`. Supported for United States addresses.",
        "GEOCODE": "Geographic coordinates. Populates `value.latitude`/`value.longitude`/`value.precision`. Supported for a subset of countries."
      }
    },
    "AddressInputItem": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "The address to process as raw text. May be a single free-text line or a partially structured value. Supply exactly one of `address` or `components` — supplying both, or neither, does not fail the whole request and neither field takes precedence; the individual item fails (its `data[i]` result carries `error` while the rest of the batch still succeeds, HTTP 200)."
        },
        "components": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressComponents"
            }
          ],
          "description": "Pre-structured address input (for example, separate CRM columns). Supply exactly one of `address` or `components`. When present, the parse step is skipped."
        }
      },
      "description": "A single address value to prepare."
    },
    "AddressPrecision": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "NONE",
        "STATE",
        "SCF",
        "CITY_CENTROID",
        "ZIP5",
        "ZIP6",
        "ZIP7",
        "ZIP8",
        "ZIP9",
        "STRUCTURE"
      ],
      "description": "How precisely the coordinates locate the address.",
      "x-enumDescriptions": {
        "UNKNOWN": "Precision could not be determined.",
        "NONE": "No coordinates could be assigned.",
        "STATE": "Located to the state.",
        "SCF": "Located to the sectional center facility (SCF — first three ZIP digits).",
        "CITY_CENTROID": "Located to the city centroid.",
        "ZIP5": "Located to the 5-digit ZIP code.",
        "ZIP6": "Located to the ZIP+2.",
        "ZIP7": "Located to the ZIP+4.",
        "ZIP8": "Located to the ZIP+4 with greater confidence.",
        "ZIP9": "Located to the full ZIP+4 delivery point.",
        "STRUCTURE": "Located to the individual structure / rooftop."
      }
    },
    "AddressResultAttributes": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressInputItem"
            }
          ],
          "description": "The request item this result corresponds to, echoed back for correlation. Results are in the same order as request `items`; `input` confirms the pairing (notably under duplicate input values)."
        },
        "parsed": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressValue"
            }
          ],
          "description": "Parsed view of the value (the parse-stage data product)."
        },
        "normalized": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressValue"
            }
          ],
          "description": "Normalized view of the value (the normalization-stage data product)."
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressValue"
            }
          ],
          "description": "The final prepared value — the canonical result the caller buys, after parse and normalize. This is where the enrichment signals (`verify`, `addressType`, `latitude`/`longitude`/`precision`) are populated."
        }
      },
      "description": "A single address result: the echoed input, the parsed and normalized data products, and the final prepared value."
    },
    "AddressResultMeta": {
      "type": "object",
      "properties": {
        "unfulfilled": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AddressUnfulfilledEnrichment"
          },
          "description": "Enrichment signals that were not returned for this item. Absent when every signal was returned."
        }
      },
      "description": "Per-item metadata for an address result, reporting enrichment signals that were not returned. The item is still a success, and signals that were not returned are not charged."
    },
    "AddressResultResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "Address",
          "pattern": "Address"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressResultAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        },
        "meta": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressResultMeta"
            }
          ],
          "description": "Non-standard meta information about the resource"
        }
      },
      "description": "Address success result resource — one element of the response `data[]` for a successfully processed address item. `id` is the request positional index (`items[i]` → `id == i`); the prepared result is in `attributes`; `meta` reports any enrichment signal that was not returned."
    },
    "AddressType": {
      "type": "string",
      "enum": [
        "RESIDENTIAL",
        "COMMERCIAL",
        "UNKNOWN"
      ],
      "description": "Whether an address is residential or commercial.",
      "x-enumDescriptions": {
        "RESIDENTIAL": "Residential address.",
        "COMMERCIAL": "Commercial address.",
        "UNKNOWN": "Address type could not be determined."
      }
    },
    "AddressUnfulfilledEnrichment": {
      "type": "object",
      "required": [
        "enrichment"
      ],
      "properties": {
        "enrichment": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressEnrichment"
            }
          ],
          "description": "The enrichment signal that was not returned."
        },
        "reason": {
          "type": "string",
          "description": "Why the signal was not returned, for example `Address type is not supported for country CN.`"
        }
      },
      "description": "An enrichment signal that was not returned for this item."
    },
    "AddressValue": {
      "type": "object",
      "properties": {
        "streetNumber": {
          "type": "string",
          "description": "Street number (e.g., `123`)."
        },
        "street": {
          "type": "string",
          "description": "Street name (e.g., `Main St`)."
        },
        "unit": {
          "type": "string",
          "description": "Unit / suite / apartment designator (e.g., `Ste 200`)."
        },
        "poBox": {
          "type": "string",
          "description": "PO Box identifier, if present."
        },
        "city": {
          "type": "string",
          "description": "City name."
        },
        "county": {
          "type": "string",
          "description": "County or district."
        },
        "state": {
          "type": "string",
          "description": "State / province / region."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal / ZIP code."
        },
        "postalExtension": {
          "type": "string",
          "description": "Postal code extension (e.g., ZIP+4)."
        },
        "country": {
          "type": "string",
          "description": "Country name or ISO code."
        },
        "formattedAddress": {
          "type": "string",
          "description": "The full address rendered as a single human-readable string (e.g., `123 Main St, San Francisco, CA 94102, United States`). A flattened convenience view of the component fields; populated on the normalized/final value. This is a single STRING, distinct from the structured components above."
        },
        "verify": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressVerify"
            }
          ],
          "description": "Deliverability confirmation result."
        },
        "addressType": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressType"
            }
          ],
          "description": "Whether the address is residential or commercial."
        },
        "latitude": {
          "type": "number",
          "format": "double",
          "description": "Latitude coordinate."
        },
        "longitude": {
          "type": "number",
          "format": "double",
          "description": "Longitude coordinate."
        },
        "precision": {
          "allOf": [
            {
              "$ref": "#/$defs/AddressPrecision"
            }
          ],
          "description": "How precisely the coordinates locate the address."
        }
      },
      "description": "Address value: parsed/normalized components plus folded-in enrichments. All component fields optional to support messy/partial input."
    },
    "AddressVerify": {
      "type": "string",
      "enum": [
        "CONFIRMED",
        "PARTIAL",
        "NOT_FOUND"
      ],
      "description": "Deliverability confirmation result for an address.",
      "x-enumDescriptions": {
        "CONFIRMED": "The address was confirmed as deliverable.",
        "PARTIAL": "The address was partially confirmed.",
        "NOT_FOUND": "The address could not be found."
      }
    },
    "DataQualityResultResource": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/PhoneResultResource"
        },
        {
          "$ref": "#/$defs/EmailResultResource"
        },
        {
          "$ref": "#/$defs/AddressResultResource"
        },
        {
          "$ref": "#/$defs/JobTitleResultResource"
        },
        {
          "$ref": "#/$defs/PersonNameResultResource"
        },
        {
          "$ref": "#/$defs/PrepareErrorResource"
        }
      ],
      "description": "Polymorphic Data Quality result resource, discriminated by `type`. One element of the response `data[]`. `type` encodes the OUTCOME: a successful item is its domain resource (`Phone`/`Email`/`Address`/`JobTitle`/`PersonName`, prepared value in `attributes`); a failed item is the `PrepareError` resource (`PrepareItemError` in `attributes`). Successful items in one response all share the request domain; failed items are `PrepareError` regardless of domain."
    },
    "EmailComponents": {
      "type": "object",
      "properties": {
        "localPart": {
          "type": "string",
          "description": "Local part (before the @)."
        },
        "domain": {
          "type": "string",
          "description": "Domain part (after the @)."
        }
      },
      "description": "Structured email components, shared by email input (`components`) and the email output value."
    },
    "EmailInputItem": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "description": "The email address to process as raw text. Supply exactly one of `email` or `components` — supplying both, or neither, does not fail the whole request and neither field takes precedence; the individual item fails (its `data[i]` result carries `error` while the rest of the batch still succeeds, HTTP 200)."
        },
        "components": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailComponents"
            }
          ],
          "description": "Pre-structured email input. Supply exactly one of `email` or `components`. When present, the parse step is skipped."
        }
      },
      "description": "A single email value to prepare."
    },
    "EmailResultAttributes": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailInputItem"
            }
          ],
          "description": "The request item this result corresponds to, echoed back for correlation. Results are in the same order as request `items`; `input` confirms the pairing (notably under duplicate input values)."
        },
        "parsed": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailValue"
            }
          ],
          "description": "Parsed view of the value (the parse-stage data product)."
        },
        "normalized": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailValue"
            }
          ],
          "description": "Normalized view of the value (the normalization-stage data product)."
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailValue"
            }
          ],
          "description": "The final prepared value — the canonical result the caller buys, after parse and normalize."
        },
        "isValid": {
          "type": "boolean",
          "description": "Whether the input passed validation. A result-level verdict about the item as a whole, not a property of any single stage view."
        }
      },
      "description": "A single email result: the echoed input, the parsed and normalized data products, and the final prepared value."
    },
    "EmailResultResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "Email",
          "pattern": "Email"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/EmailResultAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "Email success result resource — one element of the response `data[]` for a successfully processed email item. `id` is the request positional index (`items[i]` → `id == i`); the prepared result is in `attributes`."
    },
    "EmailValue": {
      "type": "object",
      "properties": {
        "localPart": {
          "type": "string",
          "description": "Local part (before the @)."
        },
        "domain": {
          "type": "string",
          "description": "Domain part (after the @)."
        },
        "subdomain": {
          "type": "string",
          "description": "Subdomain, if present."
        },
        "tld": {
          "type": "string",
          "description": "Top-level domain."
        },
        "fullEmail": {
          "type": "string",
          "description": "Full reassembled email address (serves as the formatted form for email)."
        }
      },
      "description": "Email value: parsed/normalized components."
    },
    "JobTitleInputItem": {
      "type": "object",
      "required": [
        "jobTitle"
      ],
      "properties": {
        "jobTitle": {
          "type": "string",
          "description": "The job title to normalize."
        }
      },
      "description": "A single job title value to prepare."
    },
    "JobTitleResultAttributes": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "allOf": [
            {
              "$ref": "#/$defs/JobTitleInputItem"
            }
          ],
          "description": "The request item this result corresponds to, echoed back for correlation. Results are in the same order as request `items`; `input` confirms the pairing (notably under duplicate input values)."
        },
        "parsed": {
          "allOf": [
            {
              "$ref": "#/$defs/JobTitleValue"
            }
          ],
          "description": "Parsed view of the value (the parse-stage data product)."
        },
        "normalized": {
          "allOf": [
            {
              "$ref": "#/$defs/JobTitleValue"
            }
          ],
          "description": "Normalized view of the value (the normalization-stage data product)."
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/JobTitleValue"
            }
          ],
          "description": "The final prepared value — the canonical result the caller buys, after normalization."
        },
        "isValid": {
          "type": "boolean",
          "description": "Whether the input passed validation. A result-level verdict about the item as a whole, not a property of any single stage view."
        }
      },
      "description": "A single job title result: the echoed input, the parsed and normalized data products, and the final prepared value."
    },
    "JobTitleResultResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "JobTitle",
          "pattern": "JobTitle"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/JobTitleResultAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "Job title success result resource — one element of the response `data[]` for a successfully processed job-title item. `id` is the request positional index (`items[i]` → `id == i`); the prepared result is in `attributes`."
    },
    "JobTitleValue": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "The job title string. Serves as both the canonical value and its formatted form."
        }
      },
      "description": "Job title value: the normalized/standardized title string."
    },
    "PersonNameComponents": {
      "type": "object",
      "properties": {
        "prefix": {
          "type": "string",
          "description": "Name prefix / salutation (e.g., `Dr`, `Ms`)."
        },
        "first": {
          "type": "string",
          "description": "First / given name."
        },
        "middle": {
          "type": "string",
          "description": "Middle name or initial."
        },
        "last": {
          "type": "string",
          "description": "Last / family name."
        },
        "suffix": {
          "type": "string",
          "description": "Name suffix (e.g., `Jr`, `III`, `PhD`)."
        }
      },
      "description": "Structured person-name components, shared by person-name input (`components`) and the person-name output value. All fields optional to support messy/partial values on both sides (for example, separate CRM first/last columns)."
    },
    "PersonNameInputItem": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The full name to process as raw text. Accepts common formats. Supply exactly one of `name` or `components` — supplying both, or neither, does not fail the whole request and neither field takes precedence; the individual item fails (its `data[i]` result carries `error` while the rest of the batch still succeeds, HTTP 200)."
        },
        "components": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameComponents"
            }
          ],
          "description": "Pre-structured name input (for example, separate CRM first/last columns). Supply exactly one of `name` or `components`. When present, the parse step is skipped."
        }
      },
      "description": "A single person-name value to prepare."
    },
    "PersonNameResultAttributes": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameInputItem"
            }
          ],
          "description": "The request item this result corresponds to, echoed back for correlation. Results are in the same order as request `items`; `input` confirms the pairing (notably under duplicate input values)."
        },
        "parsed": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameValue"
            }
          ],
          "description": "Parsed view of the value (the parse-stage data product)."
        },
        "normalized": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameValue"
            }
          ],
          "description": "Normalized view of the value (the normalization-stage data product)."
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameValue"
            }
          ],
          "description": "The final prepared value — the canonical result the caller buys, after parse and normalize."
        },
        "isValid": {
          "type": "boolean",
          "description": "Whether the input passed validation. A result-level verdict about the item as a whole, not a property of any single stage view."
        }
      },
      "description": "A single person-name result: the echoed input, the parsed and normalized data products, and the final prepared value."
    },
    "PersonNameResultResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "PersonName",
          "pattern": "PersonName"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/PersonNameResultAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "Person name success result resource — one element of the response `data[]` for a successfully processed person-name item. `id` is the request positional index (`items[i]` → `id == i`); the prepared result is in `attributes`."
    },
    "PersonNameValue": {
      "type": "object",
      "properties": {
        "prefix": {
          "type": "string",
          "description": "Name prefix / salutation (e.g., `Dr`, `Ms`)."
        },
        "first": {
          "type": "string",
          "description": "First / given name."
        },
        "middle": {
          "type": "string",
          "description": "Middle name or initial."
        },
        "last": {
          "type": "string",
          "description": "Last / family name."
        },
        "suffix": {
          "type": "string",
          "description": "Name suffix (e.g., `Jr`, `III`, `PhD`)."
        },
        "fullName": {
          "type": "string",
          "description": "Full reassembled name (serves as the formatted form for person name)."
        }
      },
      "description": "Person-name value: parsed/normalized components plus the reassembled full name."
    },
    "PhoneComponents": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string",
          "description": "The phone number. On input: raw digits in national or full form (non-digit characters are tolerated). On output: the full, formatted number (the exact format depends on the normalization applied) — not a bare national component."
        },
        "countryCode": {
          "type": "string",
          "description": "Country calling code or ISO 3166-1 alpha-2 country, if already known."
        },
        "extension": {
          "type": "string",
          "description": "Extension, if present."
        }
      },
      "description": "Structured phone components, shared by phone input (`components`) and the phone output value."
    },
    "PhoneInputItem": {
      "type": "object",
      "properties": {
        "phone": {
          "type": "string",
          "description": "The phone number to process as raw text. Accepts common formats; non-digit characters are tolerated. Supply exactly one of `phone` or `components` — supplying both, or neither, does not fail the whole request and neither field takes precedence; the individual item fails (its `data[i]` result carries `error` while the rest of the batch still succeeds, HTTP 200)."
        },
        "components": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneComponents"
            }
          ],
          "description": "Pre-structured phone input. Supply exactly one of `phone` or `components`. When present, the parse step is skipped."
        }
      },
      "description": "A single phone value to prepare."
    },
    "PhoneLineType": {
      "type": "string",
      "enum": [
        "MOBILE",
        "FIXED_LINE",
        "VOIP",
        "TOLL_FREE",
        "PREMIUM_RATE",
        "SHARED_COST",
        "PERSONAL_NUMBER",
        "PAGER",
        "UAN",
        "UNKNOWN"
      ],
      "description": "Phone line-type classification (folded-in enrichment, requested via `LINE_TYPE`).",
      "x-enumDescriptions": {
        "MOBILE": "Mobile / cellular number.",
        "FIXED_LINE": "Fixed-line landline number.",
        "VOIP": "Voice-over-IP number.",
        "TOLL_FREE": "Toll-free number.",
        "PREMIUM_RATE": "Premium-rate number.",
        "SHARED_COST": "Shared-cost number.",
        "PERSONAL_NUMBER": "Personal number.",
        "PAGER": "Pager number.",
        "UAN": "Universal Access Number.",
        "UNKNOWN": "Type could not be determined."
      }
    },
    "PhoneResultAttributes": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneInputItem"
            }
          ],
          "description": "The request item this result corresponds to, echoed back for correlation. Results are in the same order as request `items`; `input` confirms the pairing (notably under duplicate input values)."
        },
        "parsed": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneValue"
            }
          ],
          "description": "Parsed view of the value (the parse-stage data product)."
        },
        "normalized": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneValue"
            }
          ],
          "description": "Normalized view of the value (the normalization-stage data product)."
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneValue"
            }
          ],
          "description": "The final prepared value — the canonical result the caller buys, after parse and normalize. This is where the post-parse/normalize enrichment output (`lineType`) is populated."
        },
        "isValid": {
          "type": "boolean",
          "description": "Whether the input passed validation. A result-level verdict about the item as a whole, not a property of any single stage view."
        }
      },
      "description": "Attributes of a single phone result resource: the echoed input, the parsed and normalized data products, and the final prepared value."
    },
    "PhoneResultResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "Phone",
          "pattern": "Phone"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneResultAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "Phone success result resource — one element of the response `data[]` for a successfully processed phone item. `id` is the request positional index (`items[i]` → `id == i`); the prepared result is in `attributes`."
    },
    "PhoneValue": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string",
          "description": "The phone number. On input: raw digits in national or full form (non-digit characters are tolerated). On output: the full, formatted number (the exact format depends on the normalization applied) — not a bare national component."
        },
        "countryCode": {
          "type": "string",
          "description": "Country calling code or ISO 3166-1 alpha-2 country, if already known."
        },
        "extension": {
          "type": "string",
          "description": "Extension, if present."
        },
        "region": {
          "type": "string",
          "description": "Region associated with the number."
        },
        "lineType": {
          "allOf": [
            {
              "$ref": "#/$defs/PhoneLineType"
            }
          ],
          "description": "Line type classification (folded-in enrichment, requested via `LINE_TYPE`)."
        }
      },
      "description": "Phone value: parsed/normalized components plus folded-in enrichments."
    },
    "PrepareErrorResource": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "PrepareError",
          "pattern": "PrepareError"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/PrepareItemError"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "Error result resource — one element of the response `data[]` for an item that failed to process (the value XOR error counterpart to the domain success resources, modeled on the enrich `NoMatch` precedent). `id` is the request positional index (`items[i]` → `id == i`), the link back to the failing item; the failure detail is in `attributes`. A failed item still occupies its ordinal slot, and the rest of the batch still succeeds (partial success, HTTP 200)."
    },
    "PrepareItemError": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable detail describing why this item could not be processed."
        }
      },
      "description": "Attributes of a `PrepareError` result resource — a single item that failed to process. Item-scoped and statusless: the HTTP status belongs to the response as a whole (a per-item failure is still part of a `200`), and the failing item is located by its ordinal position (`data[i].id == i` ↔ `items[i]`). Distinct from the document-level error object used for whole-request failures."
    }
  }
}