{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samesake-co-uk/json-schema/samesake-co-uk-record-input-schema.json",
  "title": "RecordInput",
  "description": "A record as your system holds it. Every field except `sourceRecordId` is optional, and each request sends the whole record: a field left out or sent as null is cleared. 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/RecordInput",
  "required": [
    "sourceRecordId"
  ],
  "type": "object",
  "properties": {
    "sourceRecordId": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string",
      "description": "Your ID for the record in this source, such as a contact ID. Required, and not blank. Sending a record with the same ID again updates it. Spaces at either end are ignored."
    },
    "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."
  }
}