{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-contact-search-post-schema.json",
  "title": "contactSearchPost",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-contacts-api-openapi.yml#/components/schemas/contactSearchPost",
  "type": "object",
  "properties": {
    "contactTypes": {
      "type": "array",
      "items": {
        "format": "string",
        "description": "Contact type name"
      }
    },
    "searchTerm": {
      "type": "string",
      "description": "It could be the first name, last name, company name of the contact."
    },
    "startDate": {
      "type": "string",
      "format": "date-time",
      "description": "An ISO 8601 string of the startDate to search. It will search by CreationDate. https://en.wikipedia.org/wiki/ISO_8601"
    },
    "endDate": {
      "type": "string",
      "format": "date-time",
      "description": "An ISO 8601 string of the endDate to search It will search by CreationDate. https://en.wikipedia.org/wiki/ISO_8601"
    },
    "sort": {
      "$ref": "#/$defs/contactSort"
    }
  },
  "required": [
    "startDate",
    "endDate",
    "sort"
  ],
  "$defs": {
    "contactSort": {
      "type": "object",
      "properties": {
        "sortDirection": {
          "type": "string",
          "enum": [
            "Ascending",
            "Descending"
          ],
          "description": "Sort direction of the search"
        },
        "sortColumn": {
          "type": "string",
          "enum": [
            "CreatedDate",
            "CompanyName",
            "ContactType",
            "firstName",
            "lastName",
            "LifeTimeValue"
          ],
          "description": "The columm to be sorted"
        }
      },
      "required": [
        "sortDirection",
        "sortColumn"
      ]
    }
  }
}