{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-create-facility-specialty-request-schema.json",
  "title": "CreateFacilitySpecialtyRequest",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-facility-api-openapi.yml#/components/schemas/CreateFacilitySpecialtyRequest",
  "type": "object",
  "required": [
    "tenantSpecialtyId",
    "facilitySpecialtyIsPrimary"
  ],
  "properties": {
    "tenantSpecialtyId": {
      "type": "string",
      "pattern": "\\S",
      "description": "ID of the tenant specialty"
    },
    "facilitySpecialtyEffectiveDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Effective date for the facility specialty (YYYY-MM-DD)"
    },
    "facilitySpecialtyIsPrimary": {
      "type": "boolean",
      "description": "Indicates if the specialty is primary"
    },
    "certifyLocationId": {
      "type": "string",
      "description": "Certify location ID to associate the specialty at the facility-location level"
    },
    "facilityLocationSpecialtyEffectiveDate": {
      "type": "string",
      "description": "Effective date for the facility location specialty (YYYY-MM-DD)"
    },
    "facilityLocationSpecialtyIsPrimary": {
      "type": "boolean",
      "description": "Indicates if the location specialty is primary"
    },
    "certifyGroupId": {
      "type": "string",
      "description": "Certify group ID to associate the specialty at the group-facility level"
    },
    "certifyNetworkId": {
      "type": "string",
      "description": "Certify network ID to associate the specialty at the group-facility-network level (requires certifyGroupId)"
    },
    "groupSpecialtyEffectiveDate": {
      "type": "string",
      "description": "Effective date for the group facility specialty (YYYY-MM-DD)"
    },
    "locationSpecialtyEffectiveDate": {
      "type": "string",
      "description": "Effective date for the group facility location specialty (YYYY-MM-DD). Triggers group-location specialty creation when both certifyGroupId and certifyLocationId are provided."
    },
    "networkSpecialtyEffectiveDate": {
      "type": "string",
      "description": "Effective date for the group facility network specialty (YYYY-MM-DD)"
    }
  }
}