{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-terminate-group-specialty-request-schema.json",
  "title": "TerminateGroupSpecialtyRequest",
  "description": "Request to terminate one or more group specialties from network participation. Terminates at group-network association; optionally at group-location and group-level. Required: specialtyIds (standard Specialty IDs). Optional: networkIds (standard Network IDs to restrict scope).",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-group-api-openapi.yml#/components/schemas/TerminateGroupSpecialtyRequest",
  "type": "object",
  "required": [
    "specialtyIds",
    "terminationEffectiveDate",
    "acknowledgementConfirmed"
  ],
  "properties": {
    "specialtyIds": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "\\S"
      },
      "description": "Required. List of Specialty IDs (standard/certify specialty identifiers) to terminate for this group. Each must be a specialty currently associated with the group. Obtain from: GET /specialties, or GET /groups/{id}/relationships/all (specialties with specialtyId)."
    },
    "networkIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional. Network IDs (standard/certify network identifiers) to restrict termination to. If null or empty, terminates from all networks the group participates in. Obtain from: GET /networks or GET /groups/{id}/relationships/all (networks)."
    },
    "terminationInformedDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Termination informed date (ISO-8601 YYYY-MM-DD)."
    },
    "terminationEffectiveDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Termination effective date (ISO-8601 YYYY-MM-DD). When the specialty termination takes effect."
    },
    "terminationReason": {
      "type": "string",
      "description": "Termination reason (e.g. code or free text)."
    },
    "acknowledgementConfirmed": {
      "type": "boolean",
      "description": "User acknowledgement that terminating specialty from the group will terminate it from its locations, participating networks and plans."
    },
    "terminateAtGroupLocationSpecialties": {
      "type": "boolean",
      "description": "If true, also terminate the specialty at group-location level (TenantGroupLocationSpecialty).",
      "default": true
    },
    "terminateAtGroupLevel": {
      "type": "boolean",
      "description": "If true, also terminate the specialty at group level (TenantGroupSpecialty).",
      "default": true
    }
  }
}