{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/karbonhq/json-schema/karbonhq-get-tenant-settings-schema.json",
  "title": "GetTenantSettings",
  "description": "A collection of customer specific Contact and Work settings",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karbonhq-tenant-settings-api-openapi.yml#/components/schemas/GetTenantSettings",
  "type": "object",
  "properties": {
    "ContactTypes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SettingContactType"
      }
    },
    "TenantKey": {
      "type": "string",
      "description": "The unique key specific to the customer's Karbon account"
    },
    "ClientAccessActivated": {
      "type": "boolean",
      "description": "Indicates whether the tenant has activated Karbon for Clients (K4C)"
    },
    "WorkStatuses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SettingWorkStatus"
      }
    },
    "WorkTypes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SettingWorkType"
      }
    },
    "ServiceTypes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SettingServiceType"
      }
    }
  },
  "$defs": {
    "SettingContactType": {
      "description": "The name and unique key for a Contact Type ",
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name assigned to the Customer Type"
        },
        "ContactTypeKey": {
          "type": "string",
          "description": "The unique key assigned to the Customer Type"
        }
      }
    },
    "SettingServiceType": {
      "description": "The schema for a single Service Type entry",
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name assigned to the Service Type"
        },
        "ServiceTypeKey": {
          "type": "string",
          "description": "The unique key assigned to the Service Type"
        },
        "WorkTypeKeys": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "The unique key of a Work Type belonging to this Service Type, matching a WorkTypeKey in the WorkTypes array"
          }
        }
      }
    },
    "SettingWorkStatus": {
      "description": "A Work Status, its child statuses with Name, Type and unique Key",
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name assigned the Work Status"
        },
        "Type": {
          "type": "string",
          "enum": [
            "Primary",
            "Secondary"
          ],
          "description": "The type of status, expected to be Primary at this level"
        },
        "Children": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Name": {
                "type": "string",
                "description": "The name of the Secondary Work Status"
              },
              "Type": {
                "type": "string",
                "enum": [
                  "Primary",
                  "Secondary"
                ],
                "description": "The type of Work Status, expected to always be Secondary at this level"
              },
              "WorkStatusKey": {
                "type": "string",
                "description": " The unique key of the Work Status"
              }
            }
          }
        }
      }
    },
    "SettingWorkType": {
      "description": "The schema for a single Work Type entry",
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name assigned to the Work Type"
        },
        "WorkTypeKey": {
          "type": "string",
          "description": "The unique key assigned to the Work Type"
        },
        "AvailableStatuses": {
          "type": "object",
          "properties": {
            "primary": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "The name of the Primary Status"
              }
            },
            "secondary": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "The unique key of the secondary Work Status that can be used with this Work Type"
              }
            }
          }
        }
      }
    }
  }
}