{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samesake-co-uk/json-schema/samesake-co-uk-record-replacement-schema.json",
  "title": "RecordReplacement",
  "description": "A record's fields, replacing all of its current ones: a field left out or sent as null is cleared. There's no `sourceRecordId`, because the path names the record (one sent anyway is ignored). Values aren't rejected for being badly formed: a date, phone number or postcode Samesake can't read is kept as sent, but not used for matching.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samesake-co-uk-openapi.yml#/components/schemas/RecordReplacement",
  "type": "object",
  "properties": {
    "title": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "Title, such as Mr, Mrs, Ms or Dr."
    },
    "firstName": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "First name."
    },
    "lastName": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "Last name."
    },
    "email": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "Email address."
    },
    "dateOfBirth": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "Date of birth, best as yyyy-mm-dd. Day-first forms such as dd/mm/yyyy, dd-mm-yyyy and dd.mm.yyyy are read too: 03/04/1986 is 3 April."
    },
    "addressLine1": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "First line of the address, such as the house number and street."
    },
    "addressLine2": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "Second line of the address, such as the town."
    },
    "postcode": {
      "maxLength": 200,
      "type": [
        "null",
        "string"
      ],
      "description": "UK postcode, with or without the space."
    },
    "phones": {
      "maxItems": 10,
      "type": [
        "null",
        "array"
      ],
      "items": {
        "maxLength": 200,
        "type": "string"
      },
      "description": "Phone numbers, mobile or landline, in any usual format: 07700 900123, +44 7700 900123, (0161) 496 0123, +49 30 1234567. A number without a country code is read as belonging to the country chosen when your Samesake account was set up (usually the United Kingdom), so the same digits under two different country codes are two different numbers."
    }
  },
  "additionalProperties": {
    "maxLength": 200,
    "type": [
      "null",
      "string"
    ],
    "description": "Your organisation's custom fields, each under the API name set in Samesake (Admin, Custom fields). A property that names no custom field is ignored."
  }
}