{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/axuall/json-schema/axuall-address-deduplication-request-schema-schema.json",
  "title": "AddressDeduplicationRequestSchema",
  "description": "Request body for POST /address_deduplications.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/axuall-address-deduplications-api-openapi.yml#/components/schemas/AddressDeduplicationRequestSchema",
  "properties": {
    "target": {
      "$ref": "#/$defs/app__routes__address_deduplications__AddressSchema",
      "description": "The address the candidates are ranked against"
    },
    "candidates": {
      "items": {
        "$ref": "#/$defs/app__routes__address_deduplications__AddressSchema"
      },
      "type": "array",
      "maxItems": 5,
      "minItems": 1,
      "title": "Candidates",
      "description": "Addresses to rank; ids are derived from content, not supplied. At most 5 per request."
    },
    "record_type": {
      "anyOf": [
        {
          "$ref": "#/$defs/RecordType"
        },
        {
          "type": "null"
        }
      ],
      "description": "What these addresses are; omit to send no context to the agent"
    }
  },
  "type": "object",
  "required": [
    "target",
    "candidates"
  ],
  "$defs": {
    "RecordType": {
      "type": "string",
      "enum": [
        "education",
        "affiliation"
      ],
      "title": "RecordType",
      "description": "What the addresses in a request are. Resolved to a context string by flows.\n\nDuplicated from flows.agent.address_deduplication, which public_api cannot import\n(it pulls axuall_agent_platform). Adding a record type means editing both."
    },
    "app__routes__address_deduplications__AddressSchema": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "line1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line1"
        },
        "line2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line2"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State"
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country"
        }
      },
      "type": "object",
      "title": "AddressSchema",
      "description": "A loosely structured postal address. Every field is optional."
    }
  }
}