{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/popp/json-schema/popp-organization-config-schema.json",
  "title": "OrganizationConfig",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/popp-organization-configuration-api-openapi.yml#/components/schemas/OrganizationConfig",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "closingMessage",
    "rejectionMessage",
    "conversationTimeout"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the organization configuration"
    },
    "conversationTimeout": {
      "type": [
        "number",
        "null"
      ],
      "description": "Time in hours before conversations auto-close",
      "minimum": 24
    },
    "closingMessage": {
      "type": "string",
      "description": "Message sent when the candidate is not interested"
    },
    "rejectionMessage": {
      "type": "string",
      "description": "Message sent when the candidate is rejected"
    },
    "globalContext": {
      "type": [
        "string",
        "null"
      ],
      "description": "Shared configuration and context applied across all campaigns in the organization"
    },
    "emailChannelFallbackEnabled": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Organization-level default for falling back to email when an SMS or WhatsApp message cannot be delivered. Individual campaigns inherit this unless they set emailChannelFallbackEnabled themselves."
    },
    "agent": {
      "type": [
        "object",
        "null"
      ],
      "description": "Default agent configuration for the organization",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "tone"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the agent"
        },
        "agentName": {
          "type": "string",
          "description": "Name of the agent"
        },
        "agentTone": {
          "type": "string",
          "description": "The communication tone of the agent",
          "enum": [
            "CASUAL",
            "ENCOURAGING",
            "FRIENDLY",
            "MOTIVATIONAL",
            "NEUTRAL",
            "PROFESSIONAL"
          ]
        },
        "organizationId": {
          "type": "string",
          "description": "Unique identifier for the organization"
        },
        "organizationConfigId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier for the organization configuration"
        }
      }
    },
    "templates": {
      "title": "WhatsApp Templates",
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "channel",
          "campaignType"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the template"
          },
          "type": {
            "type": "string",
            "description": "The type of message template",
            "enum": [
              "NUDGE_MESSAGE_1",
              "NUDGE_MESSAGE_2",
              "NUDGE_MESSAGE_3",
              "OPENING_MESSAGE",
              "RESTART_OPEN_MESSAGE",
              "WELCOME_MESSAGE"
            ]
          },
          "channel": {
            "type": "string",
            "description": "The channel through which the template will be sent",
            "enum": [
              "SMS",
              "WEB_CHAT",
              "WEB_CHAT_VIA_EMAIL",
              "WHATSAPP"
            ]
          },
          "campaignType": {
            "type": "string",
            "description": "The type of campaign this template is used for",
            "enum": [
              "APPLICANT_OUTREACH",
              "ENGAGEMENT_OUTREACH",
              "NEW_CANDIDATE_OUTREACH"
            ]
          }
        }
      }
    },
    "protectedCharacteristics": {
      "type": "object",
      "description": "Every characteristic and whether it is protected for this organization. true means the search agent refuses to search on it. Always complete: a characteristic that has never been set reads as true.",
      "properties": {
        "ageBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "sexBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "genderIdentityBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "raceEthnicityBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "nationalOriginBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "religionBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "sexualOrientationBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "disabilityBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "maritalStatusBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "pregnancyStatusBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "veteranStatusBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "criminalHistoryBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "medicalConditionsBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        },
        "englishProficiencyBias": {
          "type": "boolean",
          "description": "true protects this characteristic and the search agent refuses to search on it; false allows it."
        }
      },
      "additionalProperties": false,
      "required": [
        "ageBias",
        "sexBias",
        "genderIdentityBias",
        "raceEthnicityBias",
        "nationalOriginBias",
        "religionBias",
        "sexualOrientationBias",
        "disabilityBias",
        "maritalStatusBias",
        "pregnancyStatusBias",
        "veteranStatusBias",
        "criminalHistoryBias",
        "medicalConditionsBias",
        "englishProficiencyBias"
      ]
    }
  }
}