{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whatsapp/json-schema/whatsapp-whats-app-business-account-schema.json",
  "title": "WhatsAppBusinessAccount",
  "description": "WhatsApp Business Account details and configuration",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whatsapp-business-messaging-api-openapi.yml#/components/schemas/WhatsAppBusinessAccount",
  "type": "object",
  "required": [
    "id",
    "name"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the WhatsApp Business Account"
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the WhatsApp Business Account",
      "minLength": 1,
      "maxLength": 255
    },
    "account_review_status": {
      "$ref": "#/$defs/AccountReviewStatus"
    },
    "purchase_order_number": {
      "type": "string",
      "description": "Purchase order number associated with the account"
    },
    "audiences": {
      "type": "array",
      "description": "List of audience segments associated with the account",
      "items": {
        "type": "string"
      }
    },
    "ownership_type": {
      "$ref": "#/$defs/OwnershipType"
    },
    "subscribed_apps": {
      "type": "array",
      "description": "List of applications subscribed to this WABA",
      "items": {
        "$ref": "#/$defs/SubscribedApp"
      }
    },
    "business_verification_status": {
      "$ref": "#/$defs/BusinessVerificationStatus"
    },
    "country": {
      "type": "string",
      "description": "Country code where the WABA is registered",
      "pattern": "^[A-Z]{2}$"
    },
    "currency": {
      "type": "string",
      "description": "Currency code for the WABA",
      "pattern": "^[A-Z]{3}$"
    },
    "timezone_id": {
      "type": "string",
      "description": "Timezone identifier for the WABA"
    },
    "on_behalf_of_business_info": {
      "$ref": "#/$defs/OnBehalfOfBusinessInfo"
    },
    "schedules": {
      "type": "array",
      "description": "Business hours and scheduling information",
      "items": {
        "$ref": "#/$defs/BusinessSchedule"
      }
    },
    "is_enabled_for_insights": {
      "type": "boolean",
      "description": "Whether insights are enabled for this WABA"
    },
    "dcc_config": {
      "$ref": "#/$defs/DCCConfig"
    },
    "message_templates": {
      "type": "array",
      "description": "Message templates associated with the WABA",
      "items": {
        "$ref": "#/$defs/MessageTemplate"
      }
    },
    "phone_numbers": {
      "type": "array",
      "description": "Phone numbers associated with the WABA",
      "items": {
        "$ref": "#/$defs/PhoneNumber"
      }
    }
  },
  "$defs": {
    "AccountReviewStatus": {
      "type": "string",
      "description": "Review status of the WhatsApp Business Account",
      "enum": [
        "APPROVED",
        "PENDING",
        "REJECTED",
        "RESTRICTED"
      ]
    },
    "BusinessSchedule": {
      "type": "object",
      "description": "Business hours schedule information",
      "properties": {
        "day_of_week": {
          "type": "string",
          "enum": [
            "MONDAY",
            "TUESDAY",
            "WEDNESDAY",
            "THURSDAY",
            "FRIDAY",
            "SATURDAY",
            "SUNDAY"
          ]
        },
        "open_time": {
          "type": "string",
          "description": "Opening time in HH:MM format",
          "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
        },
        "close_time": {
          "type": "string",
          "description": "Closing time in HH:MM format",
          "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
        }
      }
    },
    "BusinessVerificationStatus": {
      "type": "string",
      "description": "Verification status of the connected client business",
      "enum": [
        "VERIFIED",
        "UNVERIFIED",
        "PENDING",
        "REJECTED"
      ]
    },
    "DCCConfig": {
      "type": "object",
      "description": "Data and Content Control configuration",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether DCC is enabled"
        },
        "policy_url": {
          "type": "string",
          "description": "URL to the DCC policy"
        }
      }
    },
    "MessageTemplate": {
      "type": "object",
      "description": "Message template information",
      "properties": {
        "id": {
          "type": "string",
          "description": "Template ID"
        },
        "name": {
          "type": "string",
          "description": "Template name"
        },
        "status": {
          "type": "string",
          "enum": [
            "APPROVED",
            "PENDING",
            "REJECTED",
            "DISABLED"
          ]
        }
      }
    },
    "OnBehalfOfBusinessInfo": {
      "type": "object",
      "description": "Information about the business on whose behalf the WABA operates",
      "properties": {
        "id": {
          "type": "string",
          "description": "Business ID"
        },
        "name": {
          "type": "string",
          "description": "Business name"
        }
      }
    },
    "OwnershipType": {
      "type": "string",
      "description": "Type of ownership for the WhatsApp Business Account",
      "enum": [
        "SELF_OWNED",
        "CLIENT_OWNED",
        "AGENCY_OWNED"
      ]
    },
    "PhoneNumber": {
      "type": "object",
      "description": "Phone number associated with the WABA",
      "properties": {
        "id": {
          "type": "string",
          "description": "Phone number ID"
        },
        "display_phone_number": {
          "type": "string",
          "description": "Formatted phone number for display"
        },
        "verified_name": {
          "type": "string",
          "description": "Verified business name for the phone number"
        }
      }
    },
    "SubscribedApp": {
      "type": "object",
      "description": "Application subscribed to the WABA",
      "properties": {
        "id": {
          "type": "string",
          "description": "Application ID"
        },
        "name": {
          "type": "string",
          "description": "Application name"
        }
      }
    }
  }
}