{
  "openapi": "3.1.0",
  "info": {
    "title": "eCommunicate Omnichannel Integration API",
    "x-logo": {
      "url": "https://www.ecommunicate.co.za/img/logo-small.png",
      "altText": "eCommunicate Logo"
    },
    "description": "# Overview\nThe eCommunicate Omnichannel Integration API lets you send and receive messages across **WhatsApp Cloud**, **WhatsApp Lite**, and **SMS** from a single platform. Use it to send template notifications, handle live customer conversations, manage contacts, track delivery, and download reports.\n\n## Quick start\n\n1. **Get your API key** — call `POST /authenticate/retrieveApiKey` with your email, password, and client reference. No existing key required.\n2. **Send a message** — `POST /v2/messages` with your template and recipient. The response returns a `requestId` for tracking.\n3. **Track delivery** — configure a [webhook](#tag/Webhook-Configuration) or poll `GET /message/status/gstid`.\n\n## Authentication\n\nEvery request requires your **Developer Key** (a UUID) in the `Authorization` header. No `Bearer` prefix — pass the key directly.\n\n```\nAuthorization: a1b2c3d4-e5f6-7890-abcd-ef1234567890\n```\n\n## Platform comparison\n\n| Capability | WhatsApp Cloud | WhatsApp Lite | SMS |\n|---|---|---|---|\n| Template messages | Yes | Yes | — |\n| Session (chat) messages | Yes (24-hour window) | Yes (any time) | — |\n| SMS fallback | Yes | Yes | — |\n| QR code connection | — | Yes | — |\n| Groups | — | Yes | — |\n| Contacts sync | — | Yes | — |\n| Direct SMS | — | — | Yes |\n\n## Messaging rules\n\n- **Notification messages** require `templateName` and `templateId`. Templates must be approved by Meta before use.\n- **Body parameters** — if your template body contains `{{1}}`, `{{2}}`, etc., include a `body` component with matching parameters.\n- **Media templates** require a `header` component specifying the format (`IMAGE`, `VIDEO`, `DOCUMENT`) and a media URL.\n- **Button templates** require a `button` component with the button index and parameter values.\n- **Carousel templates** require a `carousel` component containing a `cards` array, each with its own header, body, and buttons.\n- **Chat messages** (`messageType: CHAT`) can only be sent within the 24-hour customer service window on WhatsApp Cloud. WhatsApp Lite has no window restriction.\n\n## SMS encoding\n\n| Encoding | Flag | Chars per part | Multipart chars | Best for |\n|---|---|---|---|---|\n| GSM 7-bit | `unicode: false` | 160 | 153 | English, basic Latin |\n| Unicode | `unicode: true` | 70 | 67 | Emoji, non-Latin scripts |\n\n## Webhooks\n\nConfigure webhook URLs to receive real-time events:\n- **Incoming messages** (`incomingMessageURL`) — customer messages with text, media, location, buttons, reactions, or contacts.\n- **Status updates** (`statusUpdateURL`) — delivery receipts tracking the lifecycle: `ACCEPTED` → `SENT` → `DELIVERED` → `READ` → `PLAYED` (or `FAILED`).\n- **Session status** (`sessionStatusURL`) — WhatsApp Lite connection state changes.\n- **Platform events** (`eventWebhookURL`) — template approvals/rejections, quality rating changes, user preferences, number migrations.\n- **Chatbot conversations** (`chatbotWebhookURL`) — chatbot conversation events with chat participant context (participant id, conversation status, agent assignment). Optionally include outgoing bot replies and/or stop emitting once a chat is assigned to a human agent.\n\nEach configuration applies at one of two scopes: a **client default** (`whatsAppNumberId` omitted) covering every WhatsApp number under your client, or a **per-number override** (`whatsAppNumberId` set) targeting one specific number. The platform resolves overrides first and falls back to the default at dispatch time.\n\n## WhatsApp account and number health\n\n> **Applies to: WhatsApp Cloud API only.** WhatsApp Lite numbers are not subject to Meta's quality rating system, messaging tiers, or template review process.\n\nMaintaining good account health is critical for reliable message delivery. Meta monitors how recipients interact with your messages and assigns quality ratings that directly affect your sending capacity.\n\n### Summary of proactive steps to prevent your marketing WhatsApp number from being blocked\n\nTake these steps to protect your WhatsApp number's sending ability:\n\n1. **Set up quick replies for opt-out** — Configure a quick reply that allows recipients to indicate they want to stop receiving marketing messages. When you receive an opt-out request, immediately remove the recipient's WhatsApp number from the marketing campaign. The goal is to handle opt-outs before the recipient clicks \"Block\" or reports the message to Meta, which could result in Meta restricting or blocking your WhatsApp number from sending messages.\n\n2. **Monitor the `user_preferences` webhook** — Continuously check the `user_preferences` webhook for changes to the `PREFERENCE` field. Possible values:\n   - `stop` — The WhatsApp user has opted to stop receiving marketing messages from you.\n   - `resume` — The WhatsApp user has opted to resume receiving marketing messages from you.\n\n   When a `stop` preference is received, immediately remove the recipient from all active marketing campaigns. See Meta reference: [user_preferences webhook reference](https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/reference/user_preferences).\n\n3. **Monitor the `phone_number_quality_update` webhook** — Track quality updates for your WhatsApp marketing number. You may receive downgrades where `MAX_DAILY_MESSAGES_LIMIT` drops as low as `TIER_50` (a messaging limit of 50 recipients). After a downgrade, quality can recover and upgrade to `TIER_100K` (100,000 recipients) or `TIER_UNLIMITED`. If you receive a downgrade, urgently verify that all recipients who have indicated they do not want to receive WhatsApp messages have been removed from your campaigns. See Meta reference: [phone_number_quality_update webhook reference](https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/reference/phone_number_quality_update).\n\n### Quality ratings\n\nEach WhatsApp number has a quality rating based on recipient feedback:\n\n| Rating | Meaning | Impact |\n|---|---|---|\n| **High** | Little to no recipient dissatisfaction | Full sending capacity |\n| **Medium** | Some recipient dissatisfaction detected | Monitor and adjust content |\n| **Low** | High recipient dissatisfaction | Flagged status — limited ability to start new conversations |\n\nWhen a number drops to **Low** quality, it enters a **Flagged** status. If quality improves within 7 days, the status resets to **Connected**. Continued poor quality may result in further restrictions or suspension.\n\nQuality ratings and messaging limits are applied **per phone number**, but policy violations on any number affect the entire WhatsApp Business Account (WABA).\n\n### Messaging limit tiers\n\nYour messaging limit determines how many unique customers you can message within a 24-hour period:\n\n| Tier | Unique customers per 24 hours |\n|---|---|\n| `TIER_1K` | 1,000 |\n| `TIER_10K` | 10,000 |\n| `TIER_100K` | 100,000 |\n\nMeta automatically increases your tier when you consistently send high-quality messages. Conversely, poor quality ratings can reduce your tier.\n\n### Monitoring health\n\nUse the following to monitor your number and template health:\n\n- **Number Health** — `GET /payless4messaging-service/WhatsApp/WhatsAppClientNumbers/getForCurrentLoginUser` returns `qualityRating`, `messagingLimitTier`, and `lastQualityUpdateTime` for each number.\n- **Template health** — `GET /whatsapp-api-service/whatsAppTemplates/getWhatsAppClientTemplates` returns the quality status for each template per number.\n- **Webhooks** — configure an `eventWebhookURL` to receive real-time `phone_number_quality_update` and `message_template_status_update` events.\n- **Meta Business Manager** — check the Phone Number Quality and Template Quality columns directly in the WhatsApp Manager.\n\n### Template quality best practices\n\nMeta reviews every template before approval. To maintain high template quality:\n\n- **Be explicit** — the recipient must have opted in to receive the message.\n- **Be timely** — send shortly after user engagement, not weeks later.\n- **Be relevant** — personalise content, keep it useful, and include a clear call to action.\n- **Use descriptive names** — name templates like `order_confirmation` or `appointment_reminder`, not `template_01`.\n- **Avoid common rejection reasons** — vague content, incorrect language tags, overuse of emojis or excessive promotional tone, and malformed parameters (`{{1}}`, `{{2}}`).\n- **Choose the correct category** — do not mix marketing and utility content in a single template.\n\n### Opt-out compliance for marketing templates\n\nMarketing templates **must** include an opt-out mechanism. This is a Meta policy requirement that directly impacts your account health.\n\n**Requirements:**\n- Include a **quick-reply opt-out button** (e.g. \"Stop promotions\") in your marketing templates, especially for:\n  - The first message of a new campaign\n  - Messages sent after a long gap in marketing communication\n  - Messages sent to inactive or re-engaged users\n- **Honour opt-out requests immediately** across all numbers on your account.\n\n**Recognised opt-out keywords:** When a recipient replies with any of the following words, eCommunicate automatically treats it as an opt-out: `STOP`, `END`, `CANCEL`, `UNSUBSCRIBE`, `QUIT`.\n\n**How eCommunicate handles opt-outs:**\n- When a recipient opts out, eCommunicate **automatically blocks that number** — no further marketing messages will be sent to it.\n- You can query blocked numbers via `GET /payless4messaging-service/WhatsApp/WhatsAppBlockedNumber/getForCurrentLoginUser` to see all opt-out blocks.\n- If a recipient opts back in, remove them from the blocked list to resume messaging.\n\n**Why this matters:**\n- **Reduces block rate** — recipients who can opt out gracefully are far less likely to block or report your number, which is the primary signal Meta uses to downgrade quality ratings.\n- Prevents campaigns from being flagged or paused by Meta.\n- Enables faster messaging limit tier upgrades.\n- Ensures compliance with Meta's messaging policies.\n\n### Account ownership\n\nThe WABA must be owned by the business sending the messages. Do not add unrelated businesses to your Meta Business Portfolio. Violations result in account restriction or suspension.\n\n## Rate limits & pagination\n\nAPI rate limits return `429 Too Many Requests` — implement exponential backoff. All list endpoints use page-based pagination with `page` (zero-based) and `size` parameters. See the [Rate Limits guide](../guides/rate-limits.md) for details.\n\n## Support\n\nContact [support@ecommunicate.co.za](mailto:support@ecommunicate.co.za) for account issues, rate limit increases, or integration help. Always include the `requestId` from API responses when reporting issues.\n",
    "version": "3.0.0",
    "contact": {
      "url": "https://www.ecommunicate.co.za/",
      "email": "support@ecommunicate.co.za"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api.payless4messaging.com",
      "description": "Live — WhatsApp Cloud Server URL"
    },
    {
      "url": "https://api.payless4messages.com",
      "description": "Live — WhatsApp Lite Server URL"
    }
  ],
  "security": [
    {
      "apikeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Client Management",
      "description": "Retrieve your client profile, create child client accounts, and configure account-level settings like SMS fallback and POPIA compliance. Child clients inherit the parent's WhatsApp provider but have independent balances and configurations.\n"
    },
    {
      "name": "WhatsApp Number Management",
      "description": "View the WhatsApp numbers assigned to your account. Each number has its own provider configuration, quality rating, and messaging tier. Use these endpoints to list numbers with pagination or retrieve all numbers at once.\n"
    },
    {
      "name": "Webhook Configuration",
      "description": "Register, update, and manage webhook URLs that receive real-time notifications. You can configure separate URLs for incoming messages, delivery status updates, session status changes (WhatsApp Lite), and platform events (template approvals, quality changes, user preferences).\n"
    },
    {
      "name": "Template Management",
      "description": "Create, update, delete, and query WhatsApp message templates (WhatsApp Cloud API). Templates must be submitted to Meta for approval before use. Supports 11 template types including text-only, media header, carousel, call-to-action, authentication, and flow templates. Use `searchString` to filter by name, category, language, or status.\n\n**Call-to-action (CTA) is an umbrella term, not a single template type.** It covers any template carrying interactive buttons — **quick-reply**, **static/dynamic URL**, **phone-number**, **flow**, and **OTP** buttons — used alone or mixed in one template. The send examples group all of these under the `CTA — …` heading for this reason.\n\n**WhatsApp Lite limitation:** WhatsApp Lite only supports **text** and **media** templates. Interactive template types (call-to-action buttons, carousel, authentication, flow) are not supported on WhatsApp Lite.\n\n**Marketing templates (Cloud API):** Meta requires that marketing templates include an opt-out mechanism (e.g. a quick-reply \"Stop\" button). Including an opt-out button significantly reduces your block rate — recipients who can unsubscribe gracefully are far less likely to block your number. Templates without an opt-out option risk rejection or may negatively impact your number's quality rating. See the [Account & Number Health](#section/overview/WhatsApp-account-and-number-health) section for full details.\n"
    },
    {
      "name": "Messaging",
      "description": "Send messages through WhatsApp or SMS. The unified endpoint (`POST /v2/messages`) routes based on the `channel` field, or use dedicated channel endpoints for WhatsApp and SMS separately. Supports template notifications, session (chat) messages, media attachments, and SMS fallback. All send operations are asynchronous — a `202 Accepted` response means the message is queued for processing.\n"
    },
    {
      "name": "Message Reports",
      "description": "Query message delivery status, filter message history, view template replies, and retrieve message timelines. Use `gstId` (system tracking ID) or `ctId` (your custom tracking ID) to look up individual messages. Paginated endpoints support date range filtering and phone number search.\n"
    },
    {
      "name": "Live Chat",
      "description": "Manage real-time customer conversations through agent queues. View unassigned, assigned, team, closed, and missed conversations. Send text and media replies to customers, show typing indicators, and mark messages as read. Supports pagination and search across all queue types.\n\nFor retrieving conversation history, see the [Chatbot conversation flow](/guides/live-chat#chatbot-conversation-flow) guide — it covers receiving webhooks, looking up chat participants, and fetching messages.\n"
    },
    {
      "name": "Batches",
      "description": "Control the execution of batch message jobs. Pause a running batch to temporarily halt sending, resume a paused batch to continue, or cancel a batch to stop it permanently. Batch jobs are created automatically when sending to multiple recipients.\n"
    },
    {
      "name": "Analytics",
      "description": "Retrieve aggregated delivery statistics for notification and interaction messages. Analytics include submitted, sent, delivered, read, and failed counts, filtered by date range. Use these endpoints to monitor messaging performance and identify delivery issues.\n"
    },
    {
      "name": "Balance & Billing",
      "description": "Check your current WhatsApp messaging costs, SMS credit balance, and balance transaction history. Use these endpoints to monitor spend, verify credit availability before campaigns, and audit billing records.\n"
    },
    {
      "name": "(WhatsApp Lite) Connection",
      "description": "Connect and manage WhatsApp Lite sessions. Establish a connection by scanning a QR code (via WebSocket stream or static image) or by entering a pairing code. Monitor session status, configure webhooks for the number, and log out when needed. WhatsApp Lite requires an active phone connection — if the phone goes offline, the session disconnects.\n"
    },
    {
      "name": "(WhatsApp Lite) Groups",
      "description": "Create and manage WhatsApp groups on WhatsApp Lite numbers. Add participants, send group messages, retrieve message history, and generate invite links. Groups are only available on WhatsApp Lite — WhatsApp Cloud does not support group management via API.\n"
    },
    {
      "name": "(WhatsApp Lite) Contacts",
      "description": "Retrieve contacts synced from the phone connected to a WhatsApp Lite session. Returns the contact list stored on the device. Only available for WhatsApp Lite numbers with an active session.\n"
    },
    {
      "name": "Message Processing Config",
      "description": "Configure per-number message processing settings including throughput limits, throttle delays, batch sizes, and daily send schedules. Use these settings to control when and how fast messages are sent, balancing throughput with connection stability. WhatsApp Lite numbers support additional fine-grained controls for delay and batch windowing.\n"
    },
    {
      "name": "User Management",
      "description": "Create, update, and manage system users within your organization. Users can be admins, supervisors, or agents. Manage agent availability for live chat assignment, set concurrent chat limits, and handle password changes. Each user belongs to a client and can be assigned to teams.\n"
    },
    {
      "name": "API Key Management",
      "description": "Retrieve, rotate, or bootstrap your Developer API key. Use the credential-based `retrieveApiKey` endpoint to obtain your key without needing an existing one — ideal for first-time setup. The API key is a UUID used in the `Authorization` header for all API requests. Generating a new key immediately invalidates the previous key — update all integrations before regenerating.\n"
    },
    {
      "name": "Team Management",
      "description": "Organize agents into teams for live chat routing. Create teams, assign supervisors, add or remove members, and query team composition. Teams control how incoming conversations are distributed across agents and enable supervisor oversight of agent activity.\n"
    },
    {
      "name": "SMS Reports",
      "description": "Retrieve paginated SMS message history including both sent and received messages. Filter by direction (inbound/outbound), sending mode, and search string. Results include message content, delivery status, cost, and timestamps.\n"
    },
    {
      "name": "Report Downloads",
      "description": "Export message reports as downloadable Excel (XLSX) or CSV files. Available reports include notification delivery reports, interaction reports, and Monthly Active User (MAU) summary and detail reports. Reports can be filtered by date range and optionally emailed directly.\n"
    },
    {
      "name": "Resend Messages",
      "description": "Retry delivery of failed WhatsApp messages. Resend individual messages by ID or bulk-resend all failed messages matching a date range, template, and status filter. Useful for recovering from transient delivery failures or provider outages.\n"
    },
    {
      "name": "Tickets",
      "description": "Manage support tickets created from live chat conversations. Search and filter tickets by date range, status, agent, rating, and ticket number. Update ticket status through the lifecycle: `OPEN` → `AWAITING_AGENT` → `AWAITING_CUSTOMER` → `RESOLVED` → `CLOSED`. Retrieve ticket details by ticket number, chat participant, or customer WhatsApp number.\n"
    },
    {
      "name": "Contacts",
      "description": "Manage your customer contact database. Create, update, and delete contact records with phone numbers, names, and metadata. Contacts are used for recipient management and can be queried with pagination.\n"
    },
    {
      "name": "Block & Blacklist",
      "description": "Manage blocked and blacklisted phone numbers. **Blocked numbers** are system-managed — numbers automatically blocked due to delivery failures or user opt-outs. **Blacklisted numbers** are client-managed — numbers you explicitly add to prevent sending. Blacklist entries can be added individually or uploaded in bulk via CSV.\n"
    },
    {
      "name": "Webhook Payloads",
      "description": "Reference documentation for the payloads delivered to your webhook URLs.\nThese are **not callable endpoints** — they describe what your server will receive.\n"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Getting Started",
      "tags": [
        "Client Management",
        "User Management",
        "API Key Management",
        "Team Management"
      ]
    },
    {
      "name": "Balance & Billing",
      "tags": [
        "Balance & Billing"
      ]
    },
    {
      "name": "Messaging",
      "tags": [
        "Messaging",
        "WhatsApp Number Management",
        "Template Management",
        "Resend Messages"
      ]
    },
    {
      "name": "Live Engagement",
      "tags": [
        "Live Chat",
        "Tickets",
        "Contacts"
      ]
    },
    {
      "name": "Insights & Reporting",
      "tags": [
        "Analytics",
        "Message Reports",
        "SMS Reports",
        "Report Downloads"
      ]
    },
    {
      "name": "Configuration",
      "tags": [
        "Webhook Configuration",
        "Webhook Payloads",
        "Message Processing Config",
        "Block & Blacklist",
        "Batches"
      ]
    },
    {
      "name": "WhatsApp Lite",
      "tags": [
        "(WhatsApp Lite) Connection",
        "(WhatsApp Lite) Groups",
        "(WhatsApp Lite) Contacts"
      ]
    }
  ],
  "x-examples": {
    "fallbacks": {
      "auto": {
        "sendFallback": true,
        "unicode": false
      },
      "manual": {
        "sendFallback": true,
        "unicode": true,
        "text": "Custom fallback: Your order is ready. Check app for details."
      }
    },
    "payloads": {
      "temp_text_only": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "seasonal_promo_text",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              }
            ]
          }
        ],
        "allowDuplicates": false
      },
      "temp_text_auto_fallback": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "seasonal_promo_text",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_text_manual_fallback": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "seasonal_promo_text",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": true,
          "text": "Custom fallback: Your order is ready. Check app for details."
        },
        "allowDuplicates": false
      },
      "temp_media": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "invoice_delivery",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "header",
                "format": "DOCUMENT",
                "url": "https://example.com/inv.pdf",
                "filename": "inv.pdf"
              },
              {
                "type": "body",
                "parameters": [
                  "001"
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_text_header_var": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "text_header_var",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "header",
                "format": "TEXT",
                "parameters": [
                  "Summer Sale"
                ]
              },
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_static_text_header": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "header_text_template",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John",
                  "2026-05-29"
                ]
              }
            ]
          }
        ],
        "allowDuplicates": false
      },
      "temp_cta_static_url": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "shop_now_static",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              },
              {
                "type": "button",
                "parameters": [
                  "https://example.com/shop"
                ],
                "conversationParameters": [
                  {
                    "payload": "",
                    "conversationState": ""
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_cta_dynamic_url": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "track_order_dynamic",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              },
              {
                "type": "button",
                "parameters": [
                  "ORD-5521"
                ],
                "conversationParameters": [
                  {
                    "payload": "",
                    "conversationState": ""
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_cta_phone": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "call_support",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": []
              },
              {
                "type": "button",
                "parameters": [
                  "Call us"
                ],
                "conversationParameters": [
                  {
                    "payload": "",
                    "conversationState": ""
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_cta": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "feedback_cta",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": []
              },
              {
                "type": "button",
                "parameters": [
                  "Yes",
                  "No"
                ],
                "conversationParameters": [
                  {
                    "payload": "Yes",
                    "conversationState": "start"
                  },
                  {
                    "payload": "No",
                    "conversationState": "end"
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": true,
          "text": "Custom fallback: Your order is ready. Check app for details."
        },
        "allowDuplicates": false
      },
      "temp_cta_mixed": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "mixed_cta",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "Alice"
                ]
              },
              {
                "type": "button",
                "parameters": [
                  "Yes",
                  "No",
                  "https://example.com/shop",
                  "Call us"
                ],
                "conversationParameters": [
                  {
                    "payload": "Yes",
                    "conversationState": "start"
                  },
                  {
                    "payload": "No",
                    "conversationState": "end"
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_carousel": {
        "sender": "+1234567890",
        "templateName": "product_carousel_v1",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "Alice"
                ]
              },
              {
                "type": "carousel",
                "cards": [
                  {
                    "components": [
                      {
                        "type": "header",
                        "format": "IMAGE",
                        "url": "https://example.com/img1.jpg"
                      },
                      {
                        "type": "button",
                        "parameters": [
                          "Buy A",
                          "https://example.com/a"
                        ],
                        "conversationParameters": [
                          {
                            "payload": "Buy A",
                            "conversationState": "start"
                          },
                          {
                            "payload": "",
                            "conversationState": ""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "components": [
                      {
                        "type": "header",
                        "format": "IMAGE",
                        "url": "https://example.com/img2.jpg"
                      },
                      {
                        "type": "button",
                        "parameters": [
                          "Buy B",
                          "https://example.com/b"
                        ],
                        "conversationParameters": [
                          {
                            "payload": "Buy B",
                            "conversationState": "start"
                          },
                          {
                            "payload": "",
                            "conversationState": ""
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_carousel_dynamic": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "product_carousel_dynamic",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messageType": "NOTIFICATION",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "Alice"
                ]
              },
              {
                "type": "carousel",
                "cards": [
                  {
                    "components": [
                      {
                        "type": "header",
                        "format": "IMAGE",
                        "url": "https://example.com/img1.jpg"
                      },
                      {
                        "type": "body",
                        "parameters": [
                          "Shoes"
                        ]
                      },
                      {
                        "type": "button",
                        "parameters": [
                          "SKU-100"
                        ]
                      }
                    ]
                  },
                  {
                    "components": [
                      {
                        "type": "header",
                        "format": "IMAGE",
                        "url": "https://example.com/img2.jpg"
                      },
                      {
                        "type": "body",
                        "parameters": [
                          "Bags"
                        ]
                      },
                      {
                        "type": "button",
                        "parameters": [
                          "SKU-200"
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ],
        "fallback": {
          "sendFallback": true,
          "unicode": false
        },
        "allowDuplicates": false
      },
      "temp_auth_copy_code": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "auth_template",
        "templateId": "b8752e0f-0a47-4d2a-be9f-b8e93474fa4b",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "123456"
                ]
              },
              {
                "type": "button",
                "parameters": [
                  "123456"
                ],
                "conversationParameters": [
                  {
                    "payload": "",
                    "conversationState": ""
                  }
                ]
              }
            ]
          }
        ],
        "allowDuplicates": false
      },
      "temp_flow": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "flow_template",
        "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "body",
                "parameters": [
                  "John"
                ]
              },
              {
                "type": "button",
                "parameters": [
                  "Book Session"
                ],
                "conversationParameters": [
                  {
                    "payload": "",
                    "conversationState": ""
                  }
                ]
              }
            ]
          }
        ],
        "allowDuplicates": false
      },
      "temp_coupon_code": {
        "sender": "+1234567890",
        "mmlTemplate": false,
        "templateName": "summer_promo",
        "templateId": "2f9a6c11-7b3e-4d90-9c21-5a4e2b8f0d33",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210",
                "ctId": "id-01"
              }
            ],
            "components": [
              {
                "type": "button",
                "parameters": [
                  "25OFF"
                ]
              }
            ]
          }
        ],
        "allowDuplicates": false
      },
      "chat_text": {
        "sender": "+1234567890",
        "messageType": "CHAT",
        "messages": [
          {
            "messageText": "Hello, this is a standard session message.",
            "recipients": [
              {
                "to": "+9876543210"
              }
            ]
          }
        ]
      },
      "chat_with_media": {
        "sender": "+1234567890",
        "messageType": "CHAT",
        "messages": [
          {
            "recipients": [
              {
                "to": "+9876543210"
              }
            ],
            "messageText": "Here is that document you requested yesterday!",
            "media": {
              "url": "https://example.com/files/brochure.pdf",
              "caption": "Product_Catalog_2026.pdf"
            }
          }
        ]
      },
      "sms": {
        "messages": [
          {
            "to": "+1234567890",
            "text": "Hello, this is a simple SMS",
            "ctId": "ctid-01",
            "unicode": false
          }
        ]
      }
    }
  },
  "paths": {
    "/payless4messaging-service/WhatsApp/Client/getForCurrentLoginUser": {
      "get": {
        "tags": [
          "Client Management"
        ],
        "summary": "Get current client profile",
        "deprecated": true,
        "description": "**Deprecated.** Returns the full client record, including the SMS gateway password. Use [Get my client](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/client-management/getmyclient) (`GET /api/v1/clients/me`), which returns a `ClientResponse` carrying no credentials.",
        "operationId": "getCurrentClient",
        "responses": {
          "200": {
            "description": "The authenticated client's profile object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientDTO"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Client/createChildClient": {
      "post": {
        "tags": [
          "Client Management"
        ],
        "summary": "Create a child client",
        "deprecated": true,
        "description": "**Deprecated.** Takes the parent in the request body. Use [Create a child client (v1)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/client-management/createchild) (`POST /api/v1/clients/{clientRef}/children`), which takes the parent from the path and returns a `ClientResponse`.",
        "operationId": "createChildClient",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChildClientReq"
              },
              "example": {
                "clientRef": "MyChildClient",
                "parentClientRef": "ParentClient",
                "countryCode": "ZA",
                "countryTimezone": "Africa/Johannesburg"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Child client created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientDTO"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Client/getChildClient": {
      "get": {
        "tags": [
          "Client Management"
        ],
        "summary": "Get child clients",
        "deprecated": true,
        "description": "**Deprecated.** Takes the parent as a query parameter and returns full client records. Use [List child clients (v1)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/client-management/listchildren) (`GET /api/v1/clients/{clientRef}/children`), which takes the parent from the path and returns credential-free `ClientResponse` records.",
        "operationId": "getChildClients",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter results by client reference or name (partial match).",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "required": true,
            "description": "The parent client reference to list children for.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of child clients.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Client/updateClientSMSFallback": {
      "post": {
        "tags": [
          "Client Management"
        ],
        "summary": "Enable or disable SMS fallback",
        "deprecated": true,
        "description": "**Deprecated.** Takes a whole client object, so an omitted `smsPassword` blanks the stored one. Use [Configure SMS fallback (v1)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/client-management/setsmsfallback) (`PUT /api/v1/clients/{clientRef}/sms-fallback`), where the password is write-only: leave it out to keep the stored one.",
        "operationId": "updateSMSFallback",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Client"
              },
              "example": {
                "clientRef": "Growthpoint",
                "smsFallback": true,
                "smsMode": "fallback",
                "smsUserId": "support@ecommunicate.co.za",
                "smsPassword": "********",
                "smsClientRef": "ecomtest1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Client/updatePopiaCompliance": {
      "post": {
        "tags": [
          "Client Management"
        ],
        "summary": "Update POPIA compliance setting",
        "deprecated": true,
        "description": "**Deprecated.** Accepts a whole client object but only ever updates your own account, whatever client is in the payload. Use [Set POPIA compliance (v1)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/client-management/setpopiacompliance) (`PUT /api/v1/clients/me/popia-compliance`), whose path says so.",
        "operationId": "updatePopiaCompliance",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Client"
              },
              "example": {
                "popiaComplianceEnabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/clients/me": {
      "get": {
        "tags": [
          "Client Management"
        ],
        "summary": "Get my client",
        "description": "Returns the authenticated caller's own client as a `ClientResponse` — reference, display name, balances, country, and feature flags, with **no credentials**. The SMS gateway password is never returned. The client is taken from your authentication context.",
        "operationId": "getMyClient",
        "responses": {
          "200": {
            "description": "The authenticated caller's client (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/clients/{clientRef}/children": {
      "get": {
        "tags": [
          "Client Management"
        ],
        "summary": "List child clients (v1)",
        "description": "Returns a paginated list of the child clients belonging to the given parent, as credential-free `ClientResponse` records. Use `searchString` to filter by client reference or email.",
        "operationId": "listChildren",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "The parent client reference to list children for.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter results by client reference or email (partial match).",
            "schema": {
              "type": "string",
              "example": "acme",
              "examples": [
                "acme"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of child clients",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "tags": [
          "Client Management"
        ],
        "summary": "Create a child client (v1)",
        "description": "Creates a client under the parent named in the path. Anything the request leaves blank is inherited from the parent — account type, pricing model, country, timezone, and opening balances.",
        "operationId": "createChild",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "The parent client reference.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChildClientRequest"
              },
              "example": {
                "clientRef": "MyChildClient",
                "displayName": "My Child Client",
                "countryCode": "ZA",
                "countryTimezone": "Africa/Johannesburg"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Child client created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/clients/{clientRef}/sms-fallback": {
      "put": {
        "tags": [
          "Client Management"
        ],
        "summary": "Configure SMS fallback (v1)",
        "description": "Configures SMS fallback for the given client. When enabled, an SMS is sent automatically if the recipient is not on WhatsApp or WhatsApp delivery fails.\nThe gateway password is **write-only**: it is never returned by any endpoint, so leave `smsPassword` out (or blank) to keep the stored one, and supply it only to change it.",
        "operationId": "setSmsFallback",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "The client reference to configure.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSmsFallbackRequest"
              },
              "example": {
                "smsMode": "fallback",
                "smsFallback": true,
                "smsUserId": "support@ecommunicate.co.za",
                "smsClientRef": "ecomtest1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated client (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/clients/me/popia-compliance": {
      "put": {
        "tags": [
          "Client Management"
        ],
        "summary": "Set POPIA compliance (v1)",
        "description": "Enables or disables POPIA (Protection of Personal Information Act) compliance for your own account. When enabled, the platform enforces South African data protection requirements on message handling and contact storage.",
        "operationId": "setPopiaCompliance",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePopiaComplianceRequest"
              },
              "example": {
                "popiaComplianceEnabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated client (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientNumbers/getForCurrentLoginUser": {
      "get": {
        "tags": [
          "WhatsApp Number Management"
        ],
        "summary": "Get your WhatsApp numbers",
        "description": "Retrieve a paginated list of WhatsApp numbers assigned to your account. Each number includes its provider type (Cloud or Lite), quality rating, messaging tier, and connection status.",
        "operationId": "getClientNumbers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number (partial match).",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of WhatsApp numbers with provider and quality details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsAppClientNumberResponse"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientNumbers/getAllForCurrentLoginUser": {
      "get": {
        "tags": [
          "WhatsApp Number Management"
        ],
        "summary": "Get all your WhatsApp numbers (unpaginated)",
        "description": "Returns all WhatsApp numbers assigned to your account in a single response without pagination. Useful for populating dropdown selectors or syncing your local number list. For large accounts, prefer the paginated endpoint.",
        "operationId": "getAllClientNumbers",
        "responses": {
          "200": {
            "description": "Array of all WhatsApp numbers assigned to the authenticated client.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WhatsAppClientNumberResponse"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientNumbers/registerWLNumber": {
      "post": {
        "tags": [
          "WhatsApp Number Management"
        ],
        "summary": "Register a WhatsApp Lite (WL) number",
        "description": "Register a WhatsApp Lite number and assign it to the authenticated user's client.\nThe provider is set to `WL` and the billing model to `message`. If `hostingType` is\nomitted, it defaults to `WHATSAPP_GO`.\n\nIf the number already exists but is not linked to your client, it will be reused and\nlinked. Attempting to register a number that is already assigned to your client returns\nan error.\n",
        "operationId": "registerWLNumber",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterWLNumberRequest"
              },
              "example": {
                "number": "+27123456789",
                "hostingType": "WHATSAPP_GO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Number registered and linked to the authenticated client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientNumberResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request (e.g. missing phone number, or number already registered to this client).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "400",
                      "examples": [
                        "400"
                      ]
                    },
                    "errorCode": {
                      "type": "string",
                      "example": "BAD_REQUEST",
                      "examples": [
                        "BAD_REQUEST"
                      ]
                    },
                    "errorCodeString": {
                      "type": "string",
                      "example": "Phone number is required",
                      "examples": [
                        "Phone number is required"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientWebHook": {
      "post": {
        "tags": [
          "Webhook Configuration"
        ],
        "summary": "Create webhook configuration",
        "description": "Register webhook URLs to receive:\n- **Incoming Messages** — customer messages to your number.\n- **Status Updates** — delivery receipts (sent, delivered, read, failed).\n- **Session Status** — connection status changes (WhatsApp Lite only).\n- **Event** - user preferences, template status changes, and quality updates.\n- **Chatbot Conversations** — chatbot conversation events with chat participant context. Two flags control behavior: `chatbotIncludeOutgoing` (also emit bot replies, default `false`) and `chatbotStopOnAgentAssignment` (stop emitting once a human agent is assigned, default `false`). Coexists with `incomingMessageURL` — both fire independently.\n\n### Scope\n\nEach configuration applies at one of two scopes, controlled by the optional `whatsAppNumberId` field:\n- **Client default** (`whatsAppNumberId` omitted) — applies to every WhatsApp number under your client that doesn't have an override.\n- **Per-number override** (`whatsAppNumberId` set) — applies only to events tied to that specific number.\n\nAt dispatch time the platform looks up an override for the event's WhatsApp number first, and falls back to the client default when no override exists. Only one default per client and one override per `(client, number)` pair are allowed; duplicates return `409 Conflict`. Number ids must be linked to your client; cross-tenant ids return `403 Forbidden`.\n",
        "operationId": "createWebhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppClientWebHookRequest"
              },
              "examples": {
                "Client Default (All Webhooks)": {
                  "$ref": "#/components/examples/Webhook_Create_ClientDefault_Full"
                },
                "Per-Number Override": {
                  "$ref": "#/components/examples/Webhook_Create_PerNumberOverride"
                },
                "Incoming Messages Only": {
                  "$ref": "#/components/examples/Webhook_Create_IncomingOnly"
                },
                "Status Updates Only": {
                  "$ref": "#/components/examples/Webhook_Create_StatusOnly"
                },
                "Chatbot — Auto-Stop on Handover": {
                  "$ref": "#/components/examples/Webhook_Create_Chatbot_AutoStop"
                },
                "Chatbot — Always On (Incoming Only)": {
                  "$ref": "#/components/examples/Webhook_Create_Chatbot_AlwaysOn"
                },
                "Chatbot — v2 Enriched Payload": {
                  "$ref": "#/components/examples/Webhook_Create_Chatbot_V2Enriched"
                },
                "WhatsApp Lite (with Session Status)": {
                  "$ref": "#/components/examples/Webhook_Create_WhatsAppLite"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientWebHook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "put": {
        "tags": [
          "Webhook Configuration"
        ],
        "summary": "Update webhook configuration",
        "description": "Update an existing webhook configuration. Include the `id` of the row to update. Set any URL to an empty string (`\"\"`) to disable that webhook type while keeping others active.\n\nScope is locked once a configuration has been created — `whatsAppNumberId` on the request body is ignored. To convert a client default into a per-number override (or vice-versa), `DELETE` the existing row and `POST` a new one.\n",
        "operationId": "updateWebhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppClientWebHook"
              },
              "examples": {
                "Update All URLs": {
                  "$ref": "#/components/examples/Webhook_Update_AllUrls"
                },
                "Disable a Webhook Type": {
                  "$ref": "#/components/examples/Webhook_Update_DisableType"
                },
                "Toggle Chatbot Flags": {
                  "$ref": "#/components/examples/Webhook_Update_ChatbotFlagsOnly"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientWebHook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientWebHook/{id}": {
      "delete": {
        "tags": [
          "Webhook Configuration"
        ],
        "summary": "Delete webhook configuration",
        "description": "Delete a single configuration by id. Removing an override re-exposes that number to the client default; removing the client default leaves any per-number overrides in place but stops events for numbers without an override.\n",
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Id of the webhook configuration to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "example": true,
                  "examples": [
                    true
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientWebHook/getForCurrentLoginUser": {
      "get": {
        "tags": [
          "Webhook Configuration"
        ],
        "summary": "Get default webhook configuration",
        "description": "Returns the **client default** webhook configuration for the authenticated user. Returns an empty body when no default has been created. Use the `/list` endpoint to also retrieve per-number overrides.",
        "operationId": "getWebhook",
        "responses": {
          "200": {
            "description": "The client default webhook configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientWebHook"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientWebHook/list": {
      "get": {
        "tags": [
          "Webhook Configuration"
        ],
        "summary": "List all webhook configurations",
        "description": "Returns a paginated list of every webhook configuration belonging to the authenticated user's client — the client default (if set) and every per-number override. The client default sorts first; overrides follow, ordered by MSISDN.\n",
        "operationId": "listWebhooks",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0,
              "default": 0
            },
            "description": "Zero-based page index."
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1,
              "default": 10
            },
            "description": "Page size."
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of webhook configurations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientWebHookPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/whatsAppTemplates/createTemplate": {
      "post": {
        "tags": [
          "Template Management"
        ],
        "summary": "Create a WhatsApp template",
        "description": "Submit a new WhatsApp message template for Meta approval. The template is validated locally and forwarded to Meta's template review process. Approval typically takes minutes but can take up to 24 hours.\n\nSupports 11 template types — see the request examples for each type. The response includes the template ID and initial status (`pending`).\n\n**Marketing templates (Cloud API):** If your template category is `MARKETING`, you should include a quick-reply opt-out button (e.g. \"Stop promotions\") as part of your template components. This is a Meta policy requirement — marketing templates without an opt-out mechanism risk rejection and can negatively impact your number's quality rating and messaging limits. Including an opt-out button reduces your block rate, which is the primary factor Meta uses to assess number quality.\n\n**WhatsApp Lite:** Only text and media template types are supported. Interactive components (call-to-action buttons, carousel, authentication, flow) are not available on WhatsApp Lite.\n",
        "operationId": "createTemplate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateRequest"
              },
              "examples": {
                "Text Only": {
                  "$ref": "#/components/examples/Template_Create_TextOnly"
                },
                "Media Header": {
                  "$ref": "#/components/examples/Template_Create_Media_Header"
                },
                "Text Header": {
                  "$ref": "#/components/examples/Template_Create_Text_Header"
                },
                "Quick-reply Buttons": {
                  "$ref": "#/components/examples/Template_Create_CTA"
                },
                "Carousel": {
                  "$ref": "#/components/examples/Template_Create_Carousel"
                },
                "Auth: Copy Code": {
                  "$ref": "#/components/examples/Template_Auth_CopyCode"
                },
                "Auth: One Tap": {
                  "$ref": "#/components/examples/Template_Auth_OneTap"
                },
                "Flow": {
                  "$ref": "#/components/examples/Template_Flow"
                },
                "URL Button (Static)": {
                  "$ref": "#/components/examples/Template_StaticUrlButton"
                },
                "URL Button (Dynamic)": {
                  "$ref": "#/components/examples/Template_DynamicUrlButton"
                },
                "Phone Number Button": {
                  "$ref": "#/components/examples/Template_PhoneNumber"
                },
                "Coupon Code Button": {
                  "$ref": "#/components/examples/Template_CouponCode"
                },
                "Request Contact Info Button": {
                  "$ref": "#/components/examples/Template_RequestContactInfo"
                },
                "Call Permission Request": {
                  "$ref": "#/components/examples/Template_CallPermissionRequest"
                },
                "Mixed Buttons (QR + URL + Phone)": {
                  "$ref": "#/components/examples/Template_Create_MixedButtons"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Template submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/whatsapp-api-service/whatsAppTemplates/updateTemplate": {
      "put": {
        "tags": [
          "Template Management"
        ],
        "summary": "Update a template",
        "description": "Update components of an existing template. The `templateRequest` field must contain the stringified JSON of the new template structure.\n\n**Important:** This endpoint performs a full entity save. You must include **all** fields in the request body. Any omitted fields will be set to `null`.\n",
        "operationId": "updateTemplate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppClientTemplateDto"
              },
              "example": {
                "id": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
                "templateRequest": "{\"template_name\":\"seasonal_promo_2024\",\"language\":\"en_GB\",\"category\":\"MARKETING\",\"components\":[{\"type\":\"BODY\",\"text\":\"Hi {{1}}, check out our new deals!\"}]}",
                "templateName": "seasonal_promo_2024",
                "namespace": "whatsapp:hsm:technology:ecommunicate",
                "status": "approved",
                "templateType": "TEXT",
                "languageCode": "en_GB",
                "approved": true,
                "whatsAppProvider": "DLG",
                "requestedDate": "2026-01-10T08:00:00Z",
                "externalId": "1234567890123456",
                "attachmentType": "NULL",
                "whatsAppNumber": "+27123456789",
                "rejectedReason": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Template updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "template": {
                      "$ref": "#/components/schemas/TemplateResponseObject"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/whatsAppTemplates/deleteTemplate/{templateId}": {
      "delete": {
        "tags": [
          "Template Management"
        ],
        "summary": "Delete a template",
        "description": "Permanently delete a WhatsApp template by its ID. This removes the template from both eCommunicate and Meta. Deleted templates cannot be recovered — create a new template if needed.",
        "operationId": "deleteTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "examples": [
                        true
                      ]
                    },
                    "message": {
                      "type": "string",
                      "example": "TEMPLATE_SUCCESSFULLY_DELETED",
                      "examples": [
                        "TEMPLATE_SUCCESSFULLY_DELETED"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/whatsapp-api-service/whatsAppTemplates/approvalRequest": {
      "get": {
        "tags": [
          "Template Management"
        ],
        "summary": "Get template approval status",
        "description": "Check the current approval status of a template. Returns the template details including status (`pending`, `approved`, `rejected`), rejection reason (if applicable), and the full template structure.",
        "operationId": "getTemplateStatus",
        "parameters": [
          {
            "name": "templateId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseObject"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/whatsapp-api-service/whatsAppTemplates/getWhatsAppClientTemplates": {
      "get": {
        "tags": [
          "Template Management"
        ],
        "summary": "Get client templates (paginated)",
        "description": "Retrieve a paginated list of all WhatsApp templates for your account. Use searchString to filter by template name, category, language code, or approval status. Results are sorted by sortField (default requestedDate) in the specified direction.",
        "operationId": "getClientTemplates",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Search by template name, category, language, or status",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "requestedDate",
              "example": "requestedDate",
              "examples": [
                "requestedDate"
              ]
            }
          },
          {
            "name": "sortDir",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "desc",
              "example": "desc",
              "examples": [
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppClientTemplatePage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/v2/messages": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Send message (Unified endpoint)",
        "description": "The primary messaging endpoint — routes to WhatsApp or SMS based on the `channel` field in the request body. Set `channel` to `WHATSAPP` for template notifications and session messages, or `SMS` for direct SMS delivery.\n\nThis is an **asynchronous** endpoint. A `202 Accepted` response means the message is queued for processing, not yet delivered. Track delivery via webhooks or the message status endpoints.\n\n**WhatsApp notification messages** require an approved template (`templateName` + `templateId`). **Chat messages** (`messageType: CHAT`) can be sent within the 24-hour customer service window. **SMS messages** are sent immediately through the configured SMS gateway.\n\n**Recipient numbers** (`to`) must be in international format — country code plus subscriber number, with an optional leading `+` (e.g. `+27821234567` or `27821234567` for South Africa). Local-format numbers starting with `0` (e.g. `0821234567`) are not valid.\n",
        "operationId": "sendUnifiedMessage",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional key that makes a send safe to retry. If a request with the same `Idempotency-Key`\nwas already accepted for your account, the original response is replayed and the message is\n**not** sent or charged again. Supply a unique value (for example a UUID) per distinct send,\nand reuse the same value only when retrying that same send after a network error or timeout.\n",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnifiedMessageRequest"
              },
              "examples": {
                "WhatsApp: 1. Text": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "seasonal_promo_text",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            }
                          ]
                        }
                      ],
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 2. Text with Auto Fallback": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "seasonal_promo_text",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 3. Text with Manual Fallback": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "seasonal_promo_text",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": true,
                        "text": "Custom fallback: Your order is ready. Check app for details."
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 4. Media Header (Document)": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "invoice_delivery",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "header",
                              "format": "DOCUMENT",
                              "url": "https://example.com/inv.pdf",
                              "filename": "inv.pdf"
                            },
                            {
                              "type": "body",
                              "parameters": [
                                "001"
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 5. Text Header with Variable": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "text_header_var",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "header",
                              "format": "TEXT",
                              "parameters": [
                                "Summer Sale"
                              ]
                            },
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 5b. Static Text Header (No Variable)": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "header_text_template",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John",
                                "2026-05-29"
                              ]
                            }
                          ]
                        }
                      ],
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 6. CTA — Static URL Button": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "shop_now_static",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "https://example.com/shop"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "",
                                  "conversationState": ""
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 7. CTA — Dynamic URL Button": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "track_order_dynamic",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "ORD-5521"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "",
                                  "conversationState": ""
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 8. CTA — Phone Number Button": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "call_support",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": []
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "Call us"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "",
                                  "conversationState": ""
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 9. CTA — Quick Reply (QR)": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "feedback_cta",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": []
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "Yes",
                                "No"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "Yes",
                                  "conversationState": "start"
                                },
                                {
                                  "payload": "No",
                                  "conversationState": "end"
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": true,
                        "text": "Custom fallback: Your order is ready. Check app for details."
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 10. CTA — Mixed Buttons (QR + Static URL + Phone)": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "mixed_cta",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "Alice"
                              ]
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "Yes",
                                "No",
                                "https://example.com/shop",
                                "Call us"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "Yes",
                                  "conversationState": "start"
                                },
                                {
                                  "payload": "No",
                                  "conversationState": "end"
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 11. Carousel — Static QR + Static URL Buttons": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "templateName": "product_carousel_v1",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "Alice"
                              ]
                            },
                            {
                              "type": "carousel",
                              "cards": [
                                {
                                  "components": [
                                    {
                                      "type": "header",
                                      "format": "IMAGE",
                                      "url": "https://example.com/img1.jpg"
                                    },
                                    {
                                      "type": "button",
                                      "parameters": [
                                        "Buy A",
                                        "https://example.com/a"
                                      ],
                                      "conversationParameters": [
                                        {
                                          "payload": "Buy A",
                                          "conversationState": "start"
                                        },
                                        {
                                          "payload": "",
                                          "conversationState": ""
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "components": [
                                    {
                                      "type": "header",
                                      "format": "IMAGE",
                                      "url": "https://example.com/img2.jpg"
                                    },
                                    {
                                      "type": "button",
                                      "parameters": [
                                        "Buy B",
                                        "https://example.com/b"
                                      ],
                                      "conversationParameters": [
                                        {
                                          "payload": "Buy B",
                                          "conversationState": "start"
                                        },
                                        {
                                          "payload": "",
                                          "conversationState": ""
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 12. Carousel — Dynamic Body + Dynamic URL Button": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "product_carousel_dynamic",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messageType": "NOTIFICATION",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "Alice"
                              ]
                            },
                            {
                              "type": "carousel",
                              "cards": [
                                {
                                  "components": [
                                    {
                                      "type": "header",
                                      "format": "IMAGE",
                                      "url": "https://example.com/img1.jpg"
                                    },
                                    {
                                      "type": "body",
                                      "parameters": [
                                        "Shoes"
                                      ]
                                    },
                                    {
                                      "type": "button",
                                      "parameters": [
                                        "SKU-100"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "components": [
                                    {
                                      "type": "header",
                                      "format": "IMAGE",
                                      "url": "https://example.com/img2.jpg"
                                    },
                                    {
                                      "type": "body",
                                      "parameters": [
                                        "Bags"
                                      ]
                                    },
                                    {
                                      "type": "button",
                                      "parameters": [
                                        "SKU-200"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "fallback": {
                        "sendFallback": true,
                        "unicode": false
                      },
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 13. Authentication — Copy Code / OTP": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "auth_template",
                      "templateId": "b8752e0f-0a47-4d2a-be9f-b8e93474fa4b",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "123456"
                              ]
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "123456"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "",
                                  "conversationState": ""
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 14. Flow (Flow CTA)": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "flow_template",
                      "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                "John"
                              ]
                            },
                            {
                              "type": "button",
                              "parameters": [
                                "Book Session"
                              ],
                              "conversationParameters": [
                                {
                                  "payload": "",
                                  "conversationState": ""
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: 15. Coupon Code": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "mmlTemplate": false,
                      "templateName": "summer_promo",
                      "templateId": "2f9a6c11-7b3e-4d90-9c21-5a4e2b8f0d33",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210",
                              "ctId": "id-01"
                            }
                          ],
                          "components": [
                            {
                              "type": "button",
                              "parameters": [
                                "25OFF"
                              ]
                            }
                          ]
                        }
                      ],
                      "allowDuplicates": false
                    }
                  }
                },
                "WhatsApp: Text Chat Message": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "messageType": "CHAT",
                      "messages": [
                        {
                          "messageText": "Hello, this is a standard session message.",
                          "recipients": [
                            {
                              "to": "+9876543210"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "WhatsApp: Media Chat Message": {
                  "value": {
                    "channel": "WHATSAPP",
                    "payload": {
                      "sender": "+1234567890",
                      "messageType": "CHAT",
                      "messages": [
                        {
                          "recipients": [
                            {
                              "to": "+9876543210"
                            }
                          ],
                          "messageText": "Here is that document you requested yesterday!",
                          "media": {
                            "url": "https://example.com/files/brochure.pdf",
                            "caption": "Product_Catalog_2026.pdf"
                          }
                        }
                      ]
                    }
                  }
                },
                "SMS Message": {
                  "value": {
                    "channel": "SMS",
                    "payload": {
                      "messages": [
                        {
                          "to": "+1234567890",
                          "text": "Hello, this is a simple SMS",
                          "ctId": "ctid-01",
                          "unicode": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnifiedMessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/v2/channels/whatsapp": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Send WhatsApp messages",
        "description": "Send WhatsApp template notifications and session (chat) messages directly to the WhatsApp channel. Use this endpoint when you only need WhatsApp delivery without the unified routing layer.\n\n**Template messages** (`messageType: NOTIFICATION`) require an approved template with `templateName` and `templateId`. Include `body`, `header`, or `button` components as needed for parameter substitution.\n\n**Session messages** (`messageType: CHAT`) support text and media attachments. On **WhatsApp Cloud**, these can only be sent within the 24-hour customer service window after the customer last messaged you. On **WhatsApp Lite**, session messages can be sent at any time.\n\n**Recipient numbers** (`to`) must be in international format — country code plus subscriber number, with an optional leading `+` (e.g. `+27821234567` or `27821234567` for South Africa). Local-format numbers starting with `0` (e.g. `0821234567`) are not valid.\n\nThis is an **asynchronous** endpoint — `202 Accepted` means queued, not delivered.\n",
        "operationId": "sendWhatsApp",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional key that makes a send safe to retry. If a request with the same `Idempotency-Key`\nwas already accepted for your account, the original response is replayed and the message is\n**not** sent or charged again. Supply a unique value (for example a UUID) per distinct send,\nand reuse the same value only when retrying that same send after a network error or timeout.\n",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ECommMessageRequestV2"
              },
              "examples": {
                "1. Text": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "seasonal_promo_text",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          }
                        ]
                      }
                    ],
                    "allowDuplicates": false
                  }
                },
                "2. Text with Auto Fallback": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "seasonal_promo_text",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "3. Text with Manual Fallback": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "seasonal_promo_text",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": true,
                      "text": "Custom fallback: Your order is ready. Check app for details."
                    },
                    "allowDuplicates": false
                  }
                },
                "4. Media Header (Document)": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "invoice_delivery",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "header",
                            "format": "DOCUMENT",
                            "url": "https://example.com/inv.pdf",
                            "filename": "inv.pdf"
                          },
                          {
                            "type": "body",
                            "parameters": [
                              "001"
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "5. Text Header with Variable": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "text_header_var",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "header",
                            "format": "TEXT",
                            "parameters": [
                              "Summer Sale"
                            ]
                          },
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "5b. Static Text Header (No Variable)": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "header_text_template",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John",
                              "2026-05-29"
                            ]
                          }
                        ]
                      }
                    ],
                    "allowDuplicates": false
                  }
                },
                "6. CTA — Static URL Button": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "shop_now_static",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "https://example.com/shop"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "",
                                "conversationState": ""
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "7. CTA — Dynamic URL Button": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "track_order_dynamic",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "ORD-5521"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "",
                                "conversationState": ""
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "8. CTA — Phone Number Button": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "call_support",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": []
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "Call us"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "",
                                "conversationState": ""
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "9. CTA — Quick Reply (QR)": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "feedback_cta",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": []
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "Yes",
                              "No"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "Yes",
                                "conversationState": "start"
                              },
                              {
                                "payload": "No",
                                "conversationState": "end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": true,
                      "text": "Custom fallback: Your order is ready. Check app for details."
                    },
                    "allowDuplicates": false
                  }
                },
                "10. CTA — Mixed Buttons (QR + Static URL + Phone)": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "mixed_cta",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "Alice"
                            ]
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "Yes",
                              "No",
                              "https://example.com/shop",
                              "Call us"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "Yes",
                                "conversationState": "start"
                              },
                              {
                                "payload": "No",
                                "conversationState": "end"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "11. Carousel — Static QR + Static URL Buttons": {
                  "value": {
                    "sender": "+1234567890",
                    "templateName": "product_carousel_v1",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "Alice"
                            ]
                          },
                          {
                            "type": "carousel",
                            "cards": [
                              {
                                "components": [
                                  {
                                    "type": "header",
                                    "format": "IMAGE",
                                    "url": "https://example.com/img1.jpg"
                                  },
                                  {
                                    "type": "button",
                                    "parameters": [
                                      "Buy A",
                                      "https://example.com/a"
                                    ],
                                    "conversationParameters": [
                                      {
                                        "payload": "Buy A",
                                        "conversationState": "start"
                                      },
                                      {
                                        "payload": "",
                                        "conversationState": ""
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "components": [
                                  {
                                    "type": "header",
                                    "format": "IMAGE",
                                    "url": "https://example.com/img2.jpg"
                                  },
                                  {
                                    "type": "button",
                                    "parameters": [
                                      "Buy B",
                                      "https://example.com/b"
                                    ],
                                    "conversationParameters": [
                                      {
                                        "payload": "Buy B",
                                        "conversationState": "start"
                                      },
                                      {
                                        "payload": "",
                                        "conversationState": ""
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "12. Carousel — Dynamic Body + Dynamic URL Button": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "product_carousel_dynamic",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messageType": "NOTIFICATION",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "Alice"
                            ]
                          },
                          {
                            "type": "carousel",
                            "cards": [
                              {
                                "components": [
                                  {
                                    "type": "header",
                                    "format": "IMAGE",
                                    "url": "https://example.com/img1.jpg"
                                  },
                                  {
                                    "type": "body",
                                    "parameters": [
                                      "Shoes"
                                    ]
                                  },
                                  {
                                    "type": "button",
                                    "parameters": [
                                      "SKU-100"
                                    ]
                                  }
                                ]
                              },
                              {
                                "components": [
                                  {
                                    "type": "header",
                                    "format": "IMAGE",
                                    "url": "https://example.com/img2.jpg"
                                  },
                                  {
                                    "type": "body",
                                    "parameters": [
                                      "Bags"
                                    ]
                                  },
                                  {
                                    "type": "button",
                                    "parameters": [
                                      "SKU-200"
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "fallback": {
                      "sendFallback": true,
                      "unicode": false
                    },
                    "allowDuplicates": false
                  }
                },
                "13. Authentication — Copy Code / OTP": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "auth_template",
                    "templateId": "b8752e0f-0a47-4d2a-be9f-b8e93474fa4b",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "123456"
                            ]
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "123456"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "",
                                "conversationState": ""
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "allowDuplicates": false
                  }
                },
                "14. Flow (Flow CTA)": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "flow_template",
                    "templateId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              "John"
                            ]
                          },
                          {
                            "type": "button",
                            "parameters": [
                              "Book Session"
                            ],
                            "conversationParameters": [
                              {
                                "payload": "",
                                "conversationState": ""
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "allowDuplicates": false
                  }
                },
                "15. Coupon Code": {
                  "value": {
                    "sender": "+1234567890",
                    "mmlTemplate": false,
                    "templateName": "summer_promo",
                    "templateId": "2f9a6c11-7b3e-4d90-9c21-5a4e2b8f0d33",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210",
                            "ctId": "id-01"
                          }
                        ],
                        "components": [
                          {
                            "type": "button",
                            "parameters": [
                              "25OFF"
                            ]
                          }
                        ]
                      }
                    ],
                    "allowDuplicates": false
                  }
                },
                "Text Chat": {
                  "value": {
                    "sender": "+1234567890",
                    "messageType": "CHAT",
                    "messages": [
                      {
                        "messageText": "Hello, this is a standard session message.",
                        "recipients": [
                          {
                            "to": "+9876543210"
                          }
                        ]
                      }
                    ]
                  }
                },
                "Media Chat": {
                  "value": {
                    "sender": "+1234567890",
                    "messageType": "CHAT",
                    "messages": [
                      {
                        "recipients": [
                          {
                            "to": "+9876543210"
                          }
                        ],
                        "messageText": "Here is that document you requested yesterday!",
                        "media": {
                          "url": "https://example.com/files/brochure.pdf",
                          "caption": "Product_Catalog_2026.pdf"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pl4WhatsAppResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/v2/channels/sms": {
      "post": {
        "tags": [
          "Messaging"
        ],
        "summary": "Send SMS message",
        "description": "Send SMS messages directly through the SMS gateway. Each message in the `messages` array specifies a recipient, text content, and optional tracking ID (`ctId`). Set `unicode: true` for messages containing emoji or non-Latin characters.\n\nThis is an **asynchronous** endpoint — `202 Accepted` means queued, not delivered.\n",
        "operationId": "sendSMS",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SMSRequest"
              },
              "examples": {
                "Send SMS": {
                  "value": {
                    "messages": [
                      {
                        "to": "+1234567890",
                        "text": "Hello, this is a simple SMS",
                        "ctId": "ctid-01",
                        "unicode": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pl4SMSResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/message/status/gstid": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get message status by GSTID",
        "description": "Look up the current delivery status of a single message using its Global System Tracking ID (GSTID). Returns the latest status, timestamps for each lifecycle stage, and failure details if applicable.",
        "operationId": "getStatusByGstId",
        "parameters": [
          {
            "name": "gstId",
            "in": "query",
            "required": true,
            "description": "The Global System Tracking ID returned when the message was sent.",
            "schema": {
              "type": "string",
              "example": "gst-a1b2c3d4",
              "examples": [
                "gst-a1b2c3d4"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message status with delivery timestamps and failure details (if any).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppMessageStatusDto"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/whatsapp-api-service/message/status/ctid": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get message statuses by CTID",
        "description": "Look up delivery statuses for all messages matching your custom tracking ID (CTID) within a date range. Useful when you assigned the same `ctId` to a batch of messages and want to check their collective delivery status.",
        "operationId": "getStatusByCtId",
        "parameters": [
          {
            "name": "ctId",
            "in": "query",
            "required": true,
            "description": "Your custom tracking ID assigned when the message was sent.",
            "schema": {
              "type": "string",
              "example": "ct-order-9876",
              "examples": [
                "ct-order-9876"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range filter (ISO 8601 with timezone).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2023-10-01T12:00:00+02:00",
              "examples": [
                "2023-10-01T12:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range filter (ISO 8601 with timezone).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2023-10-02T12:00:00+02:00",
              "examples": [
                "2023-10-02T12:00:00+02:00"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 20,
              "example": 10,
              "examples": [
                10
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of message statuses matching the CTID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppMessageStatusPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/filter": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get filtered WhatsApp messages",
        "description": "Retrieve a paginated, filterable list of all sent and received WhatsApp messages. Filter by date range, template name, message type, and phone number. Use this for message history, delivery auditing, and debugging.",
        "operationId": "getFilteredMessages",
        "parameters": [
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range filter (ISO 8601 with timezone).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range filter (ISO 8601 with timezone).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter by template name (exact match).",
            "schema": {
              "type": "string",
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "description": "Filter by message type. Use `ALL` to include all types.",
            "schema": {
              "type": "string",
              "enum": [
                "CONVERSATION",
                "NOTIFICATION",
                "SESSION24HOUR",
                "ALL",
                "CHAT"
              ],
              "example": "NOTIFICATION",
              "examples": [
                "NOTIFICATION"
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Search by phone number or message content (partial match).",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 20,
              "example": 20,
              "examples": [
                20
              ]
            }
          },
          {
            "name": "orderByDesc",
            "in": "query",
            "description": "Sort by date descending (`true`) or ascending (`false`).",
            "schema": {
              "type": "boolean",
              "default": false,
              "example": false,
              "examples": [
                false
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of messages matching the filters.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsAppSendReceiveMessageDTO"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    },
                    "first": {
                      "type": "boolean",
                      "example": true,
                      "examples": [
                        true
                      ]
                    },
                    "last": {
                      "type": "boolean",
                      "example": false,
                      "examples": [
                        false
                      ]
                    },
                    "empty": {
                      "type": "boolean",
                      "example": false,
                      "examples": [
                        false
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/reply": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get template replies",
        "description": "Retrieve incoming customer replies to your template messages. Filter by date range, phone number, and template name. Useful for tracking customer engagement with specific campaigns.",
        "operationId": "getIncomingReplies",
        "parameters": [
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter replies by customer phone number or message content.",
            "schema": {
              "type": "string",
              "example": "27123456789",
              "examples": [
                "27123456789"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter replies to a specific template by name.",
            "schema": {
              "type": "string",
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "replyWindowHours",
            "in": "query",
            "description": "Number of hours after template delivery within which a reply is considered a response. Defaults to 48.",
            "schema": {
              "type": "integer",
              "default": 48,
              "example": 48,
              "examples": [
                48
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of customer replies matching the specified filters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReplyReportDto"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/timeline": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get message timeline",
        "description": "Paginated timeline of successful WhatsApp messages filtered by date range and phone numbers.",
        "operationId": "getMessageTimeline",
        "parameters": [
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 20,
              "example": 20,
              "examples": [
                20
              ]
            }
          },
          {
            "name": "clientWhatsAppNumber",
            "in": "query",
            "description": "Filter by your business WhatsApp number (sender).",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          },
          {
            "name": "customerWhatsAppNumber",
            "in": "query",
            "description": "Filter by the customer's WhatsApp number (recipient).",
            "schema": {
              "type": "string",
              "example": "+27821234567",
              "examples": [
                "+27821234567"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of WhatsApp messages ordered chronologically",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsAppSendReceiveMessageDTO"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    },
                    "first": {
                      "type": "boolean",
                      "example": true,
                      "examples": [
                        true
                      ]
                    },
                    "last": {
                      "type": "boolean",
                      "example": false,
                      "examples": [
                        false
                      ]
                    },
                    "empty": {
                      "type": "boolean",
                      "example": false,
                      "examples": [
                        false
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get chat participants",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2), which returns a lean `ChatParticipantResponse` and selects the list with a `scope` filter (my / team / unassigned / closed / missed / open / all). This endpoint returns the full internal entity and is retained only for existing integrations.\n\nRetrieve chat participant details for the authenticated user's client. Returns participant profile information, assignment status, and conversation metadata. Use `searchString` to filter by phone number or full name, and `isOpen` to filter by conversation state.",
        "operationId": "getChatParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Optional case-insensitive substring filter applied to the participant's phone number and full name. Partial matches are supported. Omit to return unfiltered results.",
            "schema": {
              "type": "string",
              "example": "27123456789",
              "examples": [
                "27123456789"
              ]
            }
          },
          {
            "name": "isOpen",
            "in": "query",
            "description": "Optional conversation-state filter. Omit (or send no value) to return all chats. Pass `true` to return only open conversations (`conversationClosed = false`), or `false` to return only closed conversations (`conversationClosed = true`).",
            "schema": {
              "type": "boolean",
              "example": true,
              "examples": [
                true
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of chat participants with profile and assignment details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantPage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/chats": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "List chats (v2)",
        "description": "Paginated chat list for the authenticated agent, selected by `scope`. The agent and client are resolved from your API key / session. Returns a lean `ChatParticipantResponse` page and replaces the deprecated [Get chat participants](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/getchatparticipants).",
        "operationId": "listChatsV2",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "description": "Which list to return: `my` (assigned to you), `team` (your team's), `unassigned`, `closed`, `my-missed`, `missed-agent`, `missed-after-hours`, `open` (all open client chats), or `all` (open and closed).\n\n`unassigned` is scoped by role: supervisors see every queued chat for the client; an agent with the unassigned-inbox permission sees chats queued for a team they belong to (plus chats with no team); an agent without that permission gets `403`. Each item in this scope carries `team`/`teamId` and a `lastMessagePreview`.",
            "schema": {
              "type": "string",
              "enum": [
                "my",
                "team",
                "my-missed",
                "unassigned",
                "closed",
                "missed-agent",
                "missed-after-hours",
                "open",
                "all"
              ],
              "example": "my",
              "examples": [
                "my"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number (zero-based).",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of items per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Optional case-insensitive substring filter on phone number and full name.",
            "schema": {
              "type": "string",
              "example": "27123456789",
              "examples": [
                "27123456789"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of chats for the requested scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantResponsePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/chats/{id}": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get a chat (v2)",
        "description": "Fetch a single chat as a lean `ChatParticipantResponse`. Tenant-checked.",
        "operationId": "getChatV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Chat participant id.",
            "schema": {
              "type": "string",
              "example": "aef65b5a-23a4-462a-a275-9aa2f3e0e56e",
              "examples": [
                "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/chats/{id}/terminate": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Terminate a chat (v2)",
        "description": "Close the conversation (and trigger the rating widget if configured). Takes only the chat id — the closing agent is resolved from your API key / session. Replaces toggling `conversationClosed` on the deprecated [Terminate or reopen a chat conversation](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/terminatechatparticipantchat).",
        "operationId": "terminateChatV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Chat participant id.",
            "schema": {
              "type": "string",
              "example": "aef65b5a-23a4-462a-a275-9aa2f3e0e56e",
              "examples": [
                "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The closed chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/chats/{id}/open": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Reopen a chat (v2)",
        "description": "Reopen a previously closed conversation and assign it to the calling agent (resolved from your API key / session). Replaces toggling `conversationClosed=false` on the deprecated [Terminate or reopen a chat conversation](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/terminatechatparticipantchat).",
        "operationId": "openChatV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Chat participant id.",
            "schema": {
              "type": "string",
              "example": "aef65b5a-23a4-462a-a275-9aa2f3e0e56e",
              "examples": [
                "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The reopened chat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/chats/{id}/take": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Take an unassigned chat (v2)",
        "description": "Claim a chat that is waiting in the unassigned inbox and assign it to the calling agent (resolved from your API key / session). The assignment is atomic: if two agents take the same chat at once, one succeeds and the other receives `409`. The caller must be a supervisor, or an agent with the unassigned-inbox permission who belongs to the chat's team (any inbox-enabled agent when the chat has no team). On success the usual assignment flow runs — the \"assigned to agent\" message, when enabled, and a push to the agent's chat list. Replying to an unassigned chat still claims it implicitly; this endpoint is the explicit, race-safe version.",
        "operationId": "takeChatV2",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Chat participant id.",
            "schema": {
              "type": "string",
              "example": "aef65b5a-23a4-462a-a275-9aa2f3e0e56e",
              "examples": [
                "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The chat, now assigned to the caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipantResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not take chats from this team's inbox, or belongs to another client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ERROR",
                      "examples": [
                        "ERROR"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "example": "You do not have access to this chat's team inbox",
                      "examples": [
                        "You do not have access to this chat's team inbox"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid",
                      "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                      "examples": [
                        "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                      ]
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "2026-01-15T10:30:00Z",
                      "examples": [
                        "2026-01-15T10:30:00Z"
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The chat is closed, or another agent took it first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ERROR",
                      "examples": [
                        "ERROR"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "example": "Chat has already been taken",
                      "examples": [
                        "Chat has already been taken"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid",
                      "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                      "examples": [
                        "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                      ]
                    },
                    "timestamp": {
                      "type": "string",
                      "example": "2026-01-15T10:30:00Z",
                      "examples": [
                        "2026-01-15T10:30:00Z"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/system/tickets": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get global system tracking numbers",
        "description": "Retrieve global system tracking numbers (gstn) from chat participants created within the\nspecified date range. The client is resolved from the authenticated user's API key or session.\n",
        "operationId": "getSystemTicketNumbersByDate",
        "parameters": [
          {
            "name": "startTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of global system tracking number (GSTN) UUIDs for chat participants created within the date range",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                    "examples": [
                      "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/trackingNumber/{trackingNumber}": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get chat messages by tracking number",
        "deprecated": true,
        "description": "**Deprecated.** Use [Get messages by tracking number (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/getmessagesbytrackingnumberv2), which returns the lean `MessageResponse`. Retained for existing integrations.\n\nRetrieve the full conversation history for a chat participant matching the given tracking number (GSTN or CTN).",
        "operationId": "getChatMessagesByTrackingNumber",
        "parameters": [
          {
            "name": "trackingNumber",
            "in": "path",
            "required": true,
            "description": "The global system tracking number (GSTN) or conversation tracking number (CTN).",
            "schema": {
              "type": "string",
              "example": "GSTN-12345",
              "examples": [
                "GSTN-12345",
                "CTN-67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete conversation message history for the specified tracking number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages/tracking/{trackingNumber}": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get messages by tracking number (v2)",
        "description": "Retrieve the conversation history for a tracking number (GSTN or CTN) as lean `MessageResponse` objects, scoped to your client. Replaces the deprecated [Get chat messages by tracking number](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/getchatmessagesbytrackingnumber).",
        "operationId": "getMessagesByTrackingNumberV2",
        "parameters": [
          {
            "name": "trackingNumber",
            "in": "path",
            "required": true,
            "description": "The global system tracking number (GSTN) or conversation tracking number (CTN).",
            "schema": {
              "type": "string",
              "example": "GSTN-12345",
              "examples": [
                "GSTN-12345",
                "CTN-67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Messages for the tracking number that belong to your client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageResponse"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages/ctid/{ctId}": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get a message by ctId (v2)",
        "description": "Look up a single message by its custom tracking id (`ctId`) as a lean `MessageResponse`. Tenant-checked — returns `404` if the message does not belong to your client.",
        "operationId": "getMessageByCtIdV2",
        "parameters": [
          {
            "name": "ctId",
            "in": "path",
            "required": true,
            "description": "The custom tracking id set when the message was sent.",
            "schema": {
              "type": "string",
              "example": "ct-msg-5678",
              "examples": [
                "ct-msg-5678"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message matching the ctId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/ticket/client/{clientRef}": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get tickets by client ref",
        "description": "Retrieve all tickets for a given client reference, including rating information.",
        "operationId": "getTicketsByClientRef",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of tickets with rating information for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TicketEmailDto"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/ticket/by-ticket-number": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get ticket by ticket number",
        "description": "Retrieve a single ticket by its ticket number.",
        "operationId": "getTicketByTicketNumber",
        "parameters": [
          {
            "name": "ticketNumber",
            "in": "query",
            "required": true,
            "description": "The unique ticket number to look up.",
            "schema": {
              "type": "string",
              "example": "TICKET-12345",
              "examples": [
                "TICKET-12345"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ticket object matching the specified ticket number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketEmailDto"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/ticket/search": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Search tickets with filters",
        "description": "Search and filter tickets with pagination. Supports filtering by date range,\nWhatsApp number, rating, ticket number, agent, client ref, and status.\n",
        "operationId": "filterTicketsByCriteria",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": true,
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "whatsAppNumber",
            "in": "query",
            "required": false,
            "description": "Filter by the customer's WhatsApp phone number.",
            "schema": {
              "type": "string",
              "example": "+27821234567",
              "examples": [
                "+27821234567"
              ]
            }
          },
          {
            "name": "rating",
            "in": "query",
            "required": false,
            "description": "Filter by ticket satisfaction rating.",
            "schema": {
              "type": "string",
              "enum": [
                "poor",
                "average",
                "excellent"
              ],
              "example": "excellent",
              "examples": [
                "excellent"
              ]
            }
          },
          {
            "name": "ticketNumber",
            "in": "query",
            "required": false,
            "description": "Filter by a specific ticket number.",
            "schema": {
              "type": "string",
              "example": "TICKET-12345",
              "examples": [
                "TICKET-12345"
              ]
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "description": "Filter by the assigned agent's ID.",
            "schema": {
              "type": "string",
              "example": "agent-001",
              "examples": [
                "agent-001"
              ]
            }
          },
          {
            "name": "selectedStatus",
            "in": "query",
            "required": false,
            "description": "Filter by ticket status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "awaiting agent",
                "awaiting customer",
                "resolved"
              ],
              "example": "open",
              "examples": [
                "open"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of tickets matching the specified filter criteria",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketEmailDtoPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ticket/{ticketId}/status": {
      "put": {
        "tags": [
          "Tickets"
        ],
        "summary": "Update ticket status",
        "description": "Update the status of an existing ticket.",
        "operationId": "updateTicketStatus",
        "parameters": [
          {
            "name": "ticketId",
            "in": "path",
            "required": true,
            "description": "The unique ID of the ticket to update.",
            "schema": {
              "type": "string",
              "example": "64a1b2c3d4e5f67890abcdef",
              "examples": [
                "64a1b2c3d4e5f67890abcdef"
              ]
            }
          },
          {
            "name": "newStatus",
            "in": "query",
            "required": true,
            "description": "The new status to set on the ticket.",
            "schema": {
              "type": "string",
              "enum": [
                "OPEN",
                "CLOSED",
                "AWAITING AGENT",
                "AWAITING CUSTOMER",
                "RESOLVED"
              ],
              "example": "CLOSED",
              "examples": [
                "CLOSED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The updated ticket object with the new status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketEmailDto"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/ticket/getTicketEmailEntitiesByCustomerWhatsappNumberAndClientWhatsappNumber": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get tickets by customer and client WhatsApp numbers",
        "description": "Retrieve all ticket entities matching both the customer's and the client's WhatsApp numbers.",
        "operationId": "getTicketsByCustomerAndClientWhatsappNumber",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "query",
            "required": true,
            "description": "The customer's WhatsApp phone number.",
            "schema": {
              "type": "string",
              "example": "27821234567",
              "examples": [
                "27821234567"
              ]
            }
          },
          {
            "name": "clientNumber",
            "in": "query",
            "required": true,
            "description": "Your business WhatsApp phone number.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of ticket entities matching both phone numbers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TicketEmailEntity"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ticket/getTicketEntityByChatParticipantId": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get ticket by chat participant ID",
        "description": "Retrieve the ticket entity associated with a specific chat participant.",
        "operationId": "getTicketByChatParticipantId",
        "parameters": [
          {
            "name": "participantId",
            "in": "query",
            "required": true,
            "description": "The unique chat participant ID.",
            "schema": {
              "type": "string",
              "example": "cp-a1b2c3d4",
              "examples": [
                "cp-a1b2c3d4"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ticket entity associated with the specified chat participant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketEmailEntity"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ticket/getTicketEmailEntitiesByCustomerWhatsappNumberAndClientRef": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get tickets by customer WhatsApp number and client ref",
        "description": "Retrieve all ticket entities matching a customer's WhatsApp number and client reference (case-insensitive).",
        "operationId": "getTicketsByCustomerWhatsappNumberAndClientRef",
        "parameters": [
          {
            "name": "customerWhatsAppNumber",
            "in": "query",
            "required": true,
            "description": "The customer's WhatsApp phone number.",
            "schema": {
              "type": "string",
              "example": "27821234567",
              "examples": [
                "27821234567"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of ticket entities matching the customer number and client reference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TicketEmailEntity"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ticket/getOpenedAndClosedTickets/{clientRef}": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Get opened and closed tickets",
        "description": "Retrieve all tickets for a client within a date range, including both opened and closed tickets.",
        "operationId": "getOpenedAndClosedTickets",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of opened and closed tickets within the specified date range",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TicketEmailDto"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/getMessagesByChatParticipant": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get messages by chat participant",
        "deprecated": true,
        "description": "**Deprecated.** Use [Get messages for a chat participant (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/getmessagesv2) instead, which returns a leaner curated payload (`MessageResponse`) and includes the quoted-reply context. This endpoint returns the full internal message entity and is retained only for existing integrations.\n\nRetrieve all messages for a specific chat participant. Accepts participant ID or web session ID.",
        "operationId": "getMessagesByChatParticipant",
        "parameters": [
          {
            "name": "participantId",
            "in": "query",
            "required": true,
            "description": "Chat participant ID or web session ID.",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of all messages exchanged with the specified chat participant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get messages for a chat participant (v2)",
        "description": "Retrieve the messages for a chat participant as a lean, curated payload (`MessageResponse`) — only the fields a live-chat UI needs, plus the quoted-reply context (`quotedExternalMessageId`, `quotedText`). The agent is resolved from your API key / session and the participant is tenant-checked. Replaces the deprecated [Get messages by chat participant](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/getmessagesbychatparticipant).",
        "operationId": "getMessagesV2",
        "parameters": [
          {
            "name": "participantId",
            "in": "query",
            "required": true,
            "description": "Chat participant ID.",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ordered list of messages for the chat participant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageResponse"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Send an agent message (v2)",
        "description": "Send an agent reply on any channel through a single endpoint. The target channel is set via the `channel` field (`WHATSAPP`, `WEB`, or `FACEBOOK`) and routing is handled server-side — replacing the per-channel v1 send endpoints. For a text message set `text`; for media, first upload the file via [Upload media for an agent message](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/uploadmediav2) and send the returned `mediaUrl` (the content type defaults to `MEDIA` when a `mediaUrl` is present). The agent is resolved from your API key / session and the participant is tenant-checked.",
        "operationId": "sendMessageV2",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              },
              "examples": {
                "text": {
                  "summary": "Send a text message",
                  "value": {
                    "participantId": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                    "channel": "WHATSAPP",
                    "tempId": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
                    "text": "Thanks for reaching out — how can I help?"
                  }
                },
                "media": {
                  "summary": "Send media (after uploading)",
                  "value": {
                    "participantId": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                    "channel": "WEB",
                    "tempId": "d0a1b2c3-4d5e-6f70-8192-a3b4c5d6e7f8",
                    "mediaUrl": "https://cdn.example.com/uploads/quote-1234.pdf",
                    "mediaType": "DOCUMENT",
                    "text": "Here is your quote."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages/media": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Upload media for an agent message (v2)",
        "description": "Upload a media file and receive a hosted `mediaUrl` (plus the detected `mediaType`) to attach to a [Send an agent message](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendmessagev2) call. Channel-agnostic — the same uploaded URL can be sent on WhatsApp, web, or Facebook.",
        "operationId": "uploadMediaV2",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The media file to upload (image, document, video, audio)."
                  }
                }
              },
              "examples": {
                "sample": {
                  "summary": "Upload a file",
                  "value": {
                    "file": "(binary)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored media reference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages/typing": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Send typing indicator (v2)",
        "description": "Show a typing indicator to the customer. The sender/recipient are resolved from the participant — you only pass `participantId` (and optionally the last inbound `messageId`, which the server otherwise looks up). Replaces the deprecated [Send typing indicator (Chat)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendchattypingindicator).",
        "operationId": "sendTypingIndicatorV2",
        "parameters": [
          {
            "name": "participantId",
            "in": "query",
            "required": true,
            "description": "Chat participant to show the typing indicator to.",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "required": false,
            "description": "Optional last inbound WhatsApp message id; the server looks it up when omitted.",
            "schema": {
              "type": "string",
              "example": "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg",
              "examples": [
                "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Typing indicator sent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/api/v2/messages/read": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Mark a conversation as read (v2)",
        "description": "Mark the participant's conversation as read — clears the unread badge and sends a read receipt to the customer. Pass `participantId` (and optionally the last inbound `messageId`, which the server otherwise looks up).",
        "operationId": "markAsReadV2",
        "parameters": [
          {
            "name": "participantId",
            "in": "query",
            "required": true,
            "description": "Chat participant whose conversation is being marked read.",
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "required": false,
            "description": "Optional last inbound WhatsApp message id for the read receipt; looked up when omitted.",
            "schema": {
              "type": "string",
              "example": "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg",
              "examples": [
                "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation marked as read and receipt sent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/batches/control": {
      "post": {
        "tags": [
          "Batches"
        ],
        "summary": "Control batch execution",
        "description": "Pause, resume, or cancel batch message execution.\n\n**Scope Resolution (Priority Order):**\n1. `batchId` provided → applies to that batch only.\n2. `senderId` provided → applies to all active batches for that sender.\n3. Neither → applies to all active batches for the authenticated client.\n\n**Rules:**\n- Batches can only be paused/resumed while ACTIVE or PAUSED.\n- CANCELLED batches cannot be resumed.\n- Batch messages are retained for 7 days. After that, the batch cannot be resumed.\n",
        "operationId": "controlBatch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchExecutionControlRequest"
              },
              "example": {
                "batchId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                "action": "PAUSE"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the batch control action was successfully applied"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict (e.g. resuming a cancelled batch)"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/whatsapp-analytics/notifications": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get notification summary",
        "description": "Aggregated delivery statistics for your notification (template) messages over a date range, optionally filtered by content type and direction. Each message is counted once, under its latest status: a read message counts as read only, not also as sent and delivered. The client is taken from your authentication context.",
        "operationId": "getNotificationSummary",
        "parameters": [
          {
            "$ref": "#/components/parameters/AnalyticsStartDate"
          },
          {
            "$ref": "#/components/parameters/AnalyticsEndDate"
          },
          {
            "$ref": "#/components/parameters/AnalyticsMessageContentType"
          },
          {
            "$ref": "#/components/parameters/AnalyticsDirection"
          }
        ],
        "responses": {
          "200": {
            "description": "Notification counts per status and per failure reason",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/whatsapp-analytics/interactions": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get interaction summary",
        "description": "Aggregated delivery statistics for your interaction (24-hour session) messages over a date range, optionally filtered by content type and direction. Each message is counted once, under its latest status. Incoming messages count as read. The client is taken from your authentication context.",
        "operationId": "getInteractionSummary",
        "parameters": [
          {
            "$ref": "#/components/parameters/AnalyticsStartDate"
          },
          {
            "$ref": "#/components/parameters/AnalyticsEndDate"
          },
          {
            "$ref": "#/components/parameters/AnalyticsMessageContentType"
          },
          {
            "$ref": "#/components/parameters/AnalyticsDirection"
          }
        ],
        "responses": {
          "200": {
            "description": "Interaction counts per status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageStatusAnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppAnalytics/getNotificationAnalyticsForCurrentLoginUser": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get notification analytics",
        "deprecated": true,
        "description": "**Deprecated.** Ignores content-type and direction filters. Use [Get notification summary](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/analytics/getnotificationsummary) (`GET /api/v1/whatsapp-analytics/notifications`). Returns counts for submitted, sent, delivered, read, and failed notification messages within a date range; each message is counted once, under its latest status.",
        "operationId": "getNotificationAnalytics",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start of the date range (format \"yyyy-MM-dd HH:mm:ss\").",
            "schema": {
              "type": "string",
              "example": "2026-01-01 00:00:00",
              "examples": [
                "2026-01-01 00:00:00"
              ]
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End of the date range (format \"yyyy-MM-dd HH:mm:ss\").",
            "schema": {
              "type": "string",
              "example": "2026-01-31 23:59:59",
              "examples": [
                "2026-01-31 23:59:59"
              ]
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "description": "Filter by message type category.",
            "schema": {
              "type": "string",
              "enum": [
                "NOTIFICATION",
                "SESSION24HOUR",
                "CONVERSATION",
                "CHAT"
              ],
              "example": "NOTIFICATION",
              "examples": [
                "NOTIFICATION"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregated notification delivery statistics including submitted, sent, delivered, read, and failed counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppNotificationAnalytics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppAnalytics/getInteractionAnalyticsForCurrentLoginUser": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get interaction analytics",
        "deprecated": true,
        "description": "**Deprecated.** Ignores content-type and direction filters. Use [Get interaction summary](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/analytics/getinteractionsummary) (`GET /api/v1/whatsapp-analytics/interactions`). Aggregated delivery stats for interaction (session) messages; each message is counted once, under its latest status.",
        "operationId": "getInteractionAnalytics",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start of the date range (format \"yyyy-MM-dd HH:mm:ss\").",
            "schema": {
              "type": "string",
              "example": "2026-01-0 T00:00:00",
              "examples": [
                "2026-01-0 T00:00:00"
              ]
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End of the date range (format \"yyyy-MM-dd HH:mm:ss\").",
            "schema": {
              "type": "string",
              "example": "2026-01-31 23:59:59",
              "examples": [
                "2026-01-31 23:59:59"
              ]
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "description": "Filter by message type category.",
            "schema": {
              "type": "string",
              "enum": [
                "NOTIFICATION",
                "SESSION24HOUR",
                "CONVERSATION",
                "CHAT"
              ],
              "example": "SESSION24HOUR",
              "examples": [
                "SESSION24HOUR"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregated interaction delivery statistics including submitted, sent, delivered, read, and failed counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppInteractionAnalytics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Billing/getCostForCurrentLoginUser": {
      "get": {
        "tags": [
          "Balance & Billing"
        ],
        "summary": "Get message costs",
        "description": "Retrieve the current messaging cost configuration for your account, including per-message rates by channel and message type.",
        "operationId": "getBillingCosts",
        "responses": {
          "200": {
            "description": "The current messaging cost configuration for your account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingCostWrapper"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/SMSBalance/getClientBalance": {
      "get": {
        "tags": [
          "Balance & Billing"
        ],
        "summary": "Check SMS balance",
        "description": "Check your current SMS credit balance. Use this before sending SMS campaigns to verify sufficient credits are available.",
        "operationId": "getSMSBalance",
        "responses": {
          "200": {
            "description": "Current SMS credit balance for the authenticated client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppClientBalanceHistory/getForCurrentClient": {
      "get": {
        "tags": [
          "Balance & Billing"
        ],
        "summary": "Get balance history",
        "description": "Retrieve a paginated history of balance transactions including top-ups, message costs, and adjustments.",
        "operationId": "getBalanceHistory",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter transactions by keyword (e.g., user name or reference).",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of balance transactions including top-ups, costs, and adjustments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BalanceHistoryEntry"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/configs": {
      "get": {
        "tags": [
          "Message Processing Config"
        ],
        "summary": "Get all message processing configs",
        "description": "Retrieve message processing configurations for all WhatsApp numbers. Each config includes throughput limits, throttle delays, and daily send schedules.",
        "operationId": "getMessageProcessingConfigs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Filter configs by client number or client reference.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of message processing configurations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageProcessingConfig"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Message Processing Config"
        ],
        "summary": "Create message processing config",
        "description": "Configure batch send schedules and throttling for a WhatsApp number.\nThe `dailySchedules` map defines when messages can be sent for each day of the week.\n\n**Note:** The `minMsgDelaySeconds`, and `maxMsgDelaySeconds`, `batchSize`, `minBatchDelayMinutes`, `maxBatchDelayMinutes`, `batchSuccessLimit` fields\napply to **WhatsApp Lite only**. Cloud API rate limiting is managed by Meta.\n",
        "operationId": "createMessageProcessingConfig",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageProcessingConfig"
              },
              "example": {
                "clientNumber": "+27123456789",
                "clientRef": "MyClient",
                "clientTimezone": "Africa/Johannesburg",
                "maxMessagesPerMinute": 6,
                "minMsgDelaySeconds": 5,
                "maxMsgDelaySeconds": 10,
                "batchSize": 20,
                "minBatchDelayMinutes": 15,
                "maxBatchDelayMinutes": 30,
                "batchSuccessLimit": 0,
                "dailySchedules": {
                  "MONDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "TUESDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "WEDNESDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "THURSDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "FRIDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "SATURDAY": {
                    "enabled": false,
                    "resumeTime": "08:00",
                    "stopTime": "13:00"
                  },
                  "SUNDAY": {
                    "enabled": false,
                    "resumeTime": "08:00",
                    "stopTime": "13:00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The newly created message processing configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageProcessingConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/configs/{clientNumber}": {
      "get": {
        "tags": [
          "Message Processing Config"
        ],
        "summary": "Get config by client number",
        "description": "Retrieve the message processing configuration for a specific WhatsApp number.",
        "operationId": "getMessageProcessingConfigByNumber",
        "parameters": [
          {
            "name": "clientNumber",
            "in": "path",
            "required": true,
            "description": "The WhatsApp number whose configuration to retrieve.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message processing configuration for the specified WhatsApp number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageProcessingConfig"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Message Processing Config"
        ],
        "summary": "Update config by client number",
        "description": "Update the message processing configuration for a specific WhatsApp number. This is a full replacement -- include all fields in the request body.",
        "operationId": "updateMessageProcessingConfig",
        "parameters": [
          {
            "name": "clientNumber",
            "in": "path",
            "required": true,
            "description": "The WhatsApp number whose configuration to update.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageProcessingConfig"
              },
              "example": {
                "clientNumber": "+27123456789",
                "clientRef": "MyClient",
                "clientTimezone": "Africa/Johannesburg",
                "maxMessagesPerMinute": 6,
                "minMsgDelaySeconds": 5,
                "maxMsgDelaySeconds": 10,
                "batchSize": 20,
                "minBatchDelayMinutes": 15,
                "maxBatchDelayMinutes": 30,
                "batchSuccessLimit": 0,
                "dailySchedules": {
                  "MONDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "TUESDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "WEDNESDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "THURSDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "FRIDAY": {
                    "enabled": true,
                    "resumeTime": "08:00",
                    "stopTime": "17:00"
                  },
                  "SATURDAY": {
                    "enabled": false,
                    "resumeTime": "08:00",
                    "stopTime": "13:00"
                  },
                  "SUNDAY": {
                    "enabled": false,
                    "resumeTime": "08:00",
                    "stopTime": "13:00"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated message processing configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageProcessingConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Message Processing Config"
        ],
        "summary": "Delete config by client number",
        "description": "Delete the message processing configuration for a specific WhatsApp number, reverting to default platform settings.",
        "operationId": "deleteMessageProcessingConfig",
        "parameters": [
          {
            "name": "clientNumber",
            "in": "path",
            "required": true,
            "description": "The WhatsApp number whose configuration to delete.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Configuration successfully deleted; the number reverts to default platform settings"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers": {
      "post": {
        "tags": [
          "User Management"
        ],
        "summary": "Create a system user",
        "deprecated": true,
        "description": "**Deprecated.** Accepts and returns credential-bearing `SystemUser` fields. Use [Create a user](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/createuser) (`POST /api/v1/users`), which takes no password and returns a one-time temporary password instead.",
        "operationId": "createSystemUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SystemUserRequest"
              },
              "example": {
                "email": "agent@example.com",
                "password": "SecureP@ss123",
                "firstName": "Jane",
                "lastName": "Doe",
                "liveChatRole": "AGENT",
                "avatar": "https://example.com/avatars/jane.jpg",
                "assignmentMessage": "Hi, I'm Jane and I'll be assisting you today."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The newly created system user object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemUser"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Update a system user",
        "deprecated": true,
        "description": "**Deprecated.** Accepts and returns credential-bearing `SystemUser` fields. Use [Update a user](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/updateuser) (`PUT /api/v1/users`), which is identified by `id`, carries no credentials, and returns a `UserResponse`.",
        "operationId": "updateSystemUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SystemUser"
              },
              "example": {
                "id": "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890",
                "email": "agent@example.com",
                "firstName": "Jane",
                "lastName": "Doe",
                "liveChatRole": "AGENT",
                "agentChatLimit": 5,
                "availabilityStatus": true,
                "avatar": "https://example.com/avatars/jane.jpg",
                "assignmentMessage": "Hi, I'm Jane and I'll be assisting you today.",
                "allowedSharedInbox": true,
                "allowedUnassignedInbox": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated system user object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemUser"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/getCurrentLoginSystemUser": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get current logged-in user",
        "deprecated": true,
        "description": "**Deprecated.** Returns credential-bearing `SystemUser` fields. Use [Get my profile](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/getme) (`GET /api/v1/users/me`), which returns a credential-free `UserResponse`.",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "The authenticated user's profile including role, assigned numbers, and availability status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemUser"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/me": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get my profile",
        "description": "Returns the authenticated caller's own profile as a credential-free `UserResponse`.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "The authenticated user's profile (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "List your organization's user",
        "description": "Returns every user in the authenticated client's organization as a lean summary — id, name, email, role, live-chat role, avatar, and availability — with **no credentials or secrets**. Use this to populate transfer/assignment pickers and agent lists. The client is taken from your authentication context.",
        "operationId": "listClientUsers",
        "responses": {
          "200": {
            "description": "Lean list of the client's users (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserSummary"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "User Management"
        ],
        "summary": "Create a user",
        "description": "Create an organization user. Takes **no password** — a one-time temporary password is generated and returned once in the response; the user must set their own password on first login. The client is taken from `clientRef`, or your auth context when omitted.",
        "operationId": "createUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User created; includes the one-time temporary password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Update a user",
        "description": "Update an organization user's profile, identified by `id`. Carries no credentials and returns a credential-free `UserResponse`.",
        "operationId": "updateUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated user (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/{id}": {
      "delete": {
        "tags": [
          "User Management"
        ],
        "summary": "Delete a user",
        "description": "Soft-deletes an organization user, identified by `id`: the user is disabled, signed out, and removed from any teams, but the record is retained. Carries no credentials.",
        "operationId": "deleteUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the user to delete.",
            "schema": {
              "type": "string",
              "example": "fcc7c809-2765-4aad-a8e7-7444adbdac16",
              "examples": [
                "fcc7c809-2765-4aad-a8e7-7444adbdac16"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The user was soft-deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "User deleted successfully",
                      "examples": [
                        "User deleted successfully"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/getCurrentClientUsers": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get all users in your organization (supervisor-only)",
        "deprecated": true,
        "description": "**Supervisor-only.** Returns the full `SystemUser` records for the client (including credential-bearing fields), so it is restricted to callers with the supervisor role and returns `403` otherwise. For agent-facing user lists use [List your organization's users](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/listclientusers), which returns a lean, credential-free `UserSummary[]`.",
        "operationId": "getClientUsers",
        "responses": {
          "200": {
            "description": "List of all system users (agents, supervisors, and admins) for the authenticated client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SystemUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/getUsersForClient": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get users for a specific client (paginated)",
        "deprecated": true,
        "description": "**Deprecated.** Returns credential-bearing `SystemUser` records. Use [List users (paginated)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/getuserspage) (`GET /api/v1/users/page`), which returns credential-free `UserResponse` records.",
        "operationId": "getUsersForClient",
        "parameters": [
          {
            "name": "clientRef",
            "in": "query",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of system users for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SystemUser"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/page": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "List users (paginated)",
        "description": "Retrieve a paginated list of a client's users as credential-free `UserResponse` records.",
        "operationId": "getUsersPage",
        "parameters": [
          {
            "name": "clientRef",
            "in": "query",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "required": false,
            "description": "Optional search filter.",
            "schema": {
              "type": "string",
              "example": "alice",
              "examples": [
                "alice"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of the client's users (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UserResponse"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/changeAvailableStatus": {
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Change agent availability status",
        "deprecated": true,
        "description": "**Deprecated.** Returns credential-bearing `SystemUser` fields. Use [Change availability](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/changeavailability) (`PUT /api/v1/users/availability`), which returns a credential-free `UserResponse`.",
        "operationId": "changeAvailabilityStatus",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "example": true,
                    "examples": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated system user object with the new availability status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemUser"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/availability": {
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Change availability",
        "description": "Toggle the authenticated agent's online/offline status; returns a credential-free `UserResponse`.",
        "operationId": "changeAvailability",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "example": true,
                    "examples": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated user with the new availability status (no credentials)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/updateAgentChatLimit": {
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Update agent chat limit",
        "deprecated": true,
        "description": "**Deprecated.** Use [Set agent chat limit](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/setagentchatlimit) (`PUT /api/v1/users/agent-chat-limit`). Behaviour is identical.",
        "operationId": "updateAgentChatLimit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientRef",
                  "agentChatLimit"
                ],
                "properties": {
                  "clientRef": {
                    "type": "string",
                    "example": "MyClient",
                    "examples": [
                      "MyClient"
                    ]
                  },
                  "agentChatLimit": {
                    "type": "integer",
                    "example": 5,
                    "examples": [
                      5
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the agent chat limit was updated successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/agent-chat-limit": {
      "put": {
        "tags": [
          "User Management"
        ],
        "summary": "Set agent chat limit",
        "description": "Set the maximum number of concurrent chats an agent can handle for the given client.",
        "operationId": "setAgentChatLimit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientRef",
                  "agentChatLimit"
                ],
                "properties": {
                  "clientRef": {
                    "type": "string",
                    "example": "MyClient",
                    "examples": [
                      "MyClient"
                    ]
                  },
                  "agentChatLimit": {
                    "type": "integer",
                    "example": 5,
                    "examples": [
                      5
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the agent chat limit was updated successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/changePassword": {
      "post": {
        "tags": [
          "User Management"
        ],
        "summary": "Change password",
        "deprecated": true,
        "description": "**Deprecated.** Use [Change my password](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/changemypassword) (`POST /api/v1/users/me/password/change`). Behaviour is identical.",
        "operationId": "changePassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordWrapper"
              },
              "example": {
                "oldPassword": "OldP@ssw0rd",
                "newPassword": "NewSecureP@ss123",
                "confirmNewPassword": "NewSecureP@ss123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the password was changed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Password changed successfully",
                      "examples": [
                        "Password changed successfully"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/me/password/change": {
      "post": {
        "tags": [
          "User Management"
        ],
        "summary": "Change my password",
        "description": "Change the authenticated caller's own password. Requires old password, new password, and confirmation.",
        "operationId": "changeMyPassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordWrapper"
              },
              "example": {
                "oldPassword": "OldP@ssw0rd",
                "newPassword": "NewSecureP@ss123",
                "confirmNewPassword": "NewSecureP@ss123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the password was changed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Password Changed Successfully",
                      "examples": [
                        "Password Changed Successfully"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/getWhatsAppCreditsForCurrentLoginUser": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get WhatsApp credits for current user",
        "deprecated": true,
        "description": "**Deprecated.** Use [Get my WhatsApp credits](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/user-management/getmycredits) (`GET /api/v1/users/me/credits`). Behaviour is identical.",
        "operationId": "getWhatsAppCreditsForCurrentLoginUser",
        "responses": {
          "200": {
            "description": "The current WhatsApp credit balance as a decimal number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number",
                  "format": "decimal",
                  "example": 1000,
                  "examples": [
                    1000
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/users/me/credits": {
      "get": {
        "tags": [
          "User Management"
        ],
        "summary": "Get my WhatsApp credits",
        "description": "Retrieve the WhatsApp credit balance for the authenticated caller.",
        "operationId": "getMyCredits",
        "responses": {
          "200": {
            "description": "The current WhatsApp credit balance as a decimal number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number",
                  "format": "decimal",
                  "example": 1000,
                  "examples": [
                    1000
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/authenticate/retrieveApiKey": {
      "post": {
        "tags": [
          "API Key Management"
        ],
        "summary": "Retrieve API key with credentials",
        "description": "Retrieve your Developer API key by authenticating with your account credentials. This is the\nrecommended first step for new integrations — it does **not** require an existing API key.\n\nSend your account email, password, and client reference to receive your API key. Use the\nreturned key in the `Authorization` header for all subsequent API requests.\n",
        "operationId": "retrieveApiKey",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password",
                  "clientRef"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The email address associated with your eCommunicate account.",
                    "example": "user@example.com",
                    "examples": [
                      "user@example.com"
                    ]
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "description": "Your eCommunicate account password.",
                    "example": "your-password",
                    "examples": [
                      "your-password"
                    ]
                  },
                  "clientRef": {
                    "type": "string",
                    "description": "Your unique client reference identifier, found in the eCommunicate dashboard.",
                    "example": "CLIENT001",
                    "examples": [
                      "CLIENT001"
                    ]
                  }
                }
              },
              "example": {
                "email": "user@example.com",
                "password": "your-password",
                "clientRef": "CLIENT001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authentication succeeded — returns the Developer API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiKey": {
                      "type": "string",
                      "description": "Your Developer API key (UUID format). Use this in the `Authorization` header.",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "examples": [
                        "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                      ]
                    }
                  }
                },
                "example": {
                  "apiKey": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials — check your email, password, and client reference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "REJECTED",
                      "examples": [
                        "REJECTED"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "A human-readable description of the authentication failure.",
                      "example": "Invalid Credentials",
                      "examples": [
                        "Invalid Credentials"
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid",
                      "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                      "examples": [
                        "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                      ]
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2026-01-15T10:30:00Z",
                      "examples": [
                        "2026-01-15T10:30:00Z"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "REJECTED",
                  "message": "Invalid Credentials",
                  "requestId": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "timestamp": "2026-01-15T10:30:00Z"
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/SystemUsers/generateAPIKey": {
      "post": {
        "tags": [
          "API Key Management"
        ],
        "summary": "Generate a new API key",
        "description": "Generates a new Developer API key. **Warning:** This invalidates the previous key immediately.\nAll integrations using the old key will stop working.\n",
        "operationId": "generateAPIKey",
        "responses": {
          "200": {
            "description": "The newly generated API key token (previous key is now invalidated)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "example": "f6e5d4c3-b2a1-0987-6543-210fedcba987",
                      "examples": [
                        "f6e5d4c3-b2a1-0987-6543-210fedcba987"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/add": {
      "post": {
        "tags": [
          "Team Management"
        ],
        "summary": "Create a team",
        "description": "Create a new team for organizing agents. Specify the team name, supervisor, and client reference.",
        "operationId": "createTeam",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamReq"
              },
              "example": {
                "clientRef": "MyClient",
                "teamName": "Support Team",
                "priority": 1,
                "selectedNextNodeId": "node-abc123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The newly created team object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamEntity"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/update": {
      "post": {
        "tags": [
          "Team Management"
        ],
        "summary": "Update a team",
        "description": "Update a team's name, supervisor, or other properties.",
        "operationId": "updateTeam",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamReq"
              },
              "example": {
                "id": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
                "teamName": "Support Team",
                "priority": 1,
                "selectedNextNodeId": "node-abc123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated team object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamEntity"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/remove": {
      "post": {
        "tags": [
          "Team Management"
        ],
        "summary": "Remove a team",
        "description": "Permanently delete a team. Members are unassigned but their user accounts are not affected.",
        "operationId": "removeTeam",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The ID of the team to remove.",
                    "example": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
                    "examples": [
                      "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the team was successfully removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/list/{clientRef}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get all teams for a client",
        "description": "Retrieve all teams for a client reference.",
        "operationId": "getTeams",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of all teams for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TeamEntity"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/{id}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get team by ID",
        "description": "Retrieve a single team's details by its UUID.",
        "operationId": "getTeamById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique team UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The team object with all its details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamEntity"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/pl4chat-service/team/members/{teamId}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get team members",
        "description": "Retrieve all members assigned to a specific team.",
        "operationId": "getTeamMembers",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "description": "The unique team UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of system users assigned to the specified team",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SystemUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/free-members/{clientRef}/{teamId}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get available members (not yet in team)",
        "description": "List users who are not currently assigned to the specified team. Useful for populating an 'add member' interface.",
        "operationId": "getFreeMembersForTeam",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "description": "The unique team UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of system users not currently assigned to the specified team",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SystemUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/add-member": {
      "post": {
        "tags": [
          "Team Management"
        ],
        "summary": "Add member to team",
        "description": "Assign a user to a team.",
        "operationId": "addTeamMember",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberReq"
              },
              "example": {
                "teamId": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                "systemUserId": "b2c3d4e5-f6a1-8901-b2c3-d4e5f6a18901"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The system user object of the newly added team member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemUser"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/remove-member": {
      "post": {
        "tags": [
          "Team Management"
        ],
        "summary": "Remove member from team",
        "description": "Remove a user from a team without deleting their account.",
        "operationId": "removeTeamMember",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberReq"
              },
              "example": {
                "teamId": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
                "systemUserId": "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the member was successfully removed from the team"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/names/{clientRef}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get team names",
        "description": "Retrieve a lightweight list of team names for a client. Useful for populating dropdown selectors.",
        "operationId": "getTeamNames",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of team name strings for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "Support Team",
                    "examples": [
                      "Support Team"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/supervisors/{clientRef}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get all supervisors",
        "description": "Retrieve all users with the supervisor role for a client.",
        "operationId": "getSupervisors",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of all users with the supervisor role for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SystemUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/team/agents/{clientRef}": {
      "get": {
        "tags": [
          "Team Management"
        ],
        "summary": "Get all agents",
        "description": "Retrieve all users with the agent role for a client.",
        "operationId": "getAgents",
        "parameters": [
          {
            "name": "clientRef",
            "in": "path",
            "required": true,
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of all users with the agent role for the specified client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SystemUser"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getUnAssignedParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get unassigned conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=unassigned`. Retained for existing integrations.",
        "operationId": "getUnassignedParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of unassigned conversations waiting to be picked up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getMyParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get my assigned conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=my`. Retained for existing integrations.",
        "operationId": "getMyParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of conversations assigned to the authenticated agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getTeamParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get team conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=team`. Retained for existing integrations.",
        "operationId": "getTeamParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of conversations assigned to the current user's team members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getClosedParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get closed conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=closed`. Retained for existing integrations.\n\nRetrieve conversations that have been terminated by an agent. Results are paginated and can be filtered by search string and client reference.",
        "operationId": "getClosedParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of closed conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getMissedParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get missed conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=missed-agent`. Retained for existing integrations.\n\nRetrieve conversations where the customer disconnected before an agent could respond. Includes pagination and search.",
        "operationId": "getMissedParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of missed conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getMissedAfterHoursParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get after-hours missed conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=missed-after-hours`. Retained for existing integrations.",
        "operationId": "getMissedAfterHoursParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of after-hours missed conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getMyMissedParticipants": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get my missed conversations",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=my-missed`. Retained for existing integrations.",
        "operationId": "getMyMissedParticipants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by customer name or phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of conversations missed by the authenticated agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChatParticipant"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/getChatParticipantsByAssignedTo": {
      "get": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Get conversations assigned to a specific agent",
        "deprecated": true,
        "description": "**Deprecated.** Use [List chats (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/listchatsv2) with `scope=my`. v2 resolves the agent from your API key / session, so it returns **your** assigned chats — you can no longer query an arbitrary agent by id. Retained for existing integrations.\n\nRetrieve all active conversations assigned to a specific agent by their user ID.",
        "operationId": "getParticipantsByAssignedTo",
        "parameters": [
          {
            "name": "assignedTo",
            "in": "query",
            "required": true,
            "description": "System user ID of the agent.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of active conversations assigned to the specified agent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChatParticipant"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/ChatParticipant/terminateChatParticipantChat": {
      "put": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Terminate or reopen a chat conversation",
        "deprecated": true,
        "description": "**Deprecated.** Use [Terminate a chat (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/terminatechatv2)\nor [Reopen a chat (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/openchatv2) — they take\nonly the chat id (the actor is resolved from your API key / session) and avoid the full-object\nmerge pitfalls below. Retained for existing integrations.\n\nTerminates or reopens a chat by toggling the `conversationClosed` field on the ChatParticipant object.\nSet `conversationClosed` to `true` to terminate the chat (triggers the rating widget if configured),\nor set it to `false` to reopen a previously closed chat.\n\n**Important — send the full object.** The safest approach is to fetch the participant with `GET /pl4chat-service/ChatParticipant` and send the **complete object** back with `conversationClosed` toggled. The endpoint merges non-null string and object fields (so most omitted fields are preserved), but two categories behave differently and can silently reset state:\n\n- **`assignedTo`** — if omitted or `null`, the agent assignment is cleared.\n- **Boolean flags** — `conversationClosed`, `missedConversation`, `afterHoursConversation`, `sendRatingWidget`, and `chatBotConversation` are always copied from the request. Omitting any of them resets it to `false`.\n\nNote that when terminating with `sendRatingWidget=true`, the server also moves `assignedTo` to `lastAssignedAgent`, sets `expectingRating=true`, and triggers the rating widget.\n",
        "operationId": "terminateChatParticipantChat",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatParticipant"
              },
              "example": {
                "id": "eb326385-70b2-4561-9b3a-123456789abc",
                "firstName": "John",
                "lastName": "Doe",
                "fullName": "John Doe",
                "phoneNumber": "27821234567",
                "email": "john.doe@example.com",
                "subject": "Billing Inquiry",
                "team": "Support Team",
                "whatsAppClientNumber": "+27123456789",
                "conversationClosed": true,
                "missedConversation": false,
                "afterHoursConversation": false,
                "chatBotConversation": true,
                "sendRatingWidget": false,
                "clientRef": "Growthpoint",
                "createdTime": "2026-01-15T08:00:00Z",
                "lastMessageTime": "2026-01-15T10:35:00Z",
                "customerLastMessageTime": "2026-01-15T10:30:00Z",
                "channel": "WHATSAPP",
                "conversationStatus": "OPEN",
                "sender": "+27821234567",
                "assignedTo": {
                  "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc"
                },
                "lastAssignedAgent": {
                  "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc"
                },
                "openedBy": "agent@example.com",
                "terminatedBy": "agent@example.com",
                "unread": true,
                "rated": false,
                "expectingRating": false,
                "companyName": "Acme Corp",
                "accountNumber": "ACC-001234",
                "activeFlow": "main_support_flow",
                "nodeName": "Welcome Node",
                "botName": "Support Bot",
                "timezone": "Africa/Johannesburg",
                "gstn": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                "ctn": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated chat participant object reflecting the new conversation state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatParticipant"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/sendMessageWhatsapp": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Send WhatsApp agent reply",
        "deprecated": true,
        "description": "**Deprecated.** Use the unified [Send an agent message (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendmessagev2) with `channel: WHATSAPP` — one endpoint covers all channels, takes a lean request, and returns a lean `MessageResponse`. This endpoint takes the full internal message entity and is retained only for existing integrations.\n\nSend a WhatsApp message from an agent to a customer (routes via WhatsApp API).",
        "operationId": "sendAgentMessageWhatsapp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Message"
              },
              "example": {
                "tempId": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
                "agent": {
                  "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc",
                  "email": "agent@example.com",
                  "password": "********",
                  "tempPassword": "********",
                  "role": "CLIENT",
                  "liveChatRole": "AGENT",
                  "primaryEmailAddress": "agent@example.com",
                  "mobileNumber": "+27821234567",
                  "sentLowerCreditLimitMail": false,
                  "sentZeroCreditMail": false,
                  "apiKey": "64a1b2c3d4e5f67890abcdef",
                  "disabled": false,
                  "deleted": false,
                  "emailVerificationKey": null,
                  "passwordResetKey": null,
                  "inactivityNodeId": "node-inactivity-001",
                  "publicHolidayInactivityNodeId": "node-holiday-001",
                  "officeClosedInactivityNodeId": "node-closed-001",
                  "autoResponseNodeId": "node-auto-001",
                  "client": {
                    "id": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
                    "clientRef": "Growthpoint",
                    "accountType": "Postpaid",
                    "countryCode": "ZA",
                    "countryTimezone": "Africa/Johannesburg",
                    "pricingModel": "PMP",
                    "clientPlatformCharge": 0.1,
                    "clientNotificationCharge": 0.35,
                    "clientSession24HourCharge": 0.35,
                    "clientConversationCharge": 0.35,
                    "userInitiatedConversationCharge": 0.2,
                    "businessInitiatedConversationCharge": 1.25,
                    "clientWhatsAppBalance": 1000,
                    "clientSMSBalance": 10,
                    "primaryEmailAddress": "admin@example.com",
                    "secondaryEmailAddress": "backup@example.com",
                    "clientEmailAddress": "client@example.com",
                    "upperNotificationLimit": 100,
                    "lowerNotificationLimit": 10,
                    "upperNotificationLimitMailSent": false,
                    "lowerNotificationLimitMailSent": false,
                    "zeroBalanceNotificationMailSent": false,
                    "lastUpperNotificationMailSentTime": "2026-01-15T10:30:00+02:00",
                    "lastLowerNotificationMailSentTime": "2026-01-20T14:00:00+02:00",
                    "lastZeroBalanceNotificationMailSentTime": null,
                    "smsMode": "fallback",
                    "smsFallback": true,
                    "smsUserId": "support@ecommunicate.co.za",
                    "smsPassword": "********",
                    "smsClientRef": "ecomtest1",
                    "reseller": false,
                    "parentClient": null,
                    "license": null,
                    "useParentNumber": false,
                    "useParentCredit": false,
                    "userInitiatedConversationBalance": 100,
                    "businessInitiatedConversationBalance": 973,
                    "popiaComplianceEnabled": true,
                    "eligible1000Free": true,
                    "splitConversation": true,
                    "monthlyFundAllocation": true,
                    "monthlyBusinessInitiatedBalanceAllocation": 1000,
                    "monthlyUserInitiatedBalanceAllocation": 100,
                    "useApi": true,
                    "headerKeyPairsJson": "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]"
                  },
                  "clientRef": null,
                  "ticketCount": 5,
                  "lastSeen": null,
                  "resetPasswordEmailSent": false,
                  "emailVerified": false,
                  "firstName": "Jane",
                  "lastName": "Doe",
                  "agentChatLimit": 5,
                  "availabilityStatus": true,
                  "initialPassword": false,
                  "tempAccount": false,
                  "loginToken": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                  "validToken": false,
                  "avatar": "https://example.com/avatars/jane.jpg",
                  "shouldGetNotifications": true,
                  "applicationKey": "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012",
                  "userId": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
                  "applicationClientId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                  "allowedSharedInbox": true,
                  "allowedUnassignedInbox": true,
                  "assignmentMessage": "Hi, I'm Jane and I'll be assisting you today."
                },
                "chatParticipant": {
                  "id": "eb326385-70b2-4561-9b3a-123456789abc",
                  "firstName": "John",
                  "lastName": "Doe",
                  "fullName": "John Doe",
                  "phoneNumber": "27821234567",
                  "email": "john.doe@example.com",
                  "subject": "Billing Inquiry",
                  "team": "Support Team",
                  "whatsAppClientNumber": "+27123456789",
                  "conversationClosed": false,
                  "missedConversation": false,
                  "afterHoursConversation": false,
                  "chatBotConversation": true,
                  "sendRatingWidget": false,
                  "clientRef": "Growthpoint",
                  "createdTime": "2026-01-15T08:00:00Z",
                  "lastMessageTime": "2026-01-15T10:35:00Z",
                  "customerLastMessageTime": "2026-01-15T10:30:00Z",
                  "channel": "WHATSAPP",
                  "conversationStatus": "OPEN",
                  "sender": "+27821234567",
                  "assignedTo": {
                    "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc"
                  },
                  "openedBy": "agent@example.com",
                  "terminatedBy": "agent@example.com",
                  "unread": true,
                  "rated": false,
                  "expectingRating": false,
                  "companyName": "Acme Corp",
                  "accountNumber": "ACC-001234",
                  "activeFlow": "main_support_flow",
                  "nodeName": "Welcome Node",
                  "botName": "Support Bot",
                  "timezone": "Africa/Johannesburg",
                  "gstn": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                  "ctn": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
                },
                "contentType": "TEXT",
                "direction": "OUTGOING",
                "messageOwner": "agent",
                "receiver": "27123456789",
                "sender": "+27987654321",
                "text": "Here is the information you requested.",
                "userOriginated": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sent message object including delivery metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/sendMessageWithAttachment": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Send agent reply with attachment",
        "deprecated": true,
        "description": "**Deprecated.** Upload media via [Upload media for an agent message (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/uploadmediav2) then send the returned `mediaUrl` with [Send an agent message (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendmessagev2). The two-step flow is channel-agnostic and replaces this WhatsApp-oriented multipart endpoint, which is retained only for existing integrations.\n\nSend a message with a file attachment (image, document, video) from an agent.",
        "operationId": "sendAgentMessageWithAttachment",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "message"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file to attach (image, document, video)."
                  },
                  "message": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              },
              "encoding": {
                "message": {
                  "contentType": "application/json"
                }
              },
              "examples": {
                "sample": {
                  "summary": "Send image with message",
                  "value": {
                    "file": "(binary)",
                    "message": {
                      "tempId": "e894a094-80a4-4c5c-9c7d-3dc6a26974bd",
                      "agent": {
                        "id": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
                        "email": "agent@example.com",
                        "password": "********",
                        "tempPassword": "********",
                        "role": "CLIENT",
                        "liveChatRole": "AGENT",
                        "primaryEmailAddress": "agent@example.com",
                        "mobileNumber": "+27821234567",
                        "sentLowerCreditLimitMail": false,
                        "sentZeroCreditMail": false,
                        "apiKey": "64a1b2c3d4e5f67890abcdef",
                        "disabled": false,
                        "deleted": false,
                        "emailVerificationKey": null,
                        "passwordResetKey": null,
                        "inactivityNodeId": "node-inactivity-001",
                        "publicHolidayInactivityNodeId": "node-holiday-001",
                        "officeClosedInactivityNodeId": "node-closed-001",
                        "autoResponseNodeId": "node-auto-001",
                        "client": {
                          "id": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
                          "clientRef": "Growthpoint",
                          "accountType": "Postpaid",
                          "countryCode": "ZA",
                          "countryTimezone": "Africa/Johannesburg",
                          "pricingModel": "PMP",
                          "clientPlatformCharge": 0.1,
                          "clientNotificationCharge": 0.35,
                          "clientSession24HourCharge": 0.35,
                          "clientConversationCharge": 0.35,
                          "userInitiatedConversationCharge": 0.2,
                          "businessInitiatedConversationCharge": 1.25,
                          "clientWhatsAppBalance": 1000,
                          "clientSMSBalance": 10,
                          "primaryEmailAddress": "admin@example.com",
                          "secondaryEmailAddress": "backup@example.com",
                          "clientEmailAddress": "client@example.com",
                          "upperNotificationLimit": 100,
                          "lowerNotificationLimit": 10,
                          "upperNotificationLimitMailSent": false,
                          "lowerNotificationLimitMailSent": false,
                          "zeroBalanceNotificationMailSent": false,
                          "lastUpperNotificationMailSentTime": "2026-01-15T10:30:00+02:00",
                          "lastLowerNotificationMailSentTime": "2026-01-20T14:00:00+02:00",
                          "lastZeroBalanceNotificationMailSentTime": null,
                          "smsMode": "fallback",
                          "smsFallback": true,
                          "smsUserId": "support@ecommunicate.co.za",
                          "smsPassword": "********",
                          "smsClientRef": "ecomtest1",
                          "reseller": false,
                          "parentClient": null,
                          "license": null,
                          "useParentNumber": false,
                          "useParentCredit": false,
                          "userInitiatedConversationBalance": 100,
                          "businessInitiatedConversationBalance": 973,
                          "popiaComplianceEnabled": true,
                          "eligible1000Free": true,
                          "splitConversation": true,
                          "monthlyFundAllocation": true,
                          "monthlyBusinessInitiatedBalanceAllocation": 1000,
                          "monthlyUserInitiatedBalanceAllocation": 100,
                          "useApi": true,
                          "headerKeyPairsJson": "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]"
                        },
                        "clientRef": null,
                        "ticketCount": 5,
                        "lastSeen": null,
                        "resetPasswordEmailSent": false,
                        "emailVerified": false,
                        "firstName": "Jane",
                        "lastName": "Doe",
                        "agentChatLimit": 5,
                        "availabilityStatus": true,
                        "initialPassword": false,
                        "tempAccount": false,
                        "loginToken": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                        "validToken": false,
                        "avatar": "https://example.com/avatars/jane.jpg",
                        "shouldGetNotifications": true,
                        "applicationKey": "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012",
                        "userId": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
                        "applicationClientId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                        "allowedSharedInbox": true,
                        "allowedUnassignedInbox": true,
                        "assignmentMessage": "Hi, I'm Jane and I'll be assisting you today."
                      },
                      "chatParticipant": {
                        "id": "eb326385-70b2-4561-9b3a-123456789abc",
                        "firstName": "John",
                        "lastName": "Doe",
                        "fullName": "John Doe",
                        "phoneNumber": "27821234567",
                        "email": "john.doe@example.com",
                        "subject": "Billing Inquiry",
                        "team": "Support Team",
                        "whatsAppClientNumber": "+27123456789",
                        "conversationClosed": false,
                        "missedConversation": false,
                        "afterHoursConversation": false,
                        "chatBotConversation": true,
                        "sendRatingWidget": false,
                        "clientRef": "Growthpoint",
                        "createdTime": "2026-01-15T08:00:00Z",
                        "lastMessageTime": "2026-01-15T10:35:00Z",
                        "customerLastMessageTime": "2026-01-15T10:30:00Z",
                        "channel": "WHATSAPP",
                        "conversationStatus": "OPEN",
                        "sender": "+27821234567",
                        "assignedTo": {
                          "id": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
                          "email": "agent@example.com",
                          "password": "********",
                          "tempPassword": "********",
                          "role": "CLIENT",
                          "liveChatRole": "AGENT",
                          "primaryEmailAddress": "agent@example.com",
                          "mobileNumber": "+27821234567",
                          "sentLowerCreditLimitMail": false,
                          "sentZeroCreditMail": false,
                          "apiKey": "64a1b2c3d4e5f67890abcdef",
                          "disabled": false,
                          "deleted": false,
                          "emailVerificationKey": null,
                          "passwordResetKey": null,
                          "inactivityNodeId": "node-inactivity-001",
                          "publicHolidayInactivityNodeId": "node-holiday-001",
                          "officeClosedInactivityNodeId": "node-closed-001",
                          "autoResponseNodeId": "node-auto-001",
                          "client": {
                            "id": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
                            "clientRef": "Growthpoint",
                            "accountType": "Postpaid",
                            "countryCode": "ZA",
                            "countryTimezone": "Africa/Johannesburg",
                            "pricingModel": "PMP",
                            "clientPlatformCharge": 0.1,
                            "clientNotificationCharge": 0.35,
                            "clientSession24HourCharge": 0.35,
                            "clientConversationCharge": 0.35,
                            "userInitiatedConversationCharge": 0.2,
                            "businessInitiatedConversationCharge": 1.25,
                            "clientWhatsAppBalance": 1000,
                            "clientSMSBalance": 10,
                            "primaryEmailAddress": "admin@example.com",
                            "secondaryEmailAddress": "backup@example.com",
                            "clientEmailAddress": "client@example.com",
                            "upperNotificationLimit": 100,
                            "lowerNotificationLimit": 10,
                            "upperNotificationLimitMailSent": false,
                            "lowerNotificationLimitMailSent": false,
                            "zeroBalanceNotificationMailSent": false,
                            "lastUpperNotificationMailSentTime": "2026-01-15T10:30:00+02:00",
                            "lastLowerNotificationMailSentTime": "2026-01-20T14:00:00+02:00",
                            "lastZeroBalanceNotificationMailSentTime": null,
                            "smsMode": "fallback",
                            "smsFallback": true,
                            "smsUserId": "support@ecommunicate.co.za",
                            "smsPassword": "********",
                            "smsClientRef": "ecomtest1",
                            "reseller": false,
                            "parentClient": null,
                            "license": null,
                            "useParentNumber": false,
                            "useParentCredit": false,
                            "userInitiatedConversationBalance": 100,
                            "businessInitiatedConversationBalance": 973,
                            "popiaComplianceEnabled": true,
                            "eligible1000Free": true,
                            "splitConversation": true,
                            "monthlyFundAllocation": true,
                            "monthlyBusinessInitiatedBalanceAllocation": 1000,
                            "monthlyUserInitiatedBalanceAllocation": 100,
                            "useApi": true,
                            "headerKeyPairsJson": "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]"
                          },
                          "clientRef": null,
                          "ticketCount": 5,
                          "lastSeen": null,
                          "resetPasswordEmailSent": false,
                          "emailVerified": false,
                          "firstName": "Jane",
                          "lastName": "Doe",
                          "agentChatLimit": 5,
                          "availabilityStatus": true,
                          "initialPassword": false,
                          "tempAccount": false,
                          "loginToken": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                          "validToken": false,
                          "avatar": "https://example.com/avatars/jane.jpg",
                          "shouldGetNotifications": true,
                          "applicationKey": "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012",
                          "userId": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
                          "applicationClientId": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
                          "allowedSharedInbox": true,
                          "allowedUnassignedInbox": true,
                          "assignmentMessage": "Hi, I'm Jane and I'll be assisting you today."
                        },
                        "openedBy": "agent@example.com",
                        "terminatedBy": "agent@example.com",
                        "unread": true,
                        "rated": false,
                        "expectingRating": false,
                        "companyName": "Acme Corp",
                        "accountNumber": "ACC-001234",
                        "activeFlow": "main_support_flow",
                        "nodeName": "Welcome Node",
                        "botName": "Support Bot",
                        "timezone": "Africa/Johannesburg",
                        "gstn": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                        "ctn": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
                      },
                      "channel": "WHATSAPP",
                      "direction": "OUTGOING",
                      "text": "img5.png",
                      "contentType": "MEDIA",
                      "userOriginated": true,
                      "messageOwner": "agent"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sent message object with attachment metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/sendTypingIndicator": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Send typing indicator (Chat)",
        "deprecated": true,
        "description": "**Deprecated.** Use [Send typing indicator (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendtypingindicatorv2), which resolves sender/recipient from the participant (you pass only `participantId`). Retained only for existing integrations.\n\nShow a typing indicator to the customer from the chat agent.",
        "operationId": "sendChatTypingIndicator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TypingIndicatorRequest"
              },
              "example": {
                "senderNumber": "+27123456789",
                "recipientNumber": "+27811234567",
                "messageId": "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the typing indicator was sent to the customer"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/pl4chat-service/Message/markReadByAgent": {
      "post": {
        "tags": [
          "Live Chat"
        ],
        "summary": "Mark message as read by agent",
        "deprecated": true,
        "description": "**Deprecated.** Use [Mark a conversation as read (v2)](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/markasreadv2), which clears the unread badge and sends the read receipt for the participant in one call. Retained for existing integrations.\n\nMark a specific message as read by the agent (sends read receipt to customer).",
        "operationId": "markReadByAgent",
        "parameters": [
          {
            "name": "messageId",
            "in": "query",
            "required": true,
            "description": "The ID of the message to mark as read.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation that the message was marked as read and a read receipt was sent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/whatsapp-api-service/SMSSendReceiveMessages/getSMSSendReceiveMessagesForCurrentLoginUser": {
      "get": {
        "tags": [
          "SMS Reports"
        ],
        "summary": "Get SMS messages",
        "description": "Retrieve a paginated list of sent and received SMS messages. Filter by direction, sending mode, and search string.",
        "operationId": "getSMSMessages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 20,
              "example": 20,
              "examples": [
                20
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "description": "Filter by message direction (OUTGOING or INCOMING).",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "OUTGOING",
                "INCOMING"
              ],
              "example": "OUTGOING",
              "examples": [
                "OUTGOING"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Filter by sending mode (DIRECT for standalone SMS, FALLBACK for WhatsApp-to-SMS fallback).",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "DIRECT",
                "FALLBACK"
              ],
              "example": "DIRECT",
              "examples": [
                "DIRECT"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of SMS messages matching the specified filters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SMSSendReceiveMessage"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "size": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    },
                    "number": {
                      "type": "integer",
                      "example": 0,
                      "examples": [
                        0
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getXlsxReportFor/notification-report.xlsx": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download notification report (XLSX)",
        "description": "Download a notification (template) message report as an Excel spreadsheet. Filter by date range, search string, template name, and delivery status.",
        "operationId": "downloadNotificationReportXlsx",
        "parameters": [
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter by template name.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Integer status code to filter by. -100 = All, -1 = Accepted, 0 = Sent, 4 = Invalid, 22 = Blacklisted, 23 = Blocked, 46 = Queued, 47 = Delivered, 48 = Read, 54 = None WhatsApp Number, 56 = Failed, 58 = Duplicate, 59 = Sender Not Connected, 60 = WhatsApp Lite Server not available, 62 = Scheduled, 130429 = Rate Limit Hit, 131026 = Message Undeliverable.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "enum": [
                -100,
                -1,
                0,
                4,
                22,
                23,
                46,
                47,
                48,
                54,
                56,
                58,
                59,
                60,
                62,
                130429,
                131026
              ],
              "example": 47,
              "examples": [
                47,
                0,
                56
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getCsvReportFor/notification-report.csv": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download notification report (CSV)",
        "description": "Download a notification (template) message report as a CSV file. Filter by date range, search string, template name, and delivery status.",
        "operationId": "downloadNotificationReportCsv",
        "parameters": [
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter by template name.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Integer status code to filter by. -100 = All, -1 = Accepted, 0 = Sent, 4 = Invalid, 22 = Blacklisted, 23 = Blocked, 46 = Queued, 47 = Delivered, 48 = Read, 54 = None WhatsApp Number, 56 = Failed, 58 = Duplicate, 59 = Sender Not Connected, 60 = WhatsApp Lite Server not available, 62 = Scheduled, 130429 = Rate Limit Hit, 131026 = Message Undeliverable.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "enum": [
                -100,
                -1,
                0,
                4,
                22,
                23,
                46,
                47,
                48,
                54,
                56,
                58,
                59,
                60,
                62,
                130429,
                131026
              ],
              "example": 47,
              "examples": [
                47,
                0,
                56
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification report as a CSV file download",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/sendXlsxReportByEmail/notification-report.xlsx": {
      "post": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Email notification report",
        "description": "Generate a notification report and send it as an XLSX email attachment to the specified email address. Filter by date range, search string, template name, and delivery status.",
        "operationId": "emailNotificationReport",
        "parameters": [
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter by template name.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Integer status code to filter by. -100 = All, -1 = Accepted, 0 = Sent, 4 = Invalid, 22 = Blacklisted, 23 = Blocked, 46 = Queued, 47 = Delivered, 48 = Read, 54 = None WhatsApp Number, 56 = Failed, 58 = Duplicate, 59 = Sender Not Connected, 60 = WhatsApp Lite Server not available, 62 = Scheduled, 130429 = Rate Limit Hit, 131026 = Message Undeliverable.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "enum": [
                -100,
                -1,
                0,
                4,
                22,
                23,
                46,
                47,
                48,
                54,
                56,
                58,
                59,
                60,
                62,
                130429,
                131026
              ],
              "example": 47,
              "examples": [
                47,
                0,
                56
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "example": "reports@example.com",
                    "examples": [
                      "reports@example.com"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the notification report was emailed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Report sent successfully",
                      "examples": [
                        "Report sent successfully"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getXlsReportFor/interaction-report.xlsx": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download interaction report (XLSX)",
        "description": "Download an interaction (session) message report as an Excel spreadsheet. Filter by date range and search string.",
        "operationId": "downloadInteractionReport",
        "parameters": [
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Interaction report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getXlsReportFor/summary-mau-report.xlsx": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download MAU summary report",
        "description": "Download a Monthly Active Users (MAU) summary report as an Excel spreadsheet. Shows conversation counts and costs aggregated by month.",
        "operationId": "downloadMAUSummaryReport",
        "parameters": [
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MAU summary report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getXlsReportFor/client-summary-mau-report.xlsx": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download client MAU summary report",
        "description": "Download a Monthly Active Users (MAU) summary report for a specific client as an Excel spreadsheet. Optionally filter by client reference.",
        "operationId": "downloadClientMAUSummaryReport",
        "parameters": [
          {
            "name": "clientRef",
            "in": "query",
            "description": "Filter by client reference identifier.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Client MAU summary report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/Excel/getXlsReportFor/detailed-mau-report.xlsx": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download detailed MAU report",
        "description": "Download a detailed Monthly Active Users (MAU) report as an Excel spreadsheet. Includes per-conversation breakdown with costs. Optionally filter by client reference and WhatsApp number.",
        "operationId": "downloadDetailedMAUReport",
        "parameters": [
          {
            "name": "clientRef",
            "in": "query",
            "description": "Filter by client reference identifier.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          },
          {
            "name": "clientWhatsAppNumber",
            "in": "query",
            "description": "Filter by your business WhatsApp number.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed MAU report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/getMessageAuditReport": {
      "get": {
        "tags": [
          "Message Reports"
        ],
        "summary": "Get message audit report",
        "description": "Retrieve a paginated audit report of WhatsApp conversations. Includes conversation category, cost, and message counts. Filter by client reference, conversation category, and date range.",
        "operationId": "getMessageAuditReport",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientRef",
            "in": "query",
            "description": "Your unique client reference identifier.",
            "schema": {
              "type": "string",
              "example": "Growthpoint",
              "examples": [
                "Growthpoint"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Filter by conversation billing category.",
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "USER_INITIATED",
                "BUSINESS_INITIATED",
                "AUTHENTICATION",
                "AUTHENTICATION_INTERNATIONAL",
                "MARKETING",
                "MARKETING_LITE",
                "UTILITY",
                "SERVICE",
                "REFERRAL_CONVERSATION",
                "UNKNOWN"
              ],
              "example": "MARKETING",
              "examples": [
                "MARKETING",
                "UTILITY",
                "AUTHENTICATION"
              ]
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the report (format \"yyyy-MM-dd\").",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-01",
              "examples": [
                "2026-01-01"
              ]
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the report (format \"yyyy-MM-dd\").",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-31",
              "examples": [
                "2026-01-31"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated audit report with conversation category, cost, and message counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/downloadMessageAuditReport": {
      "get": {
        "tags": [
          "Report Downloads"
        ],
        "summary": "Download message audit report (XLSX)",
        "description": "Download the message audit report as an Excel spreadsheet. Includes conversation category, cost, and message counts for the specified date range.",
        "operationId": "downloadMessageAuditReport",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Start date for the report (format \"yyyy-MM-dd\").",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-01",
              "examples": [
                "2026-01-01"
              ]
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "End date for the report (format \"yyyy-MM-dd\").",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-31",
              "examples": [
                "2026-01-31"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message audit report as an Excel (XLSX) file download",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/resendSelectedMessages": {
      "post": {
        "tags": [
          "Resend Messages"
        ],
        "summary": "Resend selected messages",
        "description": "Resend specific failed messages by their IDs.",
        "operationId": "resendSelectedMessages",
        "parameters": [
          {
            "name": "senderNumber",
            "in": "query",
            "description": "Sender WhatsApp number (optional filter).",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                  "examples": [
                    "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
                  ]
                },
                "description": "List of message IDs to resend."
              },
              "example": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
                "b2c3d4e5-f6a1-8901-b2c3-d4e5f6a18901"
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the resend was initiated for the selected messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Resend initiated for 2 messages",
                      "examples": [
                        "Resend initiated for 2 messages"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppSendReceiveMessages/resendAllMessages": {
      "post": {
        "tags": [
          "Resend Messages"
        ],
        "summary": "Resend all failed messages",
        "description": "Resend all failed messages matching the given filters (date range, template, status).",
        "operationId": "resendAllMessages",
        "parameters": [
          {
            "name": "senderNumber",
            "in": "query",
            "description": "Filter by sender WhatsApp number.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "required": true,
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "required": true,
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "templateName",
            "in": "query",
            "description": "Filter by template name.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "marketing_promo_01",
              "examples": [
                "marketing_promo_01"
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number or message content.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "example": "john",
              "examples": [
                "john"
              ]
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Filter by client UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by message delivery status code.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "example": 1,
              "examples": [
                1
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation that the resend was initiated for all matching failed messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Resend initiated for all matching messages",
                      "examples": [
                        "Resend initiated for all matching messages"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get all contacts",
        "description": "Retrieve a paginated list of customer contacts stored in your account.",
        "operationId": "getContacts_inbox",
        "responses": {
          "200": {
            "description": "List of all customer contacts for the authenticated client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create a contact",
        "description": "Add a new customer contact with phone number and name. The contact is associated with the authenticated client.",
        "operationId": "createContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              },
              "example": {
                "fullName": "John Doe",
                "jid": "27821234567"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The newly created contact object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/contacts/{id}": {
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Currently only the `fullName` field can be updated.",
        "operationId": "updateContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique contact UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              },
              "example": {
                "fullName": "John Doe Updated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated contact object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Permanently delete a contact by its ID.",
        "operationId": "deleteContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique contact UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Confirmation of successful contact deletion"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlockedNumber/getForCurrentLoginUser": {
      "get": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Get blocked numbers",
        "description": "Numbers blocked by the system (e.g. due to delivery failures or user opt-out).",
        "operationId": "getBlockedNumbers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of system-blocked phone numbers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsAppBlockedNumber"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlockedNumber/unblockNumber/{whatsAppBlockedNumber}": {
      "delete": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Unblock a number",
        "description": "Remove a number from the blocked list, allowing messages to be sent to it again.",
        "operationId": "unblockNumber",
        "parameters": [
          {
            "name": "whatsAppBlockedNumber",
            "in": "path",
            "required": true,
            "description": "The phone number to unblock",
            "schema": {
              "type": "string",
              "example": "+27821234567",
              "examples": [
                "+27821234567"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Confirmation that the number was successfully unblocked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlacklistNumber/getForCurrentLoginUser": {
      "get": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Get blacklisted numbers",
        "description": "Numbers manually blacklisted by the client. Messages will not be sent to these numbers.",
        "operationId": "getBlacklistedNumbers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "example": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "description": "Start of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-01T00:00:00+02:00",
              "examples": [
                "2026-01-01T00:00:00+02:00"
              ]
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "description": "End of the date range (ISO 8601 with timezone offset).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-31T23:59:59+02:00",
              "examples": [
                "2026-01-31T23:59:59+02:00"
              ]
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Filter by phone number.",
            "schema": {
              "type": "string",
              "example": "john",
              "examples": [
                "john"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of client-blacklisted phone numbers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsAppBlacklistNumber"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlacklistNumber": {
      "post": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Blacklist a number",
        "description": "Add a phone number to the blacklist. No messages will be sent to this number.",
        "operationId": "blacklistNumber",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlacklistRequestDto"
              },
              "example": {
                "number": "+27821234567",
                "clientNumber": "+27123456789",
                "reason": "Customer requested opt-out"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the number was added to the blacklist"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlacklistNumber/upload": {
      "post": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Blacklist numbers from file",
        "description": "Upload a CSV or text file containing phone numbers to blacklist in bulk.",
        "operationId": "blacklistNumbersUpload",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Summary of the bulk blacklist import showing processed, blacklisted, and skipped counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalProcessed": {
                      "type": "integer",
                      "example": 150,
                      "examples": [
                        150
                      ]
                    },
                    "totalBlacklisted": {
                      "type": "integer",
                      "example": 3,
                      "examples": [
                        3
                      ]
                    },
                    "totalSkipped": {
                      "type": "integer",
                      "example": 5,
                      "examples": [
                        5
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/WhatsAppBlacklistNumber/{id}": {
      "delete": {
        "tags": [
          "Block & Blacklist"
        ],
        "summary": "Remove from blacklist",
        "description": "Remove a phone number from the client-managed blacklist by its record ID.",
        "operationId": "removeFromBlacklist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique blacklist record UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Confirmation that the number was successfully removed from the blacklist"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "WebSocket Connection (QR Stream)",
        "description": "**Protocol:** `WSS` (WebSocket Secure)\n\nEstablish a WebSocket connection to receive real-time QR code updates.\n\n**Incoming Message Format (Regex):**\n```\n/userId=(.+?), sessionStatus=(.+?), status=(.+?)(?:, qrCode=(.+?))?(?:\\))/\n```\n\n**States:**\n- `newQrCode` — `qrCode` contains Base64 image.\n- `success` — Phone connected.\n- `timeout` — QR code expired.\n",
        "operationId": "connectWebSocket",
        "servers": [
          {
            "url": "wss://api.payless4messaging.com",
            "description": "Live WebSocket"
          }
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "description": "Composite key: `{clientId}-{phoneNumber}` (remove `+` from phone).",
            "required": true,
            "schema": {
              "type": "string",
              "example": "dbdb8809-6fd0-27665359699",
              "examples": [
                "dbdb8809-6fd0-27665359699"
              ]
            }
          }
        ],
        "responses": {
          "101": {
            "description": "Connection established",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "userId=dbdb8809-27665359699, sessionStatus=newQrCode, status=200, qrCode=base64...",
                  "examples": [
                    "userId=dbdb8809-27665359699, sessionStatus=newQrCode, status=200, qrCode=base64..."
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/connect": {
      "post": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Initialize session",
        "description": "Initializes a WhatsApp session. After calling this, connect to the WebSocket to receive the QR code.\n",
        "operationId": "connectSession",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionRequest"
              },
              "example": {
                "whatsAppNumber": "+27665359699",
                "clientId": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the session was initialized; connect to WebSocket for QR code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/webhook": {
      "post": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Set webhook (WhatsApp Lite)",
        "description": "Register a webhook URL to receive incoming messages and events for a WhatsApp Lite number.",
        "operationId": "setLiteWebhook",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookReq"
              },
              "example": {
                "whatsAppNumber": "+27123456789",
                "webhook": "https://yourserver.com/webhooks/whatsapp-lite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the webhook URL was registered for the WhatsApp Lite number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/qr": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Get QR code (static)",
        "description": "Retrieve the current QR code as a Base64 string if WebSocket method is not used.",
        "operationId": "getQRCode",
        "parameters": [
          {
            "name": "whatsAppNumber",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "+27665359699",
              "examples": [
                "+27665359699"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The current QR code as a Base64-encoded image string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/pairing-code": {
      "post": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Request pairing code",
        "description": "Generates an 8-character linking code for the \"Link with phone number\" option.",
        "operationId": "requestPairingCode",
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string",
                "example": "+27665359699",
                "examples": [
                  "+27665359699"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The generated 8-character pairing code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/status": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Get session status",
        "description": "Check the current connection status of a WhatsApp Lite session. Returns whether the number is connected, disconnected, or requires a QR scan.",
        "operationId": "getSessionStatus",
        "parameters": [
          {
            "name": "whatsAppNumber",
            "in": "query",
            "required": true,
            "description": "The WhatsApp Lite phone number to check.",
            "schema": {
              "type": "string",
              "example": "+27665359699",
              "examples": [
                "+27665359699"
              ]
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Optional client UUID to scope the status check.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current session connection status (connected, disconnected, or requires QR scan)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/logout": {
      "post": {
        "tags": [
          "(WhatsApp Lite) Connection"
        ],
        "summary": "Logout session",
        "description": "Logs the number out of WhatsApp Web/Multi-device session.",
        "operationId": "logoutSession",
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string",
                "example": "+27665359699",
                "examples": [
                  "+27665359699"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the session was logged out successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-api-service/api/whatsapp-go/session/contacts": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Contacts"
        ],
        "summary": "Get contacts",
        "description": "Retrieve contacts synced from the connected phone.",
        "operationId": "getContacts",
        "parameters": [
          {
            "name": "whatsAppNumber",
            "in": "query",
            "required": true,
            "description": "The WhatsApp Lite phone number to retrieve contacts for.",
            "schema": {
              "type": "string",
              "example": "+27665359699",
              "examples": [
                "+27665359699"
              ]
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Optional client UUID.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
              "examples": [
                "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of contacts synced from the connected WhatsApp device",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppGoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Get all groups",
        "description": "Retrieve all WhatsApp groups for the authenticated WhatsApp Lite account.",
        "operationId": "getGroups",
        "responses": {
          "200": {
            "description": "List of all WhatsApp groups for the authenticated account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Group"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Create a group",
        "description": "Create a new WhatsApp group with a name, description, and initial participants.",
        "operationId": "createGroup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Group"
              },
              "example": {
                "groupName": "Team Chat",
                "groupTopic": "Project discussions and updates",
                "number": "+27123456789",
                "countryCode": "ZA"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The newly created WhatsApp group object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups/{id}": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Get group by ID",
        "description": "Retrieve details of a specific WhatsApp group by its UUID.",
        "operationId": "getGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The WhatsApp group JID (e.g., \"120363001234567890@g.us\").",
            "schema": {
              "type": "string",
              "example": "120363001234567890@g.us",
              "examples": [
                "120363001234567890@g.us"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The WhatsApp group object with all its details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Update group",
        "description": "Update a WhatsApp group's name, description, or participant list.\n\n**Important:** This endpoint performs a full entity save. You must include **all** fields in the request body. Any omitted fields will be set to `null`. Fetch the group with `GET /payless4messaging-service/WhatsApp/api/v1/groups/{id}` first and send the complete object back with your changes applied.\n",
        "operationId": "updateGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The WhatsApp group JID.",
            "schema": {
              "type": "string",
              "example": "120363001234567890@g.us",
              "examples": [
                "120363001234567890@g.us"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Group"
              },
              "example": {
                "id": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
                "groupJID": "120363045678901234@g.us",
                "groupName": "Team Chat Updated",
                "groupTopic": "Updated project discussions",
                "number": "+27123456789",
                "countryCode": "ZA",
                "locked": false,
                "announce": false,
                "memberAddMode": "all_member_add",
                "pinned": false,
                "archive": false,
                "joinNodeId": null,
                "leaveNodeId": null,
                "clientRef": "Growthpoint"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmation that the WhatsApp group was updated successfully"
          }
        }
      },
      "delete": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Delete group",
        "description": "Leave and remove a WhatsApp group.",
        "operationId": "deleteGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The WhatsApp group JID.",
            "schema": {
              "type": "string",
              "example": "120363001234567890@g.us",
              "examples": [
                "120363001234567890@g.us"
              ]
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": true,
            "description": "The WhatsApp Lite phone number that is a member of the group.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation that the group was successfully left and removed"
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups/messages": {
      "post": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Send group message",
        "description": "Send a text or media message to a WhatsApp group.",
        "operationId": "sendGroupMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupMessage"
              },
              "example": {
                "groupId": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
                "senderNumber": "+27123456789",
                "message": "Meeting at 3pm today.",
                "contentType": "TEXT",
                "direction": "OUTGOING",
                "channel": "WHATSAPP",
                "mediaUrl": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sent group message object with delivery metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupMessage"
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups/{groupId}/messages": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Get group messages",
        "description": "Retrieve the message history for a specific WhatsApp group with pagination.",
        "operationId": "getGroupMessages",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "description": "The WhatsApp group JID.",
            "schema": {
              "type": "string",
              "example": "120363001234567890@g.us",
              "examples": [
                "120363001234567890@g.us"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Zero-based page index.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 0,
              "examples": [
                0
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records per page.",
            "schema": {
              "type": "integer",
              "default": 20,
              "example": 20,
              "examples": [
                20
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of messages for the specified WhatsApp group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GroupMessage"
                      }
                    },
                    "totalElements": {
                      "type": "integer",
                      "example": 100,
                      "examples": [
                        100
                      ]
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 10,
                      "examples": [
                        10
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups/{groupJID}/invite-link": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Get group invite link",
        "description": "Generate or retrieve the invite link for a WhatsApp group. Share this link to allow others to join the group.",
        "operationId": "getGroupInviteLink",
        "parameters": [
          {
            "name": "groupJID",
            "in": "path",
            "required": true,
            "description": "The WhatsApp group JID.",
            "schema": {
              "type": "string",
              "example": "120363001234567890@g.us",
              "examples": [
                "120363001234567890@g.us"
              ]
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": true,
            "description": "The WhatsApp Lite phone number that is an admin of the group.",
            "schema": {
              "type": "string",
              "example": "+27123456789",
              "examples": [
                "+27123456789"
              ]
            }
          },
          {
            "name": "reset",
            "in": "query",
            "description": "Set to true to revoke the current invite link and generate a new one.",
            "schema": {
              "type": "boolean",
              "default": false,
              "example": false,
              "examples": [
                false
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The group invite link URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inviteLink": {
                      "type": "string",
                      "example": "https://chat.whatsapp.com/AbCdEfGhIjKlMn",
                      "examples": [
                        "https://chat.whatsapp.com/AbCdEfGhIjKlMn"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payless4messaging-service/WhatsApp/api/v1/groups/{id}/summary-settings": {
      "get": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Get group AI summary settings",
        "description": "Read a group's AI summary settings. A group that was never set up returns the defaults, switched off.\n\n`available` says whether AI summaries are switched on for your account. They are switched on by\neCommunicate support; while `available` is `false`, saving settings returns `403`.\n\nThe API key is never returned; `hasApiKey` says whether one is saved.\n",
        "operationId": "getGroupSummarySettings",
        "parameters": [
          {
            "$ref": "#/components/parameters/GroupSummaryGroupId"
          }
        ],
        "responses": {
          "200": {
            "description": "The group's AI summary settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSummarySettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "put": {
        "tags": [
          "(WhatsApp Lite) Groups"
        ],
        "summary": "Save group AI summary settings",
        "description": "Switch AI summaries on or off for a group and choose when and where they are sent.\n\n**How it works.** When nobody has written in the group for `quietMinutes`, eCommunicate's AI summarises\nthe messages since the last summary (issues raised, how they were resolved, action items) and `POST`s the\nsummary to `webhookUrl`. See the **Callbacks** section below for the request your API receives.\n\n- Summaries start from the moment you switch them on; messages from before that are never summarised.\n- A conversation with fewer than `minMessages` messages waits for more; its messages are included in the\n  group's next summary. Set `sendShortAfterHours` to summarise it anyway once its first message is that\n  many hours old, so a lone announcement isn't held back. `null` waits for more messages indefinitely.\n- For groups that are rarely quiet, `longMode` also ends a conversation after `longLimit` hours since\n  its first unsummarised message (`MAX_HOURS`) or after `longLimit` messages (`MAX_MESSAGES`).\n- Only WhatsApp Lite groups can be summarised. Messages are only stored for groups eCommunicate knows\n  about, so import groups your number was already in before setting this up.\n\n**Saving replaces every setting**, so send all fields. The one exception is `webhookApiKey`: leave it\nout, or send it blank, to keep the saved key. Send `removeWebhookApiKey: true` to delete the saved key.\n\n`webhookUrl` must be `https://` and reachable on the internet. `localhost` and private, loopback and\nlink-local addresses are refused. Switching summaries on requires `webhookUrl`. The `webhookApiKey` is\noptional; without one, summaries are sent with no `Authorization` header.\n",
        "operationId": "saveGroupSummarySettings",
        "parameters": [
          {
            "$ref": "#/components/parameters/GroupSummaryGroupId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupSummarySettingsRequest"
              },
              "examples": {
                "Switch on, plain text": {
                  "value": {
                    "enabled": true,
                    "quietMinutes": 30,
                    "format": "TEXT",
                    "longMode": "NONE",
                    "longLimit": null,
                    "minMessages": 3,
                    "sendShortAfterHours": 24,
                    "webhookUrl": "https://api.example.com/group-summaries",
                    "webhookApiKey": "sk_live_4f9a2c7e1b"
                  }
                },
                "JSON, capped at 4 hours, keep the saved key": {
                  "value": {
                    "enabled": true,
                    "quietMinutes": 60,
                    "format": "JSON",
                    "longMode": "MAX_HOURS",
                    "longLimit": 4,
                    "minMessages": 3,
                    "sendShortAfterHours": null,
                    "webhookUrl": "https://api.example.com/group-summaries"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupSummarySettings"
                }
              }
            }
          },
          "400": {
            "description": "A value is out of range, `webhookUrl` isn't a public `https://` address, or summaries were switched on\nwithout both an address and a key. The message says which.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Bad Request",
                      "examples": [
                        "Bad Request"
                      ]
                    },
                    "status": {
                      "type": "integer",
                      "example": 400,
                      "examples": [
                        400
                      ]
                    },
                    "detail": {
                      "type": "string",
                      "example": "Your API's address must start with https://",
                      "examples": [
                        "Your API's address must start with https://"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "AI summaries aren't switched on for your account. Contact eCommunicate support.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Forbidden",
                      "examples": [
                        "Forbidden"
                      ]
                    },
                    "status": {
                      "type": "integer",
                      "example": 403,
                      "examples": [
                        403
                      ]
                    },
                    "detail": {
                      "type": "string",
                      "example": "Group chat summaries aren't switched on for your account. Contact support to turn them on.",
                      "examples": [
                        "Group chat summaries aren't switched on for your account. Contact support to turn them on."
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "callbacks": {
          "groupSummary": {
            "{$request.body#/webhookUrl}": {
              "post": {
                "tags": [
                  "(WhatsApp Lite) Groups"
                ],
                "summary": "Group summary sent to your API",
                "description": "Sent to your `webhookUrl` each time a group conversation ends and has been summarised.\n\n**Authentication.** If you saved a `webhookApiKey`, the `Authorization` header carries it exactly\nas you typed it (no `Bearer` prefix is added); reject requests that don't carry it. With no key\nsaved, the header is left out.\n\n**Answer with any `2xx`** once you have stored the summary. Anything else, a timeout (10 seconds)\nor a connection failure is retried after 1, 5 and 30 minutes; after 4 attempts the summary is not\nsent again. Redirects are not followed, so a `3xx` counts as a failure.\n\n**Duplicates.** A retry after a timeout you did process sends the same summary again. Use\n`X-Idempotency-Key` (equal to `summaryId`) to ignore it.\n\nSummaries of one group arrive in order, but don't rely on it: sort by `windowEnd`.\n",
                "operationId": "receiveGroupSummary",
                "security": [
                  {
                    "groupSummaryWebhookKey": []
                  }
                ],
                "parameters": [
                  {
                    "name": "X-Idempotency-Key",
                    "in": "header",
                    "required": true,
                    "description": "The summary's id. The same value on every retry of one summary.",
                    "schema": {
                      "type": "string",
                      "format": "uuid",
                      "example": "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04",
                      "examples": [
                        "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04"
                      ]
                    }
                  }
                ],
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/GroupSummaryDelivery"
                      },
                      "examples": {
                        "Plain text": {
                          "value": {
                            "summaryId": "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04",
                            "clientRef": "Growthpoint",
                            "groupJid": "120363045678901234@g.us",
                            "groupName": "Printer support",
                            "windowStart": "2026-11-19T07:00:00Z",
                            "windowEnd": "2026-11-19T07:42:13.518Z",
                            "messageCount": 14,
                            "format": "TEXT",
                            "summary": "Issues\n- Printer on floor 3 jammed (raised by Alice): Bob cleared the tray; resolved.\n- Toner low (raised by Carol): Open\n\nAction items\n- Order toner (Facilities)"
                          }
                        },
                        "JSON": {
                          "value": {
                            "summaryId": "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04",
                            "clientRef": "Growthpoint",
                            "groupJid": "120363045678901234@g.us",
                            "groupName": "Printer support",
                            "windowStart": "2026-11-19T07:00:00Z",
                            "windowEnd": "2026-11-19T07:42:13.518Z",
                            "messageCount": 14,
                            "format": "JSON",
                            "summary": {
                              "summary": "The floor 3 printer jammed and was fixed; toner is still low.",
                              "issues": [
                                {
                                  "title": "Printer on floor 3 jammed",
                                  "raisedBy": "Alice",
                                  "resolution": "Bob cleared the paper tray.",
                                  "status": "RESOLVED"
                                },
                                {
                                  "title": "Toner low",
                                  "raisedBy": "Carol",
                                  "resolution": null,
                                  "status": "OPEN"
                                }
                              ],
                              "actionItems": [
                                {
                                  "description": "Order toner",
                                  "owner": "Facilities"
                                }
                              ],
                              "participants": [
                                "Alice",
                                "Bob",
                                "Carol"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "responses": {
                  "2XX": {
                    "description": "Stored. The summary is not sent again."
                  },
                  "4XX": {
                    "description": "Not accepted. Retried, up to 4 attempts in all."
                  },
                  "5XX": {
                    "description": "Not accepted. Retried, up to 4 attempts in all."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apikeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Developer API key provided by eCommunicate."
      },
      "groupSummaryWebhookKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "The `webhookApiKey` you saved in a group's AI summary settings, sent as-is when eCommunicate calls your API. Left out when no key is saved."
      }
    },
    "parameters": {
      "GroupSummaryGroupId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The group's `id` (UUID) from the group list, not its WhatsApp JID.",
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
          "examples": [
            "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789"
          ]
        }
      },
      "AnalyticsStartDate": {
        "name": "startDate",
        "in": "query",
        "required": true,
        "description": "First day of the range (`yyyy-MM-dd`), from 00:00:00.",
        "schema": {
          "type": "string",
          "format": "date",
          "example": "2026-10-02",
          "examples": [
            "2026-10-02"
          ]
        }
      },
      "AnalyticsEndDate": {
        "name": "endDate",
        "in": "query",
        "required": true,
        "description": "Last day of the range (`yyyy-MM-dd`), up to 23:59:59.999. Must not be before `startDate`.",
        "schema": {
          "type": "string",
          "format": "date",
          "example": "2026-10-09",
          "examples": [
            "2026-10-09"
          ]
        }
      },
      "AnalyticsMessageContentType": {
        "name": "messageContentType",
        "in": "query",
        "description": "Count only messages of this content type.",
        "schema": {
          "type": "string",
          "enum": [
            "ALL",
            "TEXT",
            "LOCATION",
            "MEDIA",
            "BUTTON",
            "INTERACTIVE",
            "REACTION",
            "CAROUSEL",
            "USER_ACTION",
            "CONTACT"
          ],
          "default": "ALL",
          "example": "ALL",
          "examples": [
            "ALL"
          ]
        }
      },
      "AnalyticsDirection": {
        "name": "direction",
        "in": "query",
        "description": "Count only messages in this direction.",
        "schema": {
          "type": "string",
          "enum": [
            "ALL",
            "INCOMING",
            "OUTGOING"
          ],
          "default": "ALL",
          "example": "ALL",
          "examples": [
            "ALL"
          ]
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "example": "ERROR",
                  "examples": [
                    "ERROR"
                  ]
                },
                "message": {
                  "type": "string",
                  "example": "Invalid Parameters",
                  "examples": [
                    "Invalid Parameters"
                  ]
                },
                "requestId": {
                  "type": "string",
                  "format": "uuid",
                  "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "examples": [
                    "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "example": "2026-01-15T10:30:00Z",
                  "examples": [
                    "2026-01-15T10:30:00Z"
                  ]
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication failed — the API key sent in the `Authorization` header is missing,\ninvalid, or has been revoked.\n\n**Verify your API key before changing anything else.** Check the key currently active\non your account either in the eCommunicate web UI (API key settings), or by calling\n`POST /payless4messaging-service/WhatsApp/authenticate/retrieveApiKey` with your\naccount credentials — that endpoint needs no existing key, so it works while every\nother call is returning `401`. Compare the result with the value your integration is\nsending: pass the key on its own (no `Bearer` prefix), trimmed of whitespace, as a\n36-character UUID.\n\nDo not retry a `401` — it will fail identically until the key is corrected. See the\n[Authentication guide](../guides/authentication.md#troubleshooting-a-401).\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "example": "ERROR",
                  "examples": [
                    "ERROR"
                  ]
                },
                "message": {
                  "type": "string",
                  "example": "Unauthorized user",
                  "examples": [
                    "Unauthorized user"
                  ]
                },
                "requestId": {
                  "type": "string",
                  "format": "uuid",
                  "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "examples": [
                    "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "example": "2026-01-15T10:30:00Z",
                  "examples": [
                    "2026-01-15T10:30:00Z"
                  ]
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "example": "ERROR",
                  "examples": [
                    "ERROR"
                  ]
                },
                "message": {
                  "type": "string",
                  "example": "Forbidden",
                  "examples": [
                    "Forbidden"
                  ]
                },
                "requestId": {
                  "type": "string",
                  "format": "uuid",
                  "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "examples": [
                    "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "example": "2026-01-15T10:30:00Z",
                  "examples": [
                    "2026-01-15T10:30:00Z"
                  ]
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "example": "ERROR",
                  "examples": [
                    "ERROR"
                  ]
                },
                "message": {
                  "type": "string",
                  "example": "Resource not found",
                  "examples": [
                    "Resource not found"
                  ]
                },
                "requestId": {
                  "type": "string",
                  "format": "uuid",
                  "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "examples": [
                    "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "example": "2026-01-15T10:30:00Z",
                  "examples": [
                    "2026-01-15T10:30:00Z"
                  ]
                }
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "example": "ERROR",
                  "examples": [
                    "ERROR"
                  ]
                },
                "message": {
                  "type": "string",
                  "example": "Resource already exists",
                  "examples": [
                    "Resource already exists"
                  ]
                },
                "requestId": {
                  "type": "string",
                  "format": "uuid",
                  "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
                  "examples": [
                    "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "example": "2026-01-15T10:30:00Z",
                  "examples": [
                    "2026-01-15T10:30:00Z"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Client": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
            "examples": [
              "dbdb8809-6fd0-4cd2-8574-502f0f61a69d"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "accountType": {
            "type": "string",
            "example": "Postpaid",
            "examples": [
              "Postpaid"
            ]
          },
          "countryCode": {
            "type": "string",
            "example": "ZA",
            "examples": [
              "ZA"
            ]
          },
          "countryTimezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "pricingModel": {
            "type": "string",
            "example": "PMP",
            "examples": [
              "PMP"
            ]
          },
          "clientPlatformCharge": {
            "type": [
              "number",
              "null"
            ],
            "example": 0.1,
            "examples": [
              0.1
            ]
          },
          "clientNotificationCharge": {
            "type": "number",
            "example": 0.35,
            "examples": [
              0.35
            ]
          },
          "clientSession24HourCharge": {
            "type": "number",
            "example": 0.35,
            "examples": [
              0.35
            ]
          },
          "clientConversationCharge": {
            "type": "number",
            "example": 0.35,
            "examples": [
              0.35
            ]
          },
          "userInitiatedConversationCharge": {
            "type": [
              "number",
              "null"
            ],
            "example": 0.2,
            "examples": [
              0.2
            ]
          },
          "businessInitiatedConversationCharge": {
            "type": "number",
            "example": 1.25,
            "examples": [
              1.25
            ]
          },
          "clientWhatsAppBalance": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "examples": [
              1000
            ]
          },
          "clientSMSBalance": {
            "type": "number",
            "format": "double",
            "example": 10,
            "examples": [
              10
            ]
          },
          "primaryEmailAddress": {
            "type": [
              "string",
              "null"
            ],
            "example": "admin@example.com",
            "examples": [
              "admin@example.com"
            ]
          },
          "secondaryEmailAddress": {
            "type": [
              "string",
              "null"
            ],
            "example": "backup@example.com",
            "examples": [
              "backup@example.com"
            ]
          },
          "clientEmailAddress": {
            "type": [
              "string",
              "null"
            ],
            "example": "client@example.com",
            "examples": [
              "client@example.com"
            ]
          },
          "upperNotificationLimit": {
            "type": [
              "number",
              "null"
            ],
            "example": 100,
            "examples": [
              100
            ]
          },
          "lowerNotificationLimit": {
            "type": [
              "number",
              "null"
            ],
            "example": 10,
            "examples": [
              10
            ]
          },
          "upperNotificationLimitMailSent": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "lowerNotificationLimitMailSent": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "zeroBalanceNotificationMailSent": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "lastUpperNotificationMailSentTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-15T10:30:00+02:00",
            "examples": [
              "2026-01-15T10:30:00+02:00"
            ]
          },
          "lastLowerNotificationMailSentTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-20T14:00:00+02:00",
            "examples": [
              "2026-01-20T14:00:00+02:00"
            ]
          },
          "lastZeroBalanceNotificationMailSentTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": null,
            "examples": [
              null
            ]
          },
          "smsMode": {
            "type": "string",
            "example": "fallback",
            "examples": [
              "fallback"
            ]
          },
          "smsFallback": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "smsUserId": {
            "type": "string",
            "example": "support@ecommunicate.co.za",
            "examples": [
              "support@ecommunicate.co.za"
            ]
          },
          "smsPassword": {
            "type": "string",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "smsClientRef": {
            "type": "string",
            "example": "ecomtest1",
            "examples": [
              "ecomtest1"
            ]
          },
          "reseller": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "parentClient": {
            "type": [
              "object",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "license": {
            "type": [
              "object",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "useParentNumber": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "useParentCredit": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "userInitiatedConversationBalance": {
            "type": "number",
            "example": 100,
            "examples": [
              100
            ]
          },
          "businessInitiatedConversationBalance": {
            "type": "number",
            "example": 973,
            "examples": [
              973
            ]
          },
          "popiaComplianceEnabled": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "eligible1000Free": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "splitConversation": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "monthlyFundAllocation": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "monthlyBusinessInitiatedBalanceAllocation": {
            "type": "number",
            "example": 1000,
            "examples": [
              1000
            ]
          },
          "monthlyUserInitiatedBalanceAllocation": {
            "type": "number",
            "example": 100,
            "examples": [
              100
            ]
          },
          "useApi": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "headerKeyPairsJson": {
            "type": "string",
            "description": "JSON array of key-value header pairs.",
            "example": "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]",
            "examples": [
              "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]"
            ]
          }
        }
      },
      "ClientDTO": {
        "description": "Lightweight client view returned by read-only endpoints.",
        "$ref": "#/components/schemas/Client"
      },
      "CreateChildClientReq": {
        "type": "object",
        "required": [
          "clientRef",
          "parentClientRef"
        ],
        "properties": {
          "clientRef": {
            "type": "string",
            "example": "MyChildClient",
            "examples": [
              "MyChildClient"
            ]
          },
          "parentClientRef": {
            "type": "string",
            "example": "ParentClient",
            "examples": [
              "ParentClient"
            ]
          },
          "countryCode": {
            "type": "string",
            "example": "ZA",
            "examples": [
              "ZA"
            ]
          },
          "countryTimezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          }
        }
      },
      "ClientResponse": {
        "type": "object",
        "description": "Credential-free view of a client, returned by the v1 client endpoints. The SMS gateway password is never included, and the parent is flattened to `parentClientRef` rather than nested, so a child's payload does not carry the parent's balances.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "clientRef": {
            "type": "string",
            "description": "Groups your records under a business entity. Can be renamed by an administrator, so treat it as a label rather than a durable key.",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "displayName": {
            "type": "string",
            "description": "Trading name shown to your own customers. Falls back to the client reference when unset.",
            "example": "Growthpoint Therapies Inc",
            "examples": [
              "Growthpoint Therapies Inc"
            ]
          },
          "accountType": {
            "type": "string",
            "example": "Prepaid",
            "examples": [
              "Prepaid"
            ]
          },
          "pricingModel": {
            "type": "string",
            "example": "META_PMP",
            "examples": [
              "META_PMP"
            ]
          },
          "clientWhatsAppBalance": {
            "type": "number",
            "format": "double",
            "example": 16112.95,
            "examples": [
              16112.95
            ]
          },
          "userInitiatedConversationBalance": {
            "type": "number",
            "format": "double",
            "example": 20,
            "examples": [
              20
            ]
          },
          "businessInitiatedConversationBalance": {
            "type": "number",
            "format": "double",
            "example": 20,
            "examples": [
              20
            ]
          },
          "clientSMSBalance": {
            "type": "number",
            "format": "double",
            "example": 50.34,
            "examples": [
              50.34
            ]
          },
          "primaryEmailAddress": {
            "type": "string",
            "example": "ops@example.com",
            "examples": [
              "ops@example.com"
            ]
          },
          "secondaryEmailAddress": {
            "type": "string",
            "example": "finance@example.com",
            "examples": [
              "finance@example.com"
            ]
          },
          "clientEmailAddress": {
            "type": "string",
            "example": "support@acme.example",
            "examples": [
              "support@acme.example"
            ]
          },
          "upperNotificationLimit": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "examples": [
              1000
            ]
          },
          "lowerNotificationLimit": {
            "type": "number",
            "format": "double",
            "example": 100,
            "examples": [
              100
            ]
          },
          "countryCode": {
            "type": "string",
            "example": "ZA",
            "examples": [
              "ZA"
            ]
          },
          "countryTimezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "parentClientRef": {
            "type": "string",
            "description": "The parent's client reference, or absent for a top-level client.",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "reseller": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "useParentNumber": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "useParentCredit": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "popiaComplianceEnabled": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "eligible1000Free": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "splitConversation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "useApi": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "monthlyFundAllocation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "monthlyBusinessInitiatedBalanceAllocation": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "monthlyUserInitiatedBalanceAllocation": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "smsMode": {
            "type": "string",
            "example": "fallback",
            "examples": [
              "fallback"
            ]
          },
          "smsFallback": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "smsUserId": {
            "type": "string",
            "description": "The SMS gateway username. The password is never returned.",
            "example": "support@ecommunicate.co.za",
            "examples": [
              "support@ecommunicate.co.za"
            ]
          },
          "smsClientRef": {
            "type": "string",
            "example": "ecomtest1",
            "examples": [
              "ecomtest1"
            ]
          },
          "license": {
            "$ref": "#/components/schemas/ClientLicenseResponse"
          }
        }
      },
      "ClientLicenseResponse": {
        "type": "object",
        "description": "Licence counts recorded against the client.",
        "properties": {
          "totalLicenseAllocated": {
            "type": "integer",
            "format": "int64",
            "example": 10,
            "examples": [
              10
            ]
          },
          "licensesUnallocated": {
            "type": "integer",
            "format": "int64",
            "example": 4,
            "examples": [
              4
            ]
          },
          "licensesUsed": {
            "type": "integer",
            "format": "int64",
            "example": 6,
            "examples": [
              6
            ]
          }
        }
      },
      "CreateChildClientRequest": {
        "type": "object",
        "description": "Anything left blank is inherited from the parent named in the path.",
        "required": [
          "clientRef"
        ],
        "properties": {
          "clientRef": {
            "type": "string",
            "example": "MyChildClient",
            "examples": [
              "MyChildClient"
            ]
          },
          "displayName": {
            "type": "string",
            "example": "My Child Client",
            "examples": [
              "My Child Client"
            ]
          },
          "accountType": {
            "type": "string",
            "example": "Prepaid",
            "examples": [
              "Prepaid"
            ]
          },
          "pricingModel": {
            "type": "string",
            "example": "META_PMP",
            "examples": [
              "META_PMP"
            ]
          },
          "countryCode": {
            "type": "string",
            "example": "ZA",
            "examples": [
              "ZA"
            ]
          },
          "countryTimezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "clientWhatsAppBalance": {
            "type": "number",
            "format": "double",
            "example": 0,
            "examples": [
              0
            ]
          },
          "userInitiatedConversationBalance": {
            "type": "number",
            "format": "double",
            "example": 0,
            "examples": [
              0
            ]
          },
          "businessInitiatedConversationBalance": {
            "type": "number",
            "format": "double",
            "example": 0,
            "examples": [
              0
            ]
          }
        }
      },
      "UpdateSmsFallbackRequest": {
        "type": "object",
        "properties": {
          "smsMode": {
            "type": "string",
            "description": "`disabled`, `fallback`, or `direct`.",
            "example": "fallback",
            "examples": [
              "fallback"
            ]
          },
          "smsFallback": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "smsUserId": {
            "type": "string",
            "example": "support@ecommunicate.co.za",
            "examples": [
              "support@ecommunicate.co.za"
            ]
          },
          "smsPassword": {
            "type": "string",
            "description": "Write-only. Omit or leave blank to keep the stored password; supply a value only to change it.",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "smsClientRef": {
            "type": "string",
            "example": "ecomtest1",
            "examples": [
              "ecomtest1"
            ]
          }
        }
      },
      "UpdatePopiaComplianceRequest": {
        "type": "object",
        "required": [
          "popiaComplianceEnabled"
        ],
        "properties": {
          "popiaComplianceEnabled": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          }
        }
      },
      "WhatsAppClientNumberResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "whatsAppNumber": {
            "$ref": "#/components/schemas/WhatsAppNumber"
          },
          "incomingMessageURL": {
            "type": "string",
            "example": "https://yourserver.com/incoming",
            "examples": [
              "https://yourserver.com/incoming"
            ]
          },
          "statusUpdateURL": {
            "type": "string",
            "example": "https://yourserver.com/status",
            "examples": [
              "https://yourserver.com/status"
            ]
          },
          "useChatBot": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "useLiveChat": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "chatbotId": {
            "type": "string",
            "example": "bot-001",
            "examples": [
              "bot-001"
            ]
          },
          "clientDefaultNumber": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "clientConfig": {
            "$ref": "#/components/schemas/Client"
          }
        }
      },
      "RegisterWLNumberRequest": {
        "type": "object",
        "required": [
          "number"
        ],
        "properties": {
          "number": {
            "type": "string",
            "description": "Phone number in E.164 format. A leading '+' is added if omitted.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "hostingType": {
            "type": "string",
            "enum": [
              "WHATSAPP_GO",
              "WHATSAPP_JS"
            ],
            "description": "Hosting platform for the WL number. Defaults to `WHATSAPP_GO` when omitted.",
            "example": "WHATSAPP_GO",
            "examples": [
              "WHATSAPP_GO"
            ]
          }
        }
      },
      "WhatsAppNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "number": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "whatsAppProvider": {
            "type": "string",
            "enum": [
              "DLG",
              "WL",
              "KX",
              "TW"
            ],
            "example": "DLG",
            "examples": [
              "DLG"
            ]
          },
          "sandbox": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "sandboxType": {
            "type": "string",
            "enum": [
              "CONVERSATION",
              "INTERACTION"
            ],
            "example": "CONVERSATION",
            "examples": [
              "CONVERSATION"
            ]
          },
          "apiKey": {
            "type": "string",
            "example": "your-api-key",
            "examples": [
              "your-api-key"
            ]
          },
          "dlgBaseURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com",
            "examples": [
              "https://api.dlgprovider.com"
            ]
          },
          "dlgMessageURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com/message",
            "examples": [
              "https://api.dlgprovider.com/message"
            ]
          },
          "dlgMediaURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com/media",
            "examples": [
              "https://api.dlgprovider.com/media"
            ]
          },
          "dlgTemplateURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com/template",
            "examples": [
              "https://api.dlgprovider.com/template"
            ]
          },
          "dlgContactURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com/contact",
            "examples": [
              "https://api.dlgprovider.com/contact"
            ]
          },
          "dlgMMLURL": {
            "type": "string",
            "format": "uri",
            "example": "https://api.dlgprovider.com/mml",
            "examples": [
              "https://api.dlgprovider.com/mml"
            ]
          },
          "hostingType": {
            "type": "string",
            "enum": [
              "ON_PREMISE",
              "CLOUD_API",
              "WHATSAPP_JS",
              "WHATSAPP_GO"
            ],
            "example": "CLOUD_API",
            "examples": [
              "CLOUD_API"
            ]
          },
          "apiSecret": {
            "type": "string",
            "example": "your-api-secret",
            "examples": [
              "your-api-secret"
            ]
          },
          "billingModel": {
            "type": "string",
            "enum": [
              "mau",
              "message"
            ],
            "example": "mau",
            "examples": [
              "mau"
            ]
          },
          "namespace": {
            "type": "string",
            "example": "whatsapp:biz:123456",
            "examples": [
              "whatsapp:biz:123456"
            ]
          },
          "messagingServiceSid": {
            "type": "string",
            "example": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "examples": [
              "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            ]
          },
          "wabaId": {
            "type": "string",
            "example": "123456789012345",
            "examples": [
              "123456789012345"
            ]
          },
          "error": {
            "type": "string",
            "example": "INVALID_TOKEN",
            "examples": [
              "INVALID_TOKEN"
            ]
          },
          "detail": {
            "type": "string",
            "example": "The provided API token is invalid.",
            "examples": [
              "The provided API token is invalid."
            ]
          },
          "qualityRating": {
            "type": "string",
            "enum": [
              "High",
              "Medium",
              "Low"
            ],
            "example": "High",
            "examples": [
              "High"
            ]
          },
          "messagingLimitTier": {
            "type": "string",
            "enum": [
              "TIER_1K",
              "TIER_10K",
              "TIER_100K"
            ],
            "example": "TIER_10K",
            "examples": [
              "TIER_10K"
            ]
          },
          "messagingLimitValue": {
            "type": "integer",
            "format": "int32",
            "example": 10000,
            "examples": [
              10000
            ]
          },
          "channelStatus": {
            "type": "string",
            "example": "READY",
            "examples": [
              "READY"
            ]
          },
          "lastQualityUpdateTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-25T10:15:30Z",
            "examples": [
              "2026-02-25T10:15:30Z"
            ]
          }
        }
      },
      "WhatsAppClientWebHookRequest": {
        "type": "object",
        "properties": {
          "whatsAppNumberId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Optional. When set, creates a per-number override for the given `WhatsAppNumbers.id`; the number must be linked to the caller's client. When omitted or `null`, creates/updates the client default. Ignored on `PUT` (scope is locked once created — delete and recreate to change scope).\n\n**Don't know the id?** Call `GET /payless4messaging-service/WhatsApp/WhatsAppClientNumbers/getForCurrentLoginUser` to list your numbers — pass `?searchString=27123456789` (or any partial MSISDN) to jump straight to the row you want. The endpoint returns `WhatsAppClientNumberResponse` rows; the value to send here is the **nested** `whatsAppNumber.id` (the `WhatsAppNumbers` UUID), **not** the top-level `id` on the response row (which is the client–number link id).\n",
            "example": "f1e2d3c4-b5a6-9870-fedc-ba9876543210",
            "examples": [
              "f1e2d3c4-b5a6-9870-fedc-ba9876543210"
            ]
          },
          "incomingMessageURL": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to receive incoming messages from customers. Set to empty string to remove.",
            "example": "https://yourserver.com/webhooks/incoming",
            "examples": [
              "https://yourserver.com/webhooks/incoming"
            ]
          },
          "statusUpdateURL": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to receive delivery status updates (sent, delivered, read, failed). Set to empty string to remove.",
            "example": "https://yourserver.com/webhooks/status",
            "examples": [
              "https://yourserver.com/webhooks/status"
            ]
          },
          "sessionStatusURL": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to receive session status changes (WhatsApp Lite only). Set to empty string to remove.",
            "example": "https://yourserver.com/webhooks/session",
            "examples": [
              "https://yourserver.com/webhooks/session"
            ]
          },
          "eventWebhookURL": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to receive partner events: user preferences, template status changes, and quality updates. Set to empty string to remove.",
            "example": "https://yourserver.com/webhooks/events",
            "examples": [
              "https://yourserver.com/webhooks/events"
            ]
          },
          "chatbotWebhookURL": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to receive chatbot conversation events with chat participant context (participant id, conversation status, agent assignment). Coexists with `incomingMessageURL`. Set to empty string to remove.",
            "example": "https://yourserver.com/webhooks/chatbot",
            "examples": [
              "https://yourserver.com/webhooks/chatbot"
            ]
          },
          "chatbotIncludeOutgoing": {
            "type": "boolean",
            "description": "When `true`, also emit chatbot webhook events for outgoing bot widget replies. Defaults to `false` (incoming customer messages only).",
            "example": false,
            "examples": [
              false
            ]
          },
          "chatbotStopOnAgentAssignment": {
            "type": "boolean",
            "description": "When `true`, stop emitting chatbot webhook events once a chat participant is assigned to a human agent. Defaults to `false` (continue emitting regardless of assignment).",
            "example": true,
            "examples": [
              true
            ]
          },
          "chatbotPayloadVersion": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "v1",
              "v2"
            ],
            "description": "Chatbot webhook payload shape. `v1` (default; also when omitted or `null`) sends the flat chatbot event fields only. `v2` is a strict superset of `v1` — the same flat fields plus the nested `chatParticipant` object (full chat participant record, including its currently `assignedTo`) and three additional flat team fields: `teamId`, `teamName`, and `routedToAnotherTeam` (emitted on assignment events; `true` when the assignment moved the chat to a different team). `v2` also carries the customer's alpha-username fields — `senderUserId`/`recipientUserId` (the durable BSUID) and `username` (display only), and `voice` (`true` on an incoming voice note), and sends ended WhatsApp calls as `call` events carrying a `call` object. Reversible at any time with another `PUT`.\n\n**Deprecation:** `v1` is on a deprecation path. The default will switch from `v1` to `v2` and the `chatbotPayloadVersion` field itself will be removed once the migration completes. New integrations should set `\"v2\"` explicitly so they aren't affected when the default flips.\n\n**Replying from a `v2` webhook:** Because the `v2` payload already carries the full `chatParticipant` record (with the agent nested as `chatParticipant.assignedTo`), a real-time reply takes a single call to the live-chat send API — no follow-up `GET` is needed to assemble the request body. Use [`sendAgentMessageWhatsapp`](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendagentmessagewhatsapp) for text replies and [`sendAgentMessageWithAttachment`](https://ecommunicate-api-docs.redocly.app/apis/omnichannel/live-chat/sendagentmessagewithattachment) for media replies — only one of the two is needed per reply, picked by message type.\n\n**Security:** `v2` `chatParticipant.assignedTo` carries the agent's credential fields (`password`, `apiKey`, `loginToken`, `passwordResetKey`, `emailVerificationKey`, `applicationKey`). Treat receiving endpoints as a sensitive credential store. See the Webhooks guide for guidance.\n",
            "example": "v2",
            "examples": [
              "v2"
            ]
          }
        }
      },
      "WhatsAppClientWebHook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "client": {
            "$ref": "#/components/schemas/Client"
          },
          "whatsAppNumberId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set when this row is a per-number override; `null` for the client default.",
            "example": "f1e2d3c4-b5a6-9870-fedc-ba9876543210",
            "examples": [
              "f1e2d3c4-b5a6-9870-fedc-ba9876543210"
            ]
          },
          "whatsAppNumberMsisdn": {
            "type": [
              "string",
              "null"
            ],
            "description": "Read-only convenience field — the MSISDN of the number this override applies to. `null` for the client default.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "incomingMessageURL": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/incoming",
            "examples": [
              "https://yourserver.com/webhooks/incoming"
            ]
          },
          "statusUpdateURL": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/status",
            "examples": [
              "https://yourserver.com/webhooks/status"
            ]
          },
          "sessionStatusURL": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/session",
            "examples": [
              "https://yourserver.com/webhooks/session"
            ]
          },
          "eventWebhookURL": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/events",
            "examples": [
              "https://yourserver.com/webhooks/events"
            ]
          },
          "chatbotWebhookURL": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/chatbot",
            "examples": [
              "https://yourserver.com/webhooks/chatbot"
            ]
          },
          "chatbotIncludeOutgoing": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "chatbotStopOnAgentAssignment": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "chatbotPayloadVersion": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "v1",
              "v2"
            ],
            "description": "Chatbot webhook payload shape. `null`/`v1` sends the flat payload; `v2` adds the nested `chatParticipant` object (with `chatParticipant.assignedTo`) plus three flat team fields (`teamId`, `teamName`, `routedToAnotherTeam`) and the customer alpha-username fields (`senderUserId`/`recipientUserId` BSUID, `username`) and `voice` (`true` on an incoming voice note), and sends ended WhatsApp calls as `call` events carrying a `call` object. `v1` is deprecated — the default will switch to `v2` and this field will be removed in a future release.",
            "example": "v2",
            "examples": [
              "v2"
            ]
          }
        }
      },
      "WhatsAppClientWebHookPage": {
        "type": "object",
        "description": "Paginated list of webhook configurations for the authenticated user's client. The client default (if set) is always sorted first, followed by per-number overrides ordered by MSISDN.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhatsAppClientWebHook"
            }
          },
          "totalElements": {
            "type": "integer",
            "format": "int64",
            "example": 2,
            "examples": [
              2
            ]
          },
          "totalPages": {
            "type": "integer",
            "format": "int32",
            "example": 1,
            "examples": [
              1
            ]
          },
          "number": {
            "type": "integer",
            "format": "int32",
            "description": "Zero-based current page number.",
            "example": 0,
            "examples": [
              0
            ]
          },
          "size": {
            "type": "integer",
            "format": "int32",
            "description": "Page size requested.",
            "example": 10,
            "examples": [
              10
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "numberOfElements": {
            "type": "integer",
            "format": "int32",
            "example": 2,
            "examples": [
              2
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "UnifiedMessageRequest": {
        "type": "object",
        "required": [
          "channel",
          "payload"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "SMS"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "payload": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ECommMessageRequestV2"
              },
              {
                "$ref": "#/components/schemas/SMSRequest"
              }
            ]
          }
        }
      },
      "UnifiedMessageResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ACCEPTED",
              "PARTIAL",
              "FAILED"
            ],
            "description": "`ACCEPTED` when every recipient was accepted; `PARTIAL` when some were rejected (see `rejectedRecipients`).",
            "example": "ACCEPTED",
            "examples": [
              "ACCEPTED"
            ]
          },
          "message": {
            "type": "string",
            "example": "WhatsApp message(s) accepted",
            "examples": [
              "WhatsApp message(s) accepted"
            ]
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "example": "c3a1f8e2-4b6d-11ee-be56-0242ac120002",
            "examples": [
              "c3a1f8e2-4b6d-11ee-be56-0242ac120002"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "SMS"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "response": {
            "type": "string",
            "example": "Request Accepted for Processing",
            "examples": [
              "Request Accepted for Processing"
            ]
          },
          "acceptedCount": {
            "type": "integer",
            "description": "Number of recipients accepted (WhatsApp sends). Always present for WhatsApp.",
            "example": 2,
            "examples": [
              2
            ]
          },
          "rejectedCount": {
            "type": "integer",
            "description": "Number of recipients rejected (WhatsApp sends). Always present for WhatsApp.",
            "example": 1,
            "examples": [
              1
            ]
          },
          "rejectedRecipients": {
            "type": "array",
            "description": "Rejected recipients with reasons (WhatsApp sends). Empty when all were accepted.",
            "items": {
              "$ref": "#/components/schemas/RejectedRecipient"
            }
          },
          "reqObject": {
            "$ref": "#/components/schemas/ECommMessageRequestV2"
          },
          "smsGatewayResponse": {
            "$ref": "#/components/schemas/SMSGatewayResponse"
          }
        }
      },
      "ECommMessageRequestV2": {
        "type": "object",
        "required": [
          "sender",
          "messages"
        ],
        "properties": {
          "sender": {
            "type": "string",
            "example": "+1234567890",
            "examples": [
              "+1234567890"
            ]
          },
          "mmlTemplate": {
            "type": "boolean",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "example": "a7e3c1d0-5f8b-4a2e-9c1d-3b4e5f6a7b8c",
            "examples": [
              "a7e3c1d0-5f8b-4a2e-9c1d-3b4e5f6a7b8c"
            ]
          },
          "templateName": {
            "type": "string",
            "example": "marketing_promo_01",
            "examples": [
              "marketing_promo_01"
            ]
          },
          "messageType": {
            "type": "string",
            "enum": [
              "NOTIFICATION",
              "CHAT"
            ],
            "default": "NOTIFICATION",
            "example": "NOTIFICATION",
            "examples": [
              "NOTIFICATION"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ECommMessageV2"
            }
          },
          "fallback": {
            "$ref": "#/components/schemas/Fallback"
          },
          "allowDuplicates": {
            "type": "boolean",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "Fallback": {
        "type": "object",
        "required": [
          "sendFallback"
        ],
        "properties": {
          "sendFallback": {
            "type": "boolean",
            "description": "Enable SMS fallback if recipient is not on WhatsApp.",
            "example": true,
            "examples": [
              true
            ]
          },
          "text": {
            "type": "string",
            "description": "Custom SMS text. If omitted, uses resolved WhatsApp template text.",
            "example": "Hi, this is a fallback SMS message.",
            "examples": [
              "Hi, this is a fallback SMS message."
            ]
          },
          "unicode": {
            "type": "boolean",
            "description": "`false` = GSM 7-bit (160 chars). `true` = Unicode (70 chars).",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "ECommMessageV2": {
        "type": "object",
        "required": [
          "recipients"
        ],
        "properties": {
          "recipients": {
            "type": "array",
            "items": {
              "type": "object",
              "anyOf": [
                {
                  "required": [
                    "to"
                  ]
                },
                {
                  "required": [
                    "customerUserId"
                  ]
                }
              ],
              "properties": {
                "to": {
                  "type": "string",
                  "pattern": "^\\+?[1-9][0-9]{6,14}$",
                  "description": "Recipient phone number in international format: country code followed by the subscriber number, with an optional leading `+`.\n\nThe number must **not** start with `0` — replace the local trunk prefix with the country code. For example, the South African number `082 123 4567` must be sent as `+27821234567` or `27821234567`, never `0821234567`. The same rule applies to every country (e.g. UK `+447911123456`, not `07911123456`).\n",
                  "example": "+27821234567",
                  "examples": [
                    "+27821234567"
                  ]
                },
                "ctId": {
                  "type": "string",
                  "example": "a1b2c3d4-e5f6-7890",
                  "examples": [
                    "a1b2c3d4-e5f6-7890"
                  ]
                },
                "gstId": {
                  "type": "string",
                  "example": "gst-ref-001",
                  "examples": [
                    "gst-ref-001"
                  ]
                },
                "customerUserId": {
                  "type": "string",
                  "description": "Recipient's durable business-scoped user id (**BSUID**, alpha usernames), e.g. `ZA.1021033720668862`. Supply it **alongside `to`** (the phone takes precedence; the BSUID rides along as a durable fallback) **or on its own** to address a recipient with no phone number. Validated against the `^[A-Z]{2}\\.[0-9]+$` format — a malformed value is ignored (the send then requires a valid `to`).\n",
                  "example": "ZA.1021033720668862",
                  "examples": [
                    "ZA.1021033720668862"
                  ]
                }
              }
            }
          },
          "components": {
            "type": "array",
            "description": "For TEMPLATE messages. Leave empty for CHAT.",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/MsgComponentHeader"
                },
                {
                  "$ref": "#/components/schemas/MsgComponentBody"
                },
                {
                  "$ref": "#/components/schemas/MsgComponentButton"
                },
                {
                  "$ref": "#/components/schemas/MsgComponentCarousel"
                }
              ]
            }
          },
          "messageText": {
            "type": "string",
            "description": "Required for CHAT messages.",
            "example": "Hello, how can I help you?",
            "examples": [
              "Hello, how can I help you?"
            ]
          },
          "media": {
            "$ref": "#/components/schemas/Media"
          }
        }
      },
      "MsgComponentHeader": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/MsgComponentHeaderText"
          },
          {
            "$ref": "#/components/schemas/MsgComponentHeaderMedia"
          }
        ]
      },
      "MsgComponentHeaderText": {
        "type": "object",
        "required": [
          "type",
          "format"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "header"
            ],
            "example": "header",
            "examples": [
              "header"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "TEXT"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MsgComponentHeaderMedia": {
        "type": "object",
        "required": [
          "type",
          "format",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "header"
            ],
            "example": "header",
            "examples": [
              "header"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO"
            ],
            "example": "DOCUMENT",
            "examples": [
              "DOCUMENT"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://example.com/files/brochure.pdf",
            "examples": [
              "https://example.com/files/brochure.pdf"
            ]
          },
          "filename": {
            "type": "string",
            "example": "brochure.pdf",
            "examples": [
              "brochure.pdf"
            ]
          }
        }
      },
      "MsgComponentBody": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "body"
            ],
            "example": "body",
            "examples": [
              "body"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MsgComponentButton": {
        "type": "object",
        "required": [
          "type",
          "parameters"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "button"
            ],
            "example": "button",
            "examples": [
              "button"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conversationParameters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "payload": {
                  "type": "string",
                  "example": "btn_confirm_order",
                  "examples": [
                    "btn_confirm_order"
                  ]
                },
                "conversationState": {
                  "type": "string",
                  "example": "AWAITING_CONFIRMATION",
                  "examples": [
                    "AWAITING_CONFIRMATION"
                  ]
                }
              }
            }
          }
        }
      },
      "MsgComponentCarousel": {
        "type": "object",
        "required": [
          "type",
          "cards"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "carousel"
            ],
            "example": "carousel",
            "examples": [
              "carousel"
            ]
          },
          "cards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "components": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/MsgComponentHeader"
                      },
                      {
                        "$ref": "#/components/schemas/MsgComponentBody"
                      },
                      {
                        "$ref": "#/components/schemas/MsgComponentButton"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "Media": {
        "type": "object",
        "required": [
          "url"
        ],
        "description": "For CHAT messages only. Attach files, images, or videos.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://example.com/files/invoice.pdf",
            "examples": [
              "https://example.com/files/invoice.pdf"
            ]
          },
          "caption": {
            "type": "string",
            "description": "Filename only (e.g. `invoice.pdf`).",
            "example": "invoice.pdf",
            "examples": [
              "invoice.pdf"
            ]
          }
        }
      },
      "TypingIndicatorRequest": {
        "type": "object",
        "required": [
          "senderNumber",
          "recipientNumber"
        ],
        "properties": {
          "senderNumber": {
            "type": "string",
            "example": "+1234567890",
            "examples": [
              "+1234567890"
            ]
          },
          "recipientNumber": {
            "type": "string",
            "example": "+9876543210",
            "examples": [
              "+9876543210"
            ]
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ID of the last message received from the recipient. Required when using the Meta Cloud API to identify the conversation context. Can be omitted for WhatsApp Lite.",
            "example": "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg",
            "examples": [
              "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg"
            ]
          }
        }
      },
      "Pl4WhatsAppResponse": {
        "type": "object",
        "properties": {
          "response": {
            "type": "string",
            "example": "Request Accepted for Processing",
            "examples": [
              "Request Accepted for Processing"
            ]
          },
          "batchId": {
            "type": "string",
            "format": "uuid",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "examples": [
              "f47ac10b-58cc-4372-a567-0e02b2c3d479"
            ]
          },
          "acceptedCount": {
            "type": "integer",
            "description": "Number of recipients accepted for processing. Always present.",
            "example": 2,
            "examples": [
              2
            ]
          },
          "rejectedCount": {
            "type": "integer",
            "description": "Number of recipients rejected before processing (for example, an invalid number). Always present.",
            "example": 1,
            "examples": [
              1
            ]
          },
          "rejectedRecipients": {
            "type": "array",
            "description": "The recipients that were rejected, each with the reason. Empty when every recipient was accepted.",
            "items": {
              "$ref": "#/components/schemas/RejectedRecipient"
            }
          },
          "reqObject": {
            "$ref": "#/components/schemas/ECommMessageRequestV2"
          }
        }
      },
      "RejectedRecipient": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "The rejected recipient number as supplied.",
            "example": "27123",
            "examples": [
              "27123"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Why the recipient was rejected.",
            "example": "Invalid phone number",
            "examples": [
              "Invalid phone number"
            ]
          }
        }
      },
      "SMSRequest": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "to": {
                  "type": "string",
                  "example": "27987654321",
                  "examples": [
                    "27987654321"
                  ]
                },
                "text": {
                  "type": "string",
                  "example": "Hello Mr John Doe",
                  "examples": [
                    "Hello Mr John Doe"
                  ]
                },
                "ctId": {
                  "type": "string",
                  "example": "ctId-01",
                  "examples": [
                    "ctId-01"
                  ]
                },
                "unicode": {
                  "type": "boolean",
                  "example": false,
                  "examples": [
                    false
                  ]
                }
              }
            }
          },
          "allowDuplicates": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "Pl4SMSResponse": {
        "type": "object",
        "properties": {
          "response": {
            "type": "string",
            "example": "Request Accepted for Processing",
            "examples": [
              "Request Accepted for Processing"
            ]
          },
          "smsGatewayResponse": {
            "$ref": "#/components/schemas/SMSGatewayResponse"
          }
        }
      },
      "SMSGatewayResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "string",
            "example": "0",
            "examples": [
              "0"
            ]
          },
          "statusDescription": {
            "type": "string",
            "example": "Message(s) Accepted For Processing",
            "examples": [
              "Message(s) Accepted For Processing"
            ]
          },
          "completionTime": {
            "type": "string",
            "example": "2026-01-15T10:30:05Z",
            "examples": [
              "2026-01-15T10:30:05Z"
            ]
          },
          "gstid": {
            "type": "string",
            "example": "sms-gst-12345",
            "examples": [
              "sms-gst-12345"
            ]
          }
        }
      },
      "CreateTemplateRequest": {
        "type": "object",
        "required": [
          "template_name",
          "language",
          "category",
          "components",
          "number"
        ],
        "properties": {
          "template_name": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$",
            "example": "seasonal_promo_2024",
            "examples": [
              "seasonal_promo_2024"
            ]
          },
          "language": {
            "type": "string",
            "example": "en_GB",
            "examples": [
              "en_GB"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "AUTHENTICATION",
              "MARKETING",
              "UTILITY"
            ],
            "example": "MARKETING",
            "examples": [
              "MARKETING"
            ]
          },
          "number": {
            "type": "string",
            "example": "+987654321",
            "examples": [
              "+987654321"
            ]
          },
          "allow_category_change": {
            "type": "boolean",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          },
          "components": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ComponentHeader"
                },
                {
                  "$ref": "#/components/schemas/ComponentBody"
                },
                {
                  "$ref": "#/components/schemas/ComponentButtons"
                },
                {
                  "$ref": "#/components/schemas/ComponentCarousel"
                },
                {
                  "$ref": "#/components/schemas/ComponentFooter"
                },
                {
                  "$ref": "#/components/schemas/ComponentCallPermissionRequest"
                }
              ]
            }
          }
        }
      },
      "TemplateResponseObject": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "example": "1234567890123456",
            "examples": [
              "1234567890123456"
            ]
          },
          "template_name": {
            "type": "string",
            "example": "seasonal_promo_2024",
            "examples": [
              "seasonal_promo_2024"
            ]
          },
          "status": {
            "type": "string",
            "example": "APPROVED",
            "examples": [
              "APPROVED"
            ]
          },
          "category": {
            "type": "string",
            "example": "MARKETING",
            "examples": [
              "MARKETING"
            ]
          },
          "language": {
            "type": "string",
            "example": "en_GB",
            "examples": [
              "en_GB"
            ]
          }
        }
      },
      "WhatsAppClientTemplatePage": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhatsAppClientTemplateDto"
            }
          },
          "totalPages": {
            "type": "integer",
            "example": 5,
            "examples": [
              5
            ]
          },
          "totalElements": {
            "type": "integer",
            "example": 47,
            "examples": [
              47
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "WhatsAppClientTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "templateRequest": {
            "type": "string",
            "description": "Stringified JSON of the template definition.",
            "example": "{\"template_name\":\"promo\",\"language\":\"en_GB\"}",
            "examples": [
              "{\"template_name\":\"promo\",\"language\":\"en_GB\"}"
            ]
          },
          "templateName": {
            "type": "string",
            "example": "seasonal_promo_2024",
            "examples": [
              "seasonal_promo_2024"
            ]
          },
          "namespace": {
            "type": "string",
            "example": "whatsapp:hsm:technology:ecommunicate",
            "examples": [
              "whatsapp:hsm:technology:ecommunicate"
            ]
          },
          "status": {
            "type": "string",
            "example": "approved",
            "examples": [
              "approved"
            ]
          },
          "templateType": {
            "type": "string",
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "languageCode": {
            "type": "string",
            "example": "en_GB",
            "examples": [
              "en_GB"
            ]
          },
          "approved": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "whatsAppProvider": {
            "type": "string",
            "enum": [
              "DLG",
              "WL",
              "KX",
              "TW"
            ],
            "example": "DLG",
            "examples": [
              "DLG"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-10T08:00:00Z",
            "examples": [
              "2026-01-10T08:00:00Z"
            ]
          },
          "externalId": {
            "type": "string",
            "example": "1234567890123456",
            "examples": [
              "1234567890123456"
            ]
          },
          "attachmentType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "IMAGE",
              "DOCUMENT",
              "VIDEO",
              "NULL"
            ],
            "example": "IMAGE",
            "examples": [
              "IMAGE"
            ]
          },
          "whatsAppNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "rejectedReason": {
            "type": [
              "string",
              "null"
            ],
            "example": "Template content policy violation",
            "examples": [
              "Template content policy violation"
            ]
          },
          "qualityScore": {
            "type": "string",
            "enum": [
              "GREEN",
              "YELLOW",
              "RED",
              "UNKNOWN"
            ],
            "example": "UNKNOWN",
            "examples": [
              "UNKNOWN"
            ]
          }
        }
      },
      "ComponentHeader": {
        "type": "object",
        "required": [
          "type",
          "format"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "HEADER"
            ],
            "example": "HEADER",
            "examples": [
              "HEADER"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "TEXT",
              "IMAGE",
              "DOCUMENT",
              "VIDEO",
              "LOCATION"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 60,
            "example": "Order Confirmation {{1}}",
            "examples": [
              "Order Confirmation {{1}}"
            ]
          },
          "example": {
            "type": "object",
            "properties": {
              "header_text": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "header_handle": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ComponentBody": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "BODY"
            ],
            "example": "BODY",
            "examples": [
              "BODY"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 1024,
            "example": "Hi {{1}}, your order {{2}} has been shipped.",
            "examples": [
              "Hi {{1}}, your order {{2}} has been shipped."
            ]
          },
          "add_security_recommendation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "example": {
            "type": "object",
            "properties": {
              "body_text": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "ComponentFooter": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "FOOTER"
            ],
            "example": "FOOTER",
            "examples": [
              "FOOTER"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 60,
            "example": "This code expires in 5 minutes.",
            "examples": [
              "This code expires in 5 minutes."
            ]
          },
          "code_expiration_minutes": {
            "type": "integer",
            "example": 5,
            "examples": [
              5
            ]
          }
        }
      },
      "ComponentButtons": {
        "type": "object",
        "required": [
          "type",
          "buttons"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "BUTTONS"
            ],
            "example": "BUTTONS",
            "examples": [
              "BUTTONS"
            ]
          },
          "buttons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ButtonObject"
            }
          }
        }
      },
      "ComponentCallPermissionRequest": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Asks the customer to allow your business to call them on WhatsApp. WhatsApp shows its own \"allow calls\"\nprompt with the message, so the component has no text. Allowed once per template, on `MARKETING` and\n`UTILITY` templates only, and not on carousel templates.\n",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "CALL_PERMISSION_REQUEST"
            ],
            "example": "CALL_PERMISSION_REQUEST",
            "examples": [
              "CALL_PERMISSION_REQUEST"
            ]
          }
        }
      },
      "ComponentCarousel": {
        "type": "object",
        "required": [
          "type",
          "cards"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "CAROUSEL"
            ],
            "example": "CAROUSEL",
            "examples": [
              "CAROUSEL"
            ]
          },
          "cards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "components": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/ComponentHeader"
                      },
                      {
                        "$ref": "#/components/schemas/ComponentBody"
                      },
                      {
                        "$ref": "#/components/schemas/ComponentButtons"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "ButtonObject": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "QUICK_REPLY",
              "URL",
              "PHONE_NUMBER",
              "OTP",
              "FLOW",
              "SPM",
              "COPY_CODE",
              "REQUEST_CONTACT_INFO"
            ],
            "example": "URL",
            "examples": [
              "URL"
            ],
            "description": "The button type. Note two special cases:\n- `COPY_CODE` — a **coupon-code** button for MARKETING and UTILITY templates. The sample\n  code is supplied in `example` at creation; the real code is sent as the button parameter.\n  This is distinct from an authentication one-time-passcode button, which is `type: OTP`\n  with `otp_type: COPY_CODE`.\n- `REQUEST_CONTACT_INFO` — a fixed-label button that asks the customer to share their phone\n  number (used to recover a number from a username/BSUID-only contact). Takes no `text` and\n  no send parameter. Not permitted on AUTHENTICATION templates.\n"
          },
          "text": {
            "type": "string",
            "maxLength": 25,
            "example": "Visit Website",
            "examples": [
              "Visit Website"
            ]
          },
          "url": {
            "type": "string",
            "maxLength": 2000,
            "example": "https://example.com/offer/{{1}}",
            "examples": [
              "https://example.com/offer/{{1}}"
            ]
          },
          "phone_number": {
            "type": "string",
            "maxLength": 20,
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "otp_type": {
            "type": "string",
            "example": "COPY_CODE",
            "examples": [
              "COPY_CODE"
            ]
          },
          "autofill_text": {
            "type": "string",
            "example": "Autofill",
            "examples": [
              "Autofill"
            ]
          },
          "package_name": {
            "type": "string",
            "example": "com.example.myapp",
            "examples": [
              "com.example.myapp"
            ]
          },
          "signature_hash": {
            "type": "string",
            "example": "K8a72FAINcG",
            "examples": [
              "K8a72FAINcG"
            ]
          },
          "flow_id": {
            "type": "string",
            "example": "flow_abc123",
            "examples": [
              "flow_abc123"
            ]
          },
          "flow_action": {
            "type": "string",
            "example": "navigate",
            "examples": [
              "navigate"
            ]
          },
          "navigate_screen": {
            "type": "string",
            "example": "WELCOME_SCREEN",
            "examples": [
              "WELCOME_SCREEN"
            ]
          },
          "example": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WhatsAppMessageStatusDto": {
        "type": "object",
        "properties": {
          "latestMessageStatus": {
            "type": "string",
            "enum": [
              "ACCEPTED",
              "SENT",
              "DELIVERED",
              "READ",
              "PLAYED",
              "FAILED"
            ],
            "example": "DELIVERED",
            "examples": [
              "DELIVERED"
            ]
          },
          "statusTimestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:35:00Z",
            "examples": [
              "2026-01-15T10:35:00Z"
            ]
          },
          "ctId": {
            "type": "string",
            "example": "ct-order-9876",
            "examples": [
              "ct-order-9876"
            ]
          },
          "gstId": {
            "type": "string",
            "example": "gst-a1b2c3d4",
            "examples": [
              "gst-a1b2c3d4"
            ]
          },
          "failureReason": {
            "type": "string",
            "example": "Recipient not on WhatsApp",
            "examples": [
              "Recipient not on WhatsApp"
            ]
          }
        }
      },
      "WhatsAppMessageStatusPage": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhatsAppMessageStatusDto"
            }
          },
          "totalElements": {
            "type": "integer",
            "example": 150,
            "examples": [
              150
            ]
          },
          "totalPages": {
            "type": "integer",
            "example": 15,
            "examples": [
              15
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "WhatsAppSendReceiveMessageDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123",
            "examples": [
              "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "sender": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "receiver": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "customerUserId": {
            "type": "string",
            "description": "Customer's durable business-scoped user id (**BSUID**, alpha usernames), e.g. `ZA.1021033720668862`. Stable across phone-number changes; present even when the phone is withheld.",
            "example": "ZA.1021033720668862",
            "examples": [
              "ZA.1021033720668862"
            ]
          },
          "customerUsername": {
            "type": "string",
            "description": "Customer's optional WhatsApp username (display only).",
            "example": "johndoe",
            "examples": [
              "johndoe"
            ]
          },
          "gstid": {
            "type": "string",
            "format": "uuid",
            "example": "e5f6a7b8-c9d0-1234-e5f6-a7b8c9d01234",
            "examples": [
              "e5f6a7b8-c9d0-1234-e5f6-a7b8c9d01234"
            ]
          },
          "ctid": {
            "type": "string",
            "example": "ct-order-9876",
            "examples": [
              "ct-order-9876"
            ]
          },
          "vendor": {
            "type": "string",
            "enum": [
              "TW",
              "KX",
              "DLG",
              "WL"
            ],
            "example": "DLG",
            "examples": [
              "DLG"
            ]
          },
          "messageType": {
            "type": "string",
            "enum": [
              "CONVERSATION",
              "NOTIFICATION",
              "SESSION24HOUR",
              "ALL",
              "CHAT"
            ],
            "example": "NOTIFICATION",
            "examples": [
              "NOTIFICATION"
            ]
          },
          "messageContentType": {
            "type": "string",
            "enum": [
              "TEXT",
              "LOCATION",
              "MEDIA",
              "BUTTON",
              "ALL",
              "INTERACTIVE"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "OUTGOING",
              "INCOMING",
              "ALL"
            ],
            "example": "OUTGOING",
            "examples": [
              "OUTGOING"
            ]
          },
          "text": {
            "type": "string",
            "example": "Hi John, your order has been shipped.",
            "examples": [
              "Hi John, your order has been shipped."
            ]
          },
          "mediaUrl": {
            "type": "string",
            "example": "https://example.com/media/image.jpg",
            "examples": [
              "https://example.com/media/image.jpg"
            ]
          },
          "mediaCaption": {
            "type": "string",
            "example": "Invoice for order #1234",
            "examples": [
              "Invoice for order #1234"
            ]
          },
          "fileName": {
            "type": "string",
            "example": "invoice.pdf",
            "examples": [
              "invoice.pdf"
            ]
          },
          "mimetype": {
            "type": "string",
            "example": "application/pdf",
            "examples": [
              "application/pdf"
            ]
          },
          "fileExtension": {
            "type": "string",
            "example": "pdf",
            "examples": [
              "pdf"
            ]
          },
          "latitude": {
            "type": "string",
            "example": "-26.2041",
            "examples": [
              "-26.2041"
            ]
          },
          "longitude": {
            "type": "string",
            "example": "28.0473",
            "examples": [
              "28.0473"
            ]
          },
          "label": {
            "type": "string",
            "example": "Head Office",
            "examples": [
              "Head Office"
            ]
          },
          "address": {
            "type": "string",
            "example": "123 Main St, Johannesburg",
            "examples": [
              "123 Main St, Johannesburg"
            ]
          },
          "buttonText": {
            "type": "string",
            "example": "Confirm Order",
            "examples": [
              "Confirm Order"
            ]
          },
          "buttonPayload": {
            "type": "string",
            "example": "btn_confirm_order",
            "examples": [
              "btn_confirm_order"
            ]
          },
          "latestStatus": {
            "type": "string",
            "example": "DELIVERED",
            "examples": [
              "DELIVERED"
            ]
          },
          "eCommValidationMessage": {
            "type": "string",
            "enum": [
              "ACCEPTED_BY_PROVIDER",
              "SUCCESSFULLY_SENT",
              "SUCCESSFULLY_DELIVERED",
              "SUCCESSFULLY_READ",
              "SUCCESSFULLY_PLAYED",
              "FAILED_SENDING"
            ],
            "example": "SUCCESSFULLY_DELIVERED",
            "examples": [
              "SUCCESSFULLY_DELIVERED"
            ]
          },
          "sentToProvider": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "sentToProviderTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:01Z",
            "examples": [
              "2026-01-15T10:30:01Z"
            ]
          },
          "sentToNumber": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "sentToNumberTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:02Z",
            "examples": [
              "2026-01-15T10:30:02Z"
            ]
          },
          "receivedByNumber": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "receivedByNumberTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:05Z",
            "examples": [
              "2026-01-15T10:30:05Z"
            ]
          },
          "readByNumber": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "readByNumberTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:31:00Z",
            "examples": [
              "2026-01-15T10:31:00Z"
            ]
          },
          "providerReferenceId": {
            "type": "string",
            "example": "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg",
            "examples": [
              "wamid.HBgNMjc4MjEyMzQ1Njc4FQIAEhgg"
            ]
          },
          "messageCost": {
            "type": "integer",
            "example": 50,
            "examples": [
              50
            ]
          },
          "messageRefundCost": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "templateMessage": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "templateName": {
            "type": "string",
            "example": "order_shipped_v2",
            "examples": [
              "order_shipped_v2"
            ]
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "example": "a7e3c1d0-5f8b-4a2e-9c1d-3b4e5f6a7b8c",
            "examples": [
              "a7e3c1d0-5f8b-4a2e-9c1d-3b4e5f6a7b8c"
            ]
          },
          "vendorErrorCode": {
            "type": "string",
            "example": "470",
            "examples": [
              "470"
            ]
          },
          "vendorError": {
            "type": "string",
            "example": "Message failed to send",
            "examples": [
              "Message failed to send"
            ]
          },
          "vendorErrorDetail": {
            "type": "string",
            "example": "Recipient phone number not on WhatsApp",
            "examples": [
              "Recipient phone number not on WhatsApp"
            ]
          }
        }
      },
      "ReplyReportDto": {
        "type": "object",
        "properties": {
          "replyId": {
            "type": "string",
            "format": "uuid",
            "example": "f6a7b8c9-d012-3456-f6a7-b8c9d0123456",
            "examples": [
              "f6a7b8c9-d012-3456-f6a7-b8c9d0123456"
            ]
          },
          "customerNumber": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "replyText": {
            "type": "string",
            "example": "Yes, I confirm my order.",
            "examples": [
              "Yes, I confirm my order."
            ]
          },
          "replyMediaUrl": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "replyTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:35:00Z",
            "examples": [
              "2026-01-15T10:35:00Z"
            ]
          },
          "repliedToText": {
            "type": [
              "string",
              "null"
            ],
            "example": "Please confirm your order.",
            "examples": [
              "Please confirm your order."
            ]
          },
          "repliedToTemplateName": {
            "type": "string",
            "example": "order_confirmation_v1",
            "examples": [
              "order_confirmation_v1"
            ]
          },
          "repliedToTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          }
        }
      },
      "ChatParticipant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "cp-a1b2c3d4",
            "examples": [
              "cp-a1b2c3d4"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "John",
            "examples": [
              "John"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "fullName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "phoneNumber": {
            "type": "string",
            "example": "27821234567",
            "examples": [
              "27821234567"
            ]
          },
          "userId": {
            "type": "string",
            "description": "Customer's durable business-scoped user id (**BSUID**, alpha usernames), e.g. `ZA.1021033720668862`. Stable across phone-number changes; present even when the phone is withheld.",
            "example": "ZA.1021033720668862",
            "examples": [
              "ZA.1021033720668862"
            ]
          },
          "username": {
            "type": "string",
            "description": "Customer's optional WhatsApp username (display only).",
            "example": "johndoe",
            "examples": [
              "johndoe"
            ]
          },
          "parentUserId": {
            "type": "string",
            "description": "BSUID of the parent WhatsApp Business portfolio, when applicable.",
            "example": "ZA.1000000000000000",
            "examples": [
              "ZA.1000000000000000"
            ]
          },
          "email": {
            "type": "string",
            "example": "john.doe@example.com",
            "examples": [
              "john.doe@example.com"
            ]
          },
          "subject": {
            "type": "string",
            "example": "Billing Inquiry",
            "examples": [
              "Billing Inquiry"
            ]
          },
          "team": {
            "type": "string",
            "example": "Support Team",
            "examples": [
              "Support Team"
            ]
          },
          "whatsAppClientNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "conversationClosed": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "missedConversation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "afterHoursConversation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "chatBotConversation": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "sendRatingWidget": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T08:00:00Z",
            "examples": [
              "2026-01-15T08:00:00Z"
            ]
          },
          "lastMessageTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:35:00Z",
            "examples": [
              "2026-01-15T10:35:00Z"
            ]
          },
          "customerLastMessageTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "conversationStatus": {
            "type": "string",
            "example": "OPEN",
            "examples": [
              "OPEN"
            ]
          },
          "sender": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "assignedTo": {
            "$ref": "#/components/schemas/SystemUser"
          },
          "lastAssignedAgent": {
            "$ref": "#/components/schemas/SystemUser"
          },
          "openedBy": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "terminatedBy": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "unread": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "rated": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "expectingRating": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "companyName": {
            "type": "string",
            "example": "Acme Corp",
            "examples": [
              "Acme Corp"
            ]
          },
          "accountNumber": {
            "type": "string",
            "example": "ACC-001234",
            "examples": [
              "ACC-001234"
            ]
          },
          "activeFlow": {
            "type": "string",
            "example": "main_support_flow",
            "examples": [
              "main_support_flow"
            ]
          },
          "nodeName": {
            "type": "string",
            "example": "Welcome Node",
            "examples": [
              "Welcome Node"
            ]
          },
          "botName": {
            "type": "string",
            "example": "Support Bot",
            "examples": [
              "Support Bot"
            ]
          },
          "timezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "gstn": {
            "type": "string",
            "format": "uuid",
            "description": "Global system tracking number",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "ctn": {
            "type": "string",
            "format": "uuid",
            "description": "Client tracking number",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          }
        }
      },
      "ChatParticipantPage": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatParticipant"
            }
          },
          "totalElements": {
            "type": "integer",
            "example": 85,
            "examples": [
              85
            ]
          },
          "totalPages": {
            "type": "integer",
            "example": 9,
            "examples": [
              9
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "ChatParticipantResponse": {
        "type": "object",
        "description": "Lean, curated chat participant returned by the v2 chat list/get endpoints. Null fields are omitted.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "aef65b5a-23a4-462a-a275-9aa2f3e0e56e",
            "examples": [
              "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"
            ]
          },
          "fullName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "John",
            "examples": [
              "John"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "phoneNumber": {
            "type": "string",
            "example": "27821234567",
            "examples": [
              "27821234567"
            ]
          },
          "userId": {
            "type": "string",
            "description": "Customer's durable business-scoped user id (**BSUID**, alpha usernames). Stable across phone-number changes; present even when the phone is withheld.",
            "example": "ZA.1021033720668862",
            "examples": [
              "ZA.1021033720668862"
            ]
          },
          "username": {
            "type": "string",
            "description": "Customer's optional WhatsApp username (display only).",
            "example": "johndoe",
            "examples": [
              "johndoe"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "john.doe@example.com",
            "examples": [
              "john.doe@example.com"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "conversationStatus": {
            "type": "string",
            "example": "ACTIVE",
            "examples": [
              "ACTIVE"
            ]
          },
          "conversationClosed": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "unread": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "missedConversation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "chatBotConversation": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "whatsAppClientNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "team": {
            "type": "string",
            "example": "Support",
            "examples": [
              "Support"
            ]
          },
          "teamId": {
            "type": "string",
            "format": "uuid",
            "example": "288436ad-4522-4f27-95e9-c406a917894d",
            "examples": [
              "288436ad-4522-4f27-95e9-c406a917894d"
            ]
          },
          "lastMessageTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:31:00Z",
            "examples": [
              "2026-01-15T10:31:00Z"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:00:00Z",
            "examples": [
              "2026-01-15T10:00:00Z"
            ]
          },
          "customerLastMessageTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "assignedTo": {
            "$ref": "#/components/schemas/AgentSummary"
          },
          "lastAssignedAgent": {
            "$ref": "#/components/schemas/AgentSummary"
          },
          "lastMessagePreview": {
            "type": "string",
            "description": "One-line preview of the most recent message, ready to render. Text is collapsed to a single line and cut at 120 characters; media and structured messages come back as a placeholder: `(document)`, `(image)`, `(audio)`, `(video)`, `(location)`, `(contact)`, or `(message)`. Only present on the list endpoint, and omitted for chats with no messages.",
            "example": "Hi, I need help with my order",
            "examples": [
              "Hi, I need help with my order"
            ]
          },
          "lastMessageDirection": {
            "type": "string",
            "enum": [
              "INCOMING",
              "OUTGOING"
            ],
            "description": "Direction of the previewed message. `OUTGOING` means an agent or the bot sent it.",
            "example": "INCOMING",
            "examples": [
              "INCOMING"
            ]
          },
          "lastMessageMediaType": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "BUTTON",
              "FILE",
              "AUDIO",
              "VOICE",
              "URL",
              "STICKER"
            ],
            "description": "Media type of the previewed message, when it carried media.",
            "example": "IMAGE",
            "examples": [
              "IMAGE"
            ]
          },
          "lastMessageSender": {
            "type": "string",
            "description": "Who sent an `OUTGOING` previewed message: the agent's first name, or `Bot` when the chatbot sent it. Absent for `INCOMING` messages.",
            "example": "Hayley",
            "examples": [
              "Hayley",
              "Bot"
            ]
          }
        }
      },
      "ChatParticipantResponsePage": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatParticipantResponse"
            }
          },
          "totalElements": {
            "type": "integer",
            "example": 85,
            "examples": [
              85
            ]
          },
          "totalPages": {
            "type": "integer",
            "example": 9,
            "examples": [
              9
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8",
            "examples": [
              "c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8"
            ]
          },
          "tempId": {
            "type": "string",
            "format": "uuid",
            "description": "Temporary client-generated ID used to correlate the request with the response.",
            "example": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
            "examples": [
              "c9f0b308-1a0d-3f3f-7912-464f06677c6b"
            ]
          },
          "replyType": {
            "type": "string",
            "enum": [
              "QUICKREPLY",
              "NOTIFICATION",
              "SIMPLE"
            ],
            "example": "SIMPLE",
            "examples": [
              "SIMPLE"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "OUTGOING",
              "INCOMING"
            ],
            "example": "INCOMING",
            "examples": [
              "INCOMING"
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "BUTTON",
              "CAROUSEL",
              "DROPDOWN",
              "IMAGE",
              "TEXT",
              "DATE",
              "FILE",
              "MEDIA",
              "LOCATION",
              "RATING"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "text": {
            "type": "string",
            "example": "Hello, I need help with my account.",
            "examples": [
              "Hello, I need help with my account."
            ]
          },
          "question": {
            "type": "string",
            "example": "What is your account number?",
            "examples": [
              "What is your account number?"
            ]
          },
          "answer": {
            "type": "string",
            "example": "ACC-001234",
            "examples": [
              "ACC-001234"
            ]
          },
          "quickReply": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "messageOwner": {
            "type": "string",
            "description": "Identifies who sent the message.",
            "enum": [
              "agent",
              "customer",
              "system"
            ],
            "example": "agent",
            "examples": [
              "agent"
            ]
          },
          "userOriginated": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/SystemUser"
          },
          "chatParticipant": {
            "$ref": "#/components/schemas/ChatParticipant"
          },
          "sentTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:01Z",
            "examples": [
              "2026-01-15T10:30:01Z"
            ]
          },
          "readTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:31:00Z",
            "examples": [
              "2026-01-15T10:31:00Z"
            ]
          },
          "deliveredTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:05Z",
            "examples": [
              "2026-01-15T10:30:05Z"
            ]
          },
          "sent": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "read": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "delivered": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "errorCode": {
            "type": "string",
            "example": "",
            "examples": [
              ""
            ]
          },
          "sender": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "receiver": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "ctId": {
            "type": "string",
            "example": "ct-msg-5678",
            "examples": [
              "ct-msg-5678"
            ]
          },
          "gstId": {
            "type": "string",
            "example": "gst-msg-1234",
            "examples": [
              "gst-msg-1234"
            ]
          },
          "mediaURL": {
            "type": "string",
            "example": "https://example.com/media/photo.jpg",
            "examples": [
              "https://example.com/media/photo.jpg"
            ]
          },
          "mediaType": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "NULL",
              "BUTTON",
              "FILE",
              "AUDIO",
              "VOICE"
            ],
            "example": "IMAGE",
            "examples": [
              "IMAGE"
            ]
          },
          "latitude": {
            "type": "string",
            "example": "-26.2041",
            "examples": [
              "-26.2041"
            ]
          },
          "longitude": {
            "type": "string",
            "example": "28.0473",
            "examples": [
              "28.0473"
            ]
          },
          "address": {
            "type": "string",
            "example": "123 Main St, Johannesburg",
            "examples": [
              "123 Main St, Johannesburg"
            ]
          },
          "label": {
            "type": "string",
            "example": "Head Office",
            "examples": [
              "Head Office"
            ]
          },
          "fileExtension": {
            "type": "string",
            "example": "jpg",
            "examples": [
              "jpg"
            ]
          }
        }
      },
      "AgentSummary": {
        "type": "object",
        "description": "Lean reference to the agent who sent or owns a message.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Alice",
            "examples": [
              "Alice"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Smith",
            "examples": [
              "Smith"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "alice.smith@example.com",
            "examples": [
              "alice.smith@example.com"
            ]
          },
          "avatar": {
            "type": "string",
            "description": "URL of the agent's avatar image.",
            "example": "https://example.com/avatars/alice.png",
            "examples": [
              "https://example.com/avatars/alice.png"
            ]
          }
        }
      },
      "UserSummary": {
        "type": "object",
        "description": "Lean, credential-free view of an organization user. Returned by the user and team listing endpoints to populate transfer/assignment pickers. Null fields are omitted.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Alice",
            "examples": [
              "Alice"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Smith",
            "examples": [
              "Smith"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "alice.smith@example.com",
            "examples": [
              "alice.smith@example.com"
            ]
          },
          "role": {
            "type": "string",
            "description": "Platform authority — for example admin or client.",
            "example": "client",
            "examples": [
              "client"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "Agent",
              "Supervisor"
            ],
            "description": "Role within the live-chat team.",
            "example": "Agent",
            "examples": [
              "Agent"
            ]
          },
          "avatar": {
            "type": "string",
            "description": "URL of the user's avatar image.",
            "example": "https://example.com/avatars/alice.png",
            "examples": [
              "https://example.com/avatars/alice.png"
            ]
          },
          "availabilityStatus": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "Whether the user is currently available for live-chat assignment.",
            "example": "AVAILABLE",
            "examples": [
              "AVAILABLE"
            ]
          }
        }
      },
      "UserResponse": {
        "type": "object",
        "description": "Credential-free view of an organization user, returned by the v1 user endpoints. Never carries password, apiKey, or token fields. Null fields are omitted.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "alice.smith@example.com",
            "examples": [
              "alice.smith@example.com"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Alice",
            "examples": [
              "Alice"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Smith",
            "examples": [
              "Smith"
            ]
          },
          "role": {
            "type": "string",
            "description": "Platform authority — for example admin or client.",
            "example": "client",
            "examples": [
              "client"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "Agent",
              "Supervisor"
            ],
            "description": "Role within the live-chat team.",
            "example": "Agent",
            "examples": [
              "Agent"
            ]
          },
          "primaryEmailAddress": {
            "type": "string",
            "format": "email",
            "example": "alice@example.com",
            "examples": [
              "alice@example.com"
            ]
          },
          "mobileNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the client this user belongs to.",
            "example": "c1d2e3f4-a5b6-7890-c1d2-e3f4a5b67890",
            "examples": [
              "c1d2e3f4-a5b6-7890-c1d2-e3f4a5b67890"
            ]
          },
          "countryTimezone": {
            "type": "string",
            "description": "IANA timezone for the user, inherited from their client.",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "popiaComplianceEnabled": {
            "type": "boolean",
            "description": "Whether POPIA compliance is enabled for the user's client.",
            "example": false,
            "examples": [
              false
            ]
          },
          "disabled": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "deleted": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "ticketCount": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "resetPasswordEmailSent": {
            "type": "boolean",
            "description": "Whether a password-reset email has been sent to the user.",
            "example": false,
            "examples": [
              false
            ]
          },
          "emailVerified": {
            "type": "boolean",
            "description": "Whether the user has verified their email address.",
            "example": false,
            "examples": [
              false
            ]
          },
          "lastSeen": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "agentChatLimit": {
            "type": "integer",
            "format": "int64",
            "example": 5,
            "examples": [
              5
            ]
          },
          "availabilityStatus": {
            "type": "boolean",
            "description": "Whether the user is currently available for live-chat assignment.",
            "example": true,
            "examples": [
              true
            ]
          },
          "initialPassword": {
            "type": "boolean",
            "description": "true while the user still has a system-generated temporary password and must set their own on next login.",
            "example": false,
            "examples": [
              false
            ]
          },
          "tempAccount": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "tempPasswordValid": {
            "type": "boolean",
            "description": "Whether the user's temporary password is still valid (not yet expired or replaced).",
            "example": false,
            "examples": [
              false
            ]
          },
          "validToken": {
            "type": "boolean",
            "description": "Whether the user currently holds a valid session token.",
            "example": true,
            "examples": [
              true
            ]
          },
          "avatar": {
            "type": "string",
            "example": "https://example.com/avatars/alice.png",
            "examples": [
              "https://example.com/avatars/alice.png"
            ]
          },
          "shouldGetNotifications": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "applicationKey": {
            "type": "string",
            "example": "app-key-123",
            "examples": [
              "app-key-123"
            ]
          },
          "applicationClientId": {
            "type": "string",
            "example": "app-client-123",
            "examples": [
              "app-client-123"
            ]
          },
          "userId": {
            "type": "string",
            "example": "ext-user-123",
            "examples": [
              "ext-user-123"
            ]
          },
          "allowedSharedInbox": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "allowedUnassignedInbox": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "assignmentMessage": {
            "type": "string",
            "example": "Hi, I'm Alice and I'll be assisting you today.",
            "examples": [
              "Hi, I'm Alice and I'll be assisting you today."
            ]
          }
        }
      },
      "CreateUserRequest": {
        "type": "object",
        "description": "Request to create an organization user. Carries no credentials — the password is generated server-side as a one-time temporary value and returned once in the response. `role` and `apiKey` are assigned server-side.",
        "required": [
          "email"
        ],
        "properties": {
          "clientRef": {
            "type": "string",
            "description": "Target client. Defaults to the caller's own client when omitted.",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Jane",
            "examples": [
              "Jane"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "mobileNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "primaryEmailAddress": {
            "type": "string",
            "format": "email",
            "example": "jane@example.com",
            "examples": [
              "jane@example.com"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "Agent",
              "Supervisor"
            ],
            "example": "Agent",
            "examples": [
              "Agent"
            ]
          },
          "agentChatLimit": {
            "type": "integer",
            "format": "int64",
            "example": 5,
            "examples": [
              5
            ]
          },
          "allowedSharedInbox": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "allowedUnassignedInbox": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "shouldGetNotifications": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "assignmentMessage": {
            "type": "string",
            "example": "Hi, I'm Jane and I'll be assisting you today.",
            "examples": [
              "Hi, I'm Jane and I'll be assisting you today."
            ]
          },
          "applicationKey": {
            "type": "string",
            "example": "app-key-123",
            "examples": [
              "app-key-123"
            ]
          },
          "applicationClientId": {
            "type": "string",
            "example": "app-client-123",
            "examples": [
              "app-client-123"
            ]
          },
          "userId": {
            "type": "string",
            "example": "ext-user-123",
            "examples": [
              "ext-user-123"
            ]
          }
        }
      },
      "CreateUserResponse": {
        "type": "object",
        "description": "Result of creating a user. Carries a one-time `temporaryPassword` to hand over securely; the user is forced to set their own password on first login, after which it is unusable. This is the only place the API ever returns a password value.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "temporaryPassword": {
            "type": "string",
            "example": "tempab12cd34ef56",
            "examples": [
              "tempab12cd34ef56"
            ]
          },
          "message": {
            "type": "string",
            "example": "User created. Share the temporary password securely; the user must set a new password on first login.",
            "examples": [
              "User created. Share the temporary password securely; the user must set a new password on first login."
            ]
          }
        }
      },
      "UpdateUserRequest": {
        "type": "object",
        "description": "Request to update an organization user's profile, identified by `id`. Carries no credentials — password and apiKey can never be changed through this path. Primitive boolean flags follow PUT semantics: send the complete desired state.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901",
            "examples": [
              "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Jane",
            "examples": [
              "Jane"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "mobileNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "primaryEmailAddress": {
            "type": "string",
            "format": "email",
            "example": "jane@example.com",
            "examples": [
              "jane@example.com"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "Agent",
              "Supervisor"
            ],
            "example": "Agent",
            "examples": [
              "Agent"
            ]
          },
          "agentChatLimit": {
            "type": "integer",
            "format": "int64",
            "example": 5,
            "examples": [
              5
            ]
          },
          "disabled": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "availabilityStatus": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "allowedSharedInbox": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "allowedUnassignedInbox": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "shouldGetNotifications": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "assignmentMessage": {
            "type": "string",
            "example": "Hi, I'm Jane and I'll be assisting you today.",
            "examples": [
              "Hi, I'm Jane and I'll be assisting you today."
            ]
          },
          "applicationKey": {
            "type": "string",
            "example": "app-key-123",
            "examples": [
              "app-key-123"
            ]
          },
          "applicationClientId": {
            "type": "string",
            "example": "app-client-123",
            "examples": [
              "app-client-123"
            ]
          },
          "userId": {
            "type": "string",
            "example": "ext-user-123",
            "examples": [
              "ext-user-123"
            ]
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "description": "Lean, curated message payload returned by the v2 live-chat endpoints. Carries only the fields a chat UI needs, plus the quoted-reply context. Null fields are omitted.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8",
            "examples": [
              "c9d01234-e5f6-a7b8-c9d0-1234e5f6a7b8"
            ]
          },
          "tempId": {
            "type": "string",
            "description": "Temporary client-generated id used to correlate a send request with its response. Present only when the sender supplied one.",
            "example": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
            "examples": [
              "c9f0b308-1a0d-3f3f-7912-464f06677c6b"
            ]
          },
          "sequenceNumber": {
            "type": "integer",
            "format": "int64",
            "description": "Monotonic ordering hint within the conversation.",
            "example": 42,
            "examples": [
              42
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "OUTGOING",
              "INCOMING"
            ],
            "example": "INCOMING",
            "examples": [
              "INCOMING"
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "BUTTON",
              "CAROUSEL",
              "DROPDOWN",
              "IMAGE",
              "TEXT",
              "DATE",
              "FILE",
              "MEDIA",
              "LOCATION",
              "RATING"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "text": {
            "type": "string",
            "example": "Hello, I need help with my account.",
            "examples": [
              "Hello, I need help with my account."
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "userOriginated": {
            "type": "boolean",
            "description": "true when a human typed the message (agent or customer); false for bot-generated messages.",
            "example": true,
            "examples": [
              true
            ]
          },
          "messageOwner": {
            "type": "string",
            "enum": [
              "agent",
              "customer",
              "system"
            ],
            "example": "customer",
            "examples": [
              "customer"
            ]
          },
          "sender": {
            "type": "string",
            "description": "Address the message was sent from (e.g. the customer's phone number for inbound, the business number for outbound).",
            "example": "+27987654321",
            "examples": [
              "+27987654321"
            ]
          },
          "receiver": {
            "type": "string",
            "description": "Address the message was delivered to.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "ctId": {
            "type": "string",
            "description": "Custom tracking id for the message, if one was supplied on send.",
            "example": "order-1234-confirm",
            "examples": [
              "order-1234-confirm"
            ]
          },
          "sent": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "delivered": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "read": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "played": {
            "type": "boolean",
            "description": "True when a voice note was played (listened to) by the recipient.",
            "example": false,
            "examples": [
              false
            ]
          },
          "sentTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:01Z",
            "examples": [
              "2026-01-15T10:30:01Z"
            ]
          },
          "deliveredTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:05Z",
            "examples": [
              "2026-01-15T10:30:05Z"
            ]
          },
          "readTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:31:00Z",
            "examples": [
              "2026-01-15T10:31:00Z"
            ]
          },
          "playedTime": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp the voice note was played.",
            "example": "2026-01-15T10:31:30Z",
            "examples": [
              "2026-01-15T10:31:30Z"
            ]
          },
          "mediaURL": {
            "type": "string",
            "example": "https://example.com/media/photo.jpg",
            "examples": [
              "https://example.com/media/photo.jpg"
            ]
          },
          "fileExtension": {
            "type": "string",
            "description": "File extension of the attached media, when present.",
            "example": "jpg",
            "examples": [
              "jpg"
            ]
          },
          "mediaType": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "NULL",
              "BUTTON",
              "FILE",
              "AUDIO",
              "VOICE"
            ],
            "example": "IMAGE",
            "examples": [
              "IMAGE"
            ]
          },
          "latitude": {
            "type": "string",
            "example": "-26.2041",
            "examples": [
              "-26.2041"
            ]
          },
          "longitude": {
            "type": "string",
            "example": "28.0473",
            "examples": [
              "28.0473"
            ]
          },
          "address": {
            "type": "string",
            "example": "123 Main St, Johannesburg",
            "examples": [
              "123 Main St, Johannesburg"
            ]
          },
          "label": {
            "type": "string",
            "example": "Head Office",
            "examples": [
              "Head Office"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/AgentSummary"
          },
          "reaction": {
            "$ref": "#/components/schemas/Reaction"
          },
          "whatsAppMessageId": {
            "type": "string",
            "description": "Provider (WhatsApp) message id.",
            "example": "3EB09839C39C57F54A9EC5",
            "examples": [
              "3EB09839C39C57F54A9EC5"
            ]
          },
          "facebookMessageId": {
            "type": "string",
            "description": "Provider (Facebook) message id.",
            "example": "m_AbCdEf123456",
            "examples": [
              "m_AbCdEf123456"
            ]
          },
          "quotedExternalMessageId": {
            "type": "string",
            "description": "WhatsApp id of the message this one replies to/quotes (present when the message is a reply).",
            "example": "3EB0123456789ABCDEF0",
            "examples": [
              "3EB0123456789ABCDEF0"
            ]
          },
          "quotedText": {
            "type": "string",
            "description": "Snapshot of the quoted message's text, captured at reply time.",
            "example": "Hi, is this about order #1234?",
            "examples": [
              "Hi, is this about order #1234?"
            ]
          }
        }
      },
      "SendMessageRequest": {
        "type": "object",
        "description": "Agent send request used by the unified v2 send endpoint. Routing is by `channel`.",
        "required": [
          "participantId",
          "channel"
        ],
        "properties": {
          "participantId": {
            "type": "string",
            "format": "uuid",
            "description": "Chat participant to send to.",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "description": "Channel to route the message on.",
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "tempId": {
            "type": "string",
            "description": "Optional. Client-generated id echoed back on the response to correlate an optimistic UI message. Omit it if you don't need correlation.",
            "example": "c9f0b308-1a0d-3f3f-7912-464f06677c6b",
            "examples": [
              "c9f0b308-1a0d-3f3f-7912-464f06677c6b"
            ]
          },
          "text": {
            "type": "string",
            "description": "Message text, or the caption for a media send.",
            "example": "Thanks for reaching out — how can I help?",
            "examples": [
              "Thanks for reaching out — how can I help?"
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "TEXT",
              "MEDIA"
            ],
            "description": "Optional. Defaults to TEXT, or MEDIA when a mediaUrl is present.",
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "mediaUrl": {
            "type": "string",
            "description": "Hosted media URL from the media upload endpoint. Its presence makes this a media send.",
            "example": "https://cdn.example.com/uploads/quote-1234.pdf",
            "examples": [
              "https://cdn.example.com/uploads/quote-1234.pdf"
            ]
          },
          "mediaType": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "NULL",
              "BUTTON",
              "FILE",
              "AUDIO",
              "VOICE"
            ],
            "description": "Media kind (from the upload response).",
            "example": "DOCUMENT",
            "examples": [
              "DOCUMENT"
            ]
          },
          "quotedExternalMessageId": {
            "type": "string",
            "description": "WhatsApp id of a message being quoted/replied to.",
            "example": "3EB0123456789ABCDEF0",
            "examples": [
              "3EB0123456789ABCDEF0"
            ]
          },
          "quotedText": {
            "type": "string",
            "description": "Snapshot of the quoted message's text.",
            "example": "Hi, is this about order #1234?",
            "examples": [
              "Hi, is this about order #1234?"
            ]
          }
        }
      },
      "MediaUploadResponse": {
        "type": "object",
        "description": "Result of uploading a media file for a v2 send.",
        "properties": {
          "mediaUrl": {
            "type": "string",
            "description": "Hosted URL of the stored media. Pass this as `mediaUrl` on the send request.",
            "example": "https://cdn.example.com/uploads/quote-1234.pdf",
            "examples": [
              "https://cdn.example.com/uploads/quote-1234.pdf"
            ]
          },
          "mediaType": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "NULL",
              "BUTTON",
              "FILE",
              "AUDIO",
              "VOICE"
            ],
            "description": "Detected media kind.",
            "example": "DOCUMENT",
            "examples": [
              "DOCUMENT"
            ]
          }
        }
      },
      "TicketStatus": {
        "type": "string",
        "enum": [
          "OPEN",
          "CLOSED",
          "AWAITING_AGENT",
          "AWAITING_CUSTOMER",
          "RESOLVED"
        ],
        "example": "OPEN",
        "examples": [
          "OPEN"
        ]
      },
      "TicketEmailDto": {
        "type": "object",
        "description": "Ticket DTO. Null fields are omitted from the response.",
        "properties": {
          "id": {
            "type": "string",
            "example": "64a1b2c3d4e5f67890abcdef",
            "examples": [
              "64a1b2c3d4e5f67890abcdef"
            ]
          },
          "from": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "assignedAgentId": {
            "type": "string",
            "example": "agent-001",
            "examples": [
              "agent-001"
            ]
          },
          "participant": {
            "$ref": "#/components/schemas/ChatParticipant"
          },
          "customerName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "recipient1@example.com",
              "recipient2@example.com"
            ],
            "examples": [
              [
                "recipient1@example.com",
                "recipient2@example.com"
              ]
            ]
          },
          "content": {
            "type": "string",
            "example": "Ticket content details",
            "examples": [
              "Ticket content details"
            ]
          },
          "ticketNumber": {
            "type": "string",
            "example": "TICKET-12345",
            "examples": [
              "TICKET-12345"
            ]
          },
          "team": {
            "type": "string",
            "example": "team-001",
            "examples": [
              "team-001"
            ]
          },
          "teamName": {
            "type": "string",
            "example": "Support Team",
            "examples": [
              "Support Team"
            ]
          },
          "date": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "rating": {
            "type": "string",
            "example": "5",
            "examples": [
              "5"
            ]
          },
          "priority": {
            "type": "string",
            "example": "HIGH",
            "examples": [
              "HIGH"
            ]
          },
          "conversationMessages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "conversationMessagesJson": {
            "type": "string",
            "description": "JSON representation of conversation messages.",
            "example": "[{\"text\":\"Hello\"}]",
            "examples": [
              "[{\"text\":\"Hello\"}]"
            ]
          },
          "emailFrom": {
            "type": "string",
            "example": "support@example.com",
            "examples": [
              "support@example.com"
            ]
          },
          "emailSubject": {
            "type": "string",
            "example": "Billing Inquiry",
            "examples": [
              "Billing Inquiry"
            ]
          },
          "emailBody": {
            "type": "string",
            "example": "Dear customer, ...",
            "examples": [
              "Dear customer, ..."
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "ticketStatus": {
            "$ref": "#/components/schemas/TicketStatus"
          },
          "clientWhatsappNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "customerWhatsappNumber": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "customerEmail": {
            "type": "string",
            "example": "john.doe@example.com",
            "examples": [
              "john.doe@example.com"
            ]
          },
          "includeChatHistory": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "TicketEmailEntity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "64a1b2c3d4e5f67890abcdef",
            "examples": [
              "64a1b2c3d4e5f67890abcdef"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T08:00:00Z",
            "examples": [
              "2026-01-15T08:00:00Z"
            ]
          },
          "from": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "assignedAgentId": {
            "type": "string",
            "example": "agent-001",
            "examples": [
              "agent-001"
            ]
          },
          "chatParticipant": {
            "$ref": "#/components/schemas/ChatParticipant"
          },
          "customerName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "emailToCustomer": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "emailToSupervisor": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "emailToAgent": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "content": {
            "type": "string",
            "example": "Ticket content details",
            "examples": [
              "Ticket content details"
            ]
          },
          "ticketNumber": {
            "type": "string",
            "example": "TICKET-12345",
            "examples": [
              "TICKET-12345"
            ]
          },
          "team": {
            "type": "string",
            "example": "team-001",
            "examples": [
              "team-001"
            ]
          },
          "teamName": {
            "type": "string",
            "example": "Support Team",
            "examples": [
              "Support Team"
            ]
          },
          "date": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "rating": {
            "type": "string",
            "example": "5",
            "examples": [
              "5"
            ]
          },
          "priority": {
            "type": "string",
            "example": "HIGH",
            "examples": [
              "HIGH"
            ]
          },
          "conversationMessages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "conversationMessagesJson": {
            "type": "string",
            "description": "JSONB representation of conversation messages.",
            "example": "[{\"text\":\"Hello\"}]",
            "examples": [
              "[{\"text\":\"Hello\"}]"
            ]
          },
          "emailFrom": {
            "type": "string",
            "example": "support@example.com",
            "examples": [
              "support@example.com"
            ]
          },
          "emailSubject": {
            "type": "string",
            "example": "Billing Inquiry",
            "examples": [
              "Billing Inquiry"
            ]
          },
          "emailBody": {
            "type": "string",
            "example": "Dear customer, ...",
            "examples": [
              "Dear customer, ..."
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "clientWhatsappNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "customerWhatsappNumber": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "customerEmail": {
            "type": "string",
            "example": "john.doe@example.com",
            "examples": [
              "john.doe@example.com"
            ]
          },
          "ticketStatus": {
            "$ref": "#/components/schemas/TicketStatus"
          },
          "includeChatHistory": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "userFacebookId": {
            "type": "string",
            "example": "fb-user-12345",
            "examples": [
              "fb-user-12345"
            ]
          }
        }
      },
      "TicketEmailDtoPage": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketEmailDto"
            }
          },
          "totalElements": {
            "type": "integer",
            "example": 85,
            "examples": [
              85
            ]
          },
          "totalPages": {
            "type": "integer",
            "example": 9,
            "examples": [
              9
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "BatchExecutionControlRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "batchId": {
            "type": "string",
            "description": "Targets a specific batch.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
            "examples": [
              "f47ac10b-58cc-4372-a567-0e02b2c3d479"
            ]
          },
          "senderId": {
            "type": "string",
            "description": "If no batchId, targets all batches for this sender.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "action": {
            "type": "string",
            "enum": [
              "PAUSE",
              "RESUME",
              "CANCEL"
            ],
            "example": "PAUSE",
            "examples": [
              "PAUSE"
            ]
          }
        }
      },
      "WhatsAppNotificationAnalytics": {
        "type": "object",
        "properties": {
          "notificationSubmitted": {
            "type": "integer",
            "example": 40219,
            "examples": [
              40219
            ]
          },
          "notificationQueued": {
            "type": "integer",
            "example": 157,
            "examples": [
              157
            ]
          },
          "notificationAccepted": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "notificationSent": {
            "type": "integer",
            "example": 1,
            "examples": [
              1
            ]
          },
          "notificationDelivered": {
            "type": "integer",
            "example": 30,
            "examples": [
              30
            ]
          },
          "notificationRead": {
            "type": "integer",
            "example": 18,
            "examples": [
              18
            ]
          },
          "notificationFailed": {
            "type": "integer",
            "example": 40013,
            "examples": [
              40013
            ]
          },
          "notificationThrottled": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "noRecipients": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "invalidRecipients": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "notWhatsAppRegisteredRecipients": {
            "type": "integer",
            "example": 12,
            "examples": [
              12
            ]
          },
          "messageUndeliverable": {
            "type": "integer",
            "example": 40001,
            "examples": [
              40001
            ]
          },
          "duplicateRecipients": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "blacklistedRecipients": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "blockedRecipients": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "unknownError": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "failedSending": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "noSession": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "serverNotAvailable": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "other": {
            "type": "integer",
            "example": 157,
            "examples": [
              157
            ]
          }
        }
      },
      "WhatsAppInteractionAnalytics": {
        "type": "object",
        "properties": {
          "interactionSubmitted": {
            "type": "integer",
            "example": 500,
            "examples": [
              500
            ]
          },
          "interactionSent": {
            "type": "integer",
            "example": 490,
            "examples": [
              490
            ]
          },
          "interactionDelivered": {
            "type": "integer",
            "example": 475,
            "examples": [
              475
            ]
          },
          "interactionRead": {
            "type": "integer",
            "example": 400,
            "examples": [
              400
            ]
          },
          "interactionFailed": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          }
        }
      },
      "NotificationAnalyticsResponse": {
        "type": "object",
        "description": "Each message is counted once, under its latest status.",
        "properties": {
          "submitted": {
            "type": "integer",
            "format": "int64",
            "description": "All notifications in the range",
            "example": 40219,
            "examples": [
              40219
            ]
          },
          "accepted": {
            "type": "integer",
            "format": "int64",
            "description": "Accepted by the provider, not yet sent",
            "example": 0,
            "examples": [
              0
            ]
          },
          "sent": {
            "type": "integer",
            "format": "int64",
            "description": "Sent, not yet delivered",
            "example": 1,
            "examples": [
              1
            ]
          },
          "delivered": {
            "type": "integer",
            "format": "int64",
            "description": "Delivered, not yet read",
            "example": 30,
            "examples": [
              30
            ]
          },
          "read": {
            "type": "integer",
            "format": "int64",
            "description": "Read (or played, for voice notes)",
            "example": 18,
            "examples": [
              18
            ]
          },
          "failed": {
            "type": "integer",
            "format": "int64",
            "example": 40013,
            "examples": [
              40013
            ]
          },
          "throttled": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "queued": {
            "type": "integer",
            "format": "int64",
            "description": "Queued or scheduled",
            "example": 157,
            "examples": [
              157
            ]
          },
          "noRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "invalidRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "notWhatsAppRegisteredRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 12,
            "examples": [
              12
            ]
          },
          "messageUndeliverable": {
            "type": "integer",
            "format": "int64",
            "example": 40001,
            "examples": [
              40001
            ]
          },
          "duplicateRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "blacklistedRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "blockedRecipients": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "unknownError": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "failedSending": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "noSession": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "serverNotAvailable": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          },
          "other": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "examples": [
              0
            ]
          }
        }
      },
      "MessageStatusAnalyticsResponse": {
        "type": "object",
        "description": "Each message is counted once, under its latest status.",
        "properties": {
          "submitted": {
            "type": "integer",
            "format": "int64",
            "description": "All messages in the range",
            "example": 500,
            "examples": [
              500
            ]
          },
          "sent": {
            "type": "integer",
            "format": "int64",
            "description": "Sent, not yet delivered",
            "example": 15,
            "examples": [
              15
            ]
          },
          "delivered": {
            "type": "integer",
            "format": "int64",
            "description": "Delivered, not yet read",
            "example": 75,
            "examples": [
              75
            ]
          },
          "read": {
            "type": "integer",
            "format": "int64",
            "description": "Read (or played, for voice notes); includes incoming messages",
            "example": 400,
            "examples": [
              400
            ]
          },
          "failed": {
            "type": "integer",
            "format": "int64",
            "example": 10,
            "examples": [
              10
            ]
          }
        }
      },
      "BillingCostWrapper": {
        "type": "object",
        "properties": {
          "session24HourCost": {
            "type": "number",
            "example": 0.5,
            "examples": [
              0.5
            ]
          },
          "notificationCost": {
            "type": "number",
            "example": 0.75,
            "examples": [
              0.75
            ]
          },
          "conversationCost": {
            "type": "number",
            "example": 0.3,
            "examples": [
              0.3
            ]
          },
          "userInitiatedConversationCost": {
            "type": "number",
            "example": 0.25,
            "examples": [
              0.25
            ]
          },
          "businessInitiatedConversationCost": {
            "type": "number",
            "example": 0.4,
            "examples": [
              0.4
            ]
          },
          "utilityConversationCost": {
            "type": "number",
            "example": 0.35,
            "examples": [
              0.35
            ]
          },
          "authenticationConversationCost": {
            "type": "number",
            "example": 0.2,
            "examples": [
              0.2
            ]
          },
          "marketingConversationCost": {
            "type": "number",
            "example": 0.85,
            "examples": [
              0.85
            ]
          },
          "serviceConversationCost": {
            "type": "number",
            "example": 0.3,
            "examples": [
              0.3
            ]
          },
          "smsCost": {
            "type": "number",
            "example": 0.15,
            "examples": [
              0.15
            ]
          }
        }
      },
      "BalanceResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "string",
            "example": "0",
            "examples": [
              "0"
            ]
          },
          "statusDescription": {
            "type": "string",
            "example": "Success",
            "examples": [
              "Success"
            ]
          },
          "userid": {
            "type": "string",
            "example": "user-abc123",
            "examples": [
              "user-abc123"
            ]
          },
          "currentBalance": {
            "type": "string",
            "example": "500.00",
            "examples": [
              "500.00"
            ]
          }
        }
      },
      "BalanceHistoryEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "examples": [
              "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "previousBalance": {
            "type": "number",
            "example": 550,
            "examples": [
              550
            ]
          },
          "newBalance": {
            "type": "number",
            "example": 500,
            "examples": [
              500
            ]
          },
          "amount": {
            "type": "number",
            "example": 50,
            "examples": [
              50
            ]
          },
          "transactionType": {
            "type": "string",
            "example": "DEBIT",
            "examples": [
              "DEBIT"
            ]
          },
          "description": {
            "type": "string",
            "example": "WhatsApp notification messages - 100 messages",
            "examples": [
              "WhatsApp notification messages - 100 messages"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          }
        }
      },
      "SessionRequest": {
        "type": "object",
        "required": [
          "whatsAppNumber"
        ],
        "properties": {
          "whatsAppNumber": {
            "type": "string",
            "example": "+27665359699",
            "examples": [
              "+27665359699"
            ]
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "description": "Optional. Defaults to current user's client.",
            "example": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
            "examples": [
              "dbdb8809-6fd0-4cd2-8574-502f0f61a69d"
            ]
          }
        }
      },
      "WebhookReq": {
        "type": "object",
        "required": [
          "whatsAppNumber",
          "webhook"
        ],
        "properties": {
          "whatsAppNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "webhook": {
            "type": "string",
            "example": "https://yourserver.com/webhooks/whatsapp-lite",
            "examples": [
              "https://yourserver.com/webhooks/whatsapp-lite"
            ]
          }
        }
      },
      "WhatsAppGoResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 200,
            "examples": [
              200
            ]
          },
          "error": {
            "type": "string",
            "example": "",
            "examples": [
              ""
            ]
          },
          "success": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "details": {
                "type": "string",
                "example": "Connected!",
                "examples": [
                  "Connected!"
                ]
              },
              "events": {
                "type": "string",
                "example": "All",
                "examples": [
                  "All"
                ]
              },
              "jid": {
                "type": "string",
                "example": "27123456789:9@s.whatsapp.net",
                "examples": [
                  "27123456789:9@s.whatsapp.net"
                ]
              },
              "token": {
                "type": "string",
                "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                "examples": [
                  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                ]
              },
              "webhook": {
                "type": "string",
                "example": "https://yourserver.com/webhooks/whatsapp-lite",
                "examples": [
                  "https://yourserver.com/webhooks/whatsapp-lite"
                ]
              },
              "Connected": {
                "type": "boolean",
                "example": true,
                "examples": [
                  true
                ]
              },
              "LoggedIn": {
                "type": "boolean",
                "example": true,
                "examples": [
                  true
                ]
              },
              "Status": {
                "type": "string",
                "example": "Waiting for QR Code Scan",
                "examples": [
                  "Waiting for QR Code Scan"
                ]
              },
              "QRCode": {
                "type": "string",
                "description": "Base64 QR code image.",
                "example": "data:image/png;base64,iVBORw0KGgo...",
                "examples": [
                  "data:image/png;base64,iVBORw0KGgo..."
                ]
              },
              "LinkingCode": {
                "type": "string",
                "description": "8-char pairing code.",
                "example": "JJGR-P1EZ",
                "examples": [
                  "JJGR-P1EZ"
                ]
              },
              "Contacts": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/WhatsAppGoContact"
                }
              }
            }
          }
        }
      },
      "WhatsAppGoContact": {
        "type": "object",
        "properties": {
          "found": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "firstName": {
            "type": "string",
            "example": "John",
            "examples": [
              "John"
            ]
          },
          "fullName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "pushName": {
            "type": "string",
            "example": "JD",
            "examples": [
              "JD"
            ]
          },
          "businessName": {
            "type": "string",
            "example": "Acme Corp",
            "examples": [
              "Acme Corp"
            ]
          }
        }
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
            "examples": [
              "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789"
            ]
          },
          "groupJID": {
            "type": "string",
            "example": "120363045678901234@g.us",
            "examples": [
              "120363045678901234@g.us"
            ]
          },
          "groupName": {
            "type": "string",
            "example": "Team Chat",
            "examples": [
              "Team Chat"
            ]
          },
          "groupTopic": {
            "type": "string",
            "example": "Project discussions and updates",
            "examples": [
              "Project discussions and updates"
            ]
          },
          "number": {
            "type": "string",
            "description": "WhatsApp number that owns this group.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "countryCode": {
            "type": "string",
            "example": "ZA",
            "examples": [
              "ZA"
            ]
          },
          "locked": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "announce": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "memberAddMode": {
            "type": "string",
            "example": "all_member_add",
            "examples": [
              "all_member_add"
            ]
          },
          "pinned": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "archive": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "joinNodeId": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID of the flow/node to trigger when a member joins.",
            "example": null,
            "examples": [
              null
            ]
          },
          "leaveNodeId": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID of the flow/node to trigger when a member leaves.",
            "example": null,
            "examples": [
              null
            ]
          },
          "clientRef": {
            "type": "string",
            "description": "Client reference (set by server).",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "inviteLink": {
            "type": [
              "string",
              "null"
            ],
            "description": "Group invite link (read-only).",
            "example": "https://chat.whatsapp.com/AbCdEfGhIjKlMn",
            "examples": [
              "https://chat.whatsapp.com/AbCdEfGhIjKlMn"
            ]
          },
          "createdBy": {
            "type": [
              "string",
              "null"
            ],
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-10T08:00:00Z",
            "examples": [
              "2026-01-10T08:00:00Z"
            ]
          },
          "updatedBy": {
            "type": [
              "string",
              "null"
            ],
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "resetAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": null,
            "examples": [
              null
            ]
          },
          "resetBy": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          }
        }
      },
      "GroupSummarySettingsRequest": {
        "type": "object",
        "required": [
          "enabled",
          "quietMinutes",
          "format",
          "longMode",
          "minMessages"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "quietMinutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440,
            "description": "Summarise once nobody has written for this many minutes.",
            "example": 30,
            "examples": [
              30
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "TEXT",
              "JSON"
            ],
            "description": "`TEXT` sends a plain-text summary; `JSON` sends an object (see `GroupSummaryJson`).",
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "longMode": {
            "type": "string",
            "enum": [
              "NONE",
              "MAX_HOURS",
              "MAX_MESSAGES"
            ],
            "description": "What else ends a conversation that never goes quiet.",
            "example": "NONE",
            "examples": [
              "NONE"
            ]
          },
          "longLimit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Hours (1–48) for `MAX_HOURS`, messages (10–1000) for `MAX_MESSAGES`. Ignored for `NONE`.",
            "example": null,
            "examples": [
              null,
              4,
              200
            ]
          },
          "minMessages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Conversations shorter than this wait for the next one.",
            "example": 3,
            "examples": [
              3
            ]
          },
          "sendShortAfterHours": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 168,
            "description": "Summarise a conversation shorter than `minMessages` anyway once its first message is this many hours old. Null waits for more messages. Defaults to 24 for a group never set up.",
            "example": 24,
            "examples": [
              24,
              null
            ]
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 2048,
            "description": "Your API. Public `https://` only. Null clears it, which is only allowed while summaries are off.",
            "example": "https://api.example.com/group-summaries",
            "examples": [
              "https://api.example.com/group-summaries"
            ]
          },
          "webhookApiKey": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024,
            "writeOnly": true,
            "description": "Optional. Sent in the `Authorization` header with every summary. Omit or leave blank to keep the saved key.",
            "example": "sk_live_4f9a2c7e1b",
            "examples": [
              "sk_live_4f9a2c7e1b"
            ]
          },
          "removeWebhookApiKey": {
            "type": "boolean",
            "default": false,
            "description": "`true` deletes the saved key, so summaries are sent without an `Authorization` header. Wins over `webhookApiKey`.",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      },
      "GroupSummarySettings": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "format": "uuid",
            "example": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
            "examples": [
              "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "Whether AI summaries are switched on for your account.",
            "example": true,
            "examples": [
              true
            ]
          },
          "enabled": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "quietMinutes": {
            "type": "integer",
            "example": 30,
            "examples": [
              30
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "TEXT",
              "JSON"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "longMode": {
            "type": "string",
            "enum": [
              "NONE",
              "MAX_HOURS",
              "MAX_MESSAGES"
            ],
            "example": "NONE",
            "examples": [
              "NONE"
            ]
          },
          "longLimit": {
            "type": [
              "integer",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "minMessages": {
            "type": "integer",
            "example": 3,
            "examples": [
              3
            ]
          },
          "sendShortAfterHours": {
            "type": [
              "integer",
              "null"
            ],
            "example": 24,
            "examples": [
              24,
              null
            ]
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ],
            "example": "https://api.example.com/group-summaries",
            "examples": [
              "https://api.example.com/group-summaries"
            ]
          },
          "hasApiKey": {
            "type": "boolean",
            "description": "Whether an API key is saved. The key itself is never returned.",
            "example": true,
            "examples": [
              true
            ]
          }
        }
      },
      "GroupSummaryDelivery": {
        "type": "object",
        "description": "What eCommunicate `POST`s to your `webhookUrl` for each summarised conversation.",
        "required": [
          "summaryId",
          "clientRef",
          "groupJid",
          "windowStart",
          "windowEnd",
          "messageCount",
          "format",
          "summary"
        ],
        "properties": {
          "summaryId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique per summary; also sent as `X-Idempotency-Key`.",
            "example": "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04",
            "examples": [
              "6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "groupJid": {
            "type": "string",
            "example": "120363045678901234@g.us",
            "examples": [
              "120363045678901234@g.us"
            ]
          },
          "groupName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The group's name when the summary was sent.",
            "example": "Printer support",
            "examples": [
              "Printer support"
            ]
          },
          "windowStart": {
            "type": "string",
            "format": "date-time",
            "description": "UTC. Exclusive: the last message of the previous summary, or when summaries were switched on.",
            "example": "2026-11-19T07:00:00Z",
            "examples": [
              "2026-11-19T07:00:00Z"
            ]
          },
          "windowEnd": {
            "type": "string",
            "format": "date-time",
            "description": "UTC. The newest message included.",
            "example": "2026-11-19T07:42:13.518Z",
            "examples": [
              "2026-11-19T07:42:13.518Z"
            ]
          },
          "messageCount": {
            "type": "integer",
            "description": "Messages in the window, attachments included.",
            "example": 14,
            "examples": [
              14
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "TEXT",
              "JSON"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "summary": {
            "description": "A plain-text summary when `format` is `TEXT`; a `GroupSummaryJson` object when it is `JSON`.",
            "oneOf": [
              {
                "type": "string",
                "example": "Issues\n- Toner low (raised by Carol): Open",
                "examples": [
                  "Issues\n- Toner low (raised by Carol): Open"
                ]
              },
              {
                "$ref": "#/components/schemas/GroupSummaryJson"
              }
            ]
          }
        }
      },
      "GroupSummaryJson": {
        "type": "object",
        "required": [
          "summary",
          "issues",
          "actionItems",
          "participants"
        ],
        "properties": {
          "summary": {
            "type": "string",
            "description": "Two or three sentences on what the conversation was about and where it stands.",
            "example": "The floor 3 printer jammed and was fixed; toner is still low.",
            "examples": [
              "The floor 3 printer jammed and was fixed; toner is still low."
            ]
          },
          "issues": {
            "type": "array",
            "description": "Each distinct issue raised, oldest first.",
            "items": {
              "type": "object",
              "required": [
                "title",
                "raisedBy",
                "resolution",
                "status"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "example": "Toner low",
                  "examples": [
                    "Toner low"
                  ]
                },
                "raisedBy": {
                  "type": "string",
                  "description": "Name as shown in the group; never a phone number.",
                  "example": "Carol",
                  "examples": [
                    "Carol"
                  ]
                },
                "resolution": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "How it was resolved and by whom; null while open.",
                  "example": null,
                  "examples": [
                    null,
                    "Bob cleared the paper tray."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "RESOLVED",
                    "OPEN"
                  ],
                  "example": "OPEN",
                  "examples": [
                    "OPEN"
                  ]
                }
              }
            }
          },
          "actionItems": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "description",
                "owner"
              ],
              "properties": {
                "description": {
                  "type": "string",
                  "example": "Order toner",
                  "examples": [
                    "Order toner"
                  ]
                },
                "owner": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Null when the chat names nobody.",
                  "example": "Facilities",
                  "examples": [
                    "Facilities"
                  ]
                }
              }
            }
          },
          "participants": {
            "type": "array",
            "description": "Names of everyone who wrote in the conversation.",
            "items": {
              "type": "string",
              "example": "Alice",
              "examples": [
                "Alice"
              ]
            }
          }
        }
      },
      "GroupMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "d0e1f2a3-b4c5-6789-d0e1-f2a3b4c56789",
            "examples": [
              "d0e1f2a3-b4c5-6789-d0e1-f2a3b4c56789"
            ]
          },
          "groupId": {
            "type": "string",
            "description": "ID of the group this message belongs to.",
            "example": "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789",
            "examples": [
              "c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789"
            ]
          },
          "senderName": {
            "type": [
              "string",
              "null"
            ],
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "senderNumber": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "message": {
            "type": "string",
            "example": "Meeting at 3pm today.",
            "examples": [
              "Meeting at 3pm today."
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "TEXT",
              "IMAGE",
              "DOCUMENT",
              "VIDEO",
              "AUDIO",
              "VOICE",
              "LOCATION",
              "FILE",
              "BUTTON",
              "CAROUSEL",
              "DROPDOWN",
              "DATE",
              "MEDIA",
              "RATING"
            ],
            "example": "TEXT",
            "examples": [
              "TEXT"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "OUTGOING",
              "INCOMING"
            ],
            "example": "OUTGOING",
            "examples": [
              "OUTGOING"
            ]
          },
          "mediaType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "DOCUMENT",
              "IMAGE",
              "VIDEO",
              "AUDIO",
              "VOICE",
              "BUTTON",
              "FILE",
              null
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "caption": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "mimetype": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "fileSize": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "fileExtension": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "WHATSAPP",
              "WEB",
              "FACEBOOK"
            ],
            "example": "WHATSAPP",
            "examples": [
              "WHATSAPP"
            ]
          },
          "mediaUrl": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "sent": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-01-15T10:30:01Z",
            "examples": [
              "2026-01-15T10:30:01Z"
            ]
          },
          "delivered": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": null,
            "examples": [
              null
            ]
          },
          "read": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "readAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": null,
            "examples": [
              null
            ]
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ],
            "description": "WhatsApp message ID.",
            "example": "3EB0B430A7C9D1F2",
            "examples": [
              "3EB0B430A7C9D1F2"
            ]
          },
          "reactions": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Reaction"
            },
            "example": [],
            "examples": [
              []
            ]
          },
          "previewTitle": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "previewDescription": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "previewUrl": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "previewImageUrl": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          }
        }
      },
      "Reaction": {
        "type": "object",
        "properties": {
          "reactorName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "reactorNumber": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "reactionEmoji": {
            "type": "string",
            "example": "👍",
            "examples": [
              "👍"
            ]
          }
        }
      },
      "MessageProcessingConfig": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
            "examples": [
              "1d368c30-c9f8-4523-b8c2-3824ba72ff5c"
            ]
          },
          "clientNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "MyClient",
            "examples": [
              "MyClient"
            ]
          },
          "clientTimezone": {
            "type": "string",
            "example": "Africa/Johannesburg",
            "examples": [
              "Africa/Johannesburg"
            ]
          },
          "maxMessagesPerMinute": {
            "type": "integer",
            "default": 6,
            "description": "Maximum messages sent per minute.",
            "example": 6,
            "examples": [
              6
            ]
          },
          "minMsgDelaySeconds": {
            "type": "integer",
            "default": 5,
            "description": "**WhatsApp Lite only.** Minimum delay between individual messages (seconds).",
            "example": 5,
            "examples": [
              5
            ]
          },
          "maxMsgDelaySeconds": {
            "type": "integer",
            "default": 10,
            "description": "**WhatsApp Lite only.** Maximum delay between individual messages (seconds).",
            "example": 10,
            "examples": [
              10
            ]
          },
          "batchSize": {
            "type": "integer",
            "default": 20,
            "description": "**WhatsApp Lite only.** Number of messages per batch.",
            "example": 20,
            "examples": [
              20
            ]
          },
          "minBatchDelayMinutes": {
            "type": "integer",
            "default": 15,
            "description": "**WhatsApp Lite only.** Minimum delay between batches (minutes).",
            "example": 15,
            "examples": [
              15
            ]
          },
          "maxBatchDelayMinutes": {
            "type": "integer",
            "default": 30,
            "description": "**WhatsApp Lite only.** Maximum delay between batches (minutes).",
            "example": 30,
            "examples": [
              30
            ]
          },
          "batchSuccessLimit": {
            "type": "integer",
            "default": 0,
            "description": "**WhatsApp Lite only.** Stop batch after this many successes (0 = unlimited).",
            "example": 0,
            "examples": [
              0
            ]
          },
          "dailySchedules": {
            "type": "object",
            "description": "Send window per day of week. Keys: MONDAY–SUNDAY.",
            "additionalProperties": {
              "$ref": "#/components/schemas/DailySchedule"
            }
          }
        }
      },
      "DailySchedule": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether sending is allowed on this day.",
            "example": true,
            "examples": [
              true
            ]
          },
          "resumeTime": {
            "type": "string",
            "description": "Start of send window (HH:MM format).",
            "example": "08:00",
            "examples": [
              "08:00"
            ]
          },
          "stopTime": {
            "type": "string",
            "description": "End of send window (HH:MM format).",
            "example": "20:00",
            "examples": [
              "20:00"
            ]
          }
        }
      },
      "SystemUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890",
            "examples": [
              "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890"
            ]
          },
          "email": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "password": {
            "type": "string",
            "format": "password",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "tempPassword": {
            "type": [
              "string",
              "null"
            ],
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "CLIENT"
            ],
            "example": "CLIENT",
            "examples": [
              "CLIENT"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "SUPERVISOR",
              "AGENT"
            ],
            "example": "AGENT",
            "examples": [
              "AGENT"
            ]
          },
          "primaryEmailAddress": {
            "type": [
              "string",
              "null"
            ],
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "mobileNumber": {
            "type": [
              "string",
              "null"
            ],
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "sentLowerCreditLimitMail": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "sentZeroCreditMail": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "apiKey": {
            "type": "string",
            "example": "64a1b2c3d4e5f67890abcdef",
            "examples": [
              "64a1b2c3d4e5f67890abcdef"
            ]
          },
          "disabled": {
            "type": "boolean",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          },
          "deleted": {
            "type": "boolean",
            "default": false,
            "example": false,
            "examples": [
              false
            ]
          },
          "emailVerificationKey": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "passwordResetKey": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "inactivityNodeId": {
            "type": [
              "string",
              "null"
            ],
            "example": "node-inactivity-001",
            "examples": [
              "node-inactivity-001"
            ]
          },
          "publicHolidayInactivityNodeId": {
            "type": [
              "string",
              "null"
            ],
            "example": "node-holiday-001",
            "examples": [
              "node-holiday-001"
            ]
          },
          "officeClosedInactivityNodeId": {
            "type": [
              "string",
              "null"
            ],
            "example": "node-closed-001",
            "examples": [
              "node-closed-001"
            ]
          },
          "autoResponseNodeId": {
            "type": [
              "string",
              "null"
            ],
            "example": "node-auto-001",
            "examples": [
              "node-auto-001"
            ]
          },
          "client": {
            "$ref": "#/components/schemas/Client"
          },
          "clientRef": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "ticketCount": {
            "type": [
              "integer",
              "null"
            ],
            "example": 5,
            "examples": [
              5
            ]
          },
          "lastSeen": {
            "type": [
              "string",
              "null"
            ],
            "example": null,
            "examples": [
              null
            ]
          },
          "resetPasswordEmailSent": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "emailVerified": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "firstName": {
            "type": "string",
            "example": "Jane",
            "examples": [
              "Jane"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "agentChatLimit": {
            "type": "integer",
            "description": "Max concurrent chats.",
            "example": 5,
            "examples": [
              5
            ]
          },
          "availabilityStatus": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "initialPassword": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "tempAccount": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "loginToken": {
            "type": "string",
            "example": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
            "examples": [
              "1d368c30-c9f8-4523-b8c2-3824ba72ff5c"
            ]
          },
          "validToken": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "avatar": {
            "type": "string",
            "example": "https://example.com/avatars/jane.jpg",
            "examples": [
              "https://example.com/avatars/jane.jpg"
            ]
          },
          "shouldGetNotifications": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "applicationKey": {
            "type": "string",
            "example": "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012",
            "examples": [
              "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012"
            ]
          },
          "userId": {
            "type": "string",
            "example": "21c28d3e-bc5c-4bc9-99be-fe283df71653",
            "examples": [
              "21c28d3e-bc5c-4bc9-99be-fe283df71653"
            ]
          },
          "applicationClientId": {
            "type": "string",
            "example": "1d368c30-c9f8-4523-b8c2-3824ba72ff5c",
            "examples": [
              "1d368c30-c9f8-4523-b8c2-3824ba72ff5c"
            ]
          },
          "allowedSharedInbox": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "allowedUnassignedInbox": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "assignmentMessage": {
            "type": "string",
            "description": "Custom message sent to the customer when a chat is assigned to this agent. If null, defaults to 'Assigned to `<agent name>`'.",
            "example": "Hi, I'm Jane and I'll be assisting you today.",
            "examples": [
              "Hi, I'm Jane and I'll be assisting you today."
            ]
          }
        }
      },
      "SystemUserRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "agent@example.com",
            "examples": [
              "agent@example.com"
            ]
          },
          "password": {
            "type": "string",
            "format": "password",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "liveChatRole": {
            "type": "string",
            "enum": [
              "SUPERVISOR",
              "AGENT"
            ],
            "example": "AGENT",
            "examples": [
              "AGENT"
            ]
          },
          "client": {
            "$ref": "#/components/schemas/Client"
          },
          "firstName": {
            "type": "string",
            "example": "Jane",
            "examples": [
              "Jane"
            ]
          },
          "lastName": {
            "type": "string",
            "example": "Doe",
            "examples": [
              "Doe"
            ]
          },
          "avatar": {
            "type": [
              "string",
              "null"
            ],
            "example": "https://example.com/avatars/jane.jpg",
            "examples": [
              "https://example.com/avatars/jane.jpg"
            ]
          },
          "assignmentMessage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom message sent to the customer when a chat is assigned to this agent. If null, defaults to 'Assigned to `<agent name>`'.",
            "example": "Hi, I'm Jane and I'll be assisting you today.",
            "examples": [
              "Hi, I'm Jane and I'll be assisting you today."
            ]
          }
        }
      },
      "PasswordWrapper": {
        "type": "object",
        "required": [
          "oldPassword",
          "newPassword",
          "confirmNewPassword"
        ],
        "properties": {
          "oldPassword": {
            "type": "string",
            "format": "password",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "newPassword": {
            "type": "string",
            "format": "password",
            "example": "********",
            "examples": [
              "********"
            ]
          },
          "confirmNewPassword": {
            "type": "string",
            "format": "password",
            "example": "********",
            "examples": [
              "********"
            ]
          }
        }
      },
      "TeamEntity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
            "examples": [
              "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "Growthpoint",
            "examples": [
              "Growthpoint"
            ]
          },
          "teamName": {
            "type": "string",
            "example": "Support Team",
            "examples": [
              "Support Team"
            ]
          },
          "selectedNextNodeId": {
            "type": "string",
            "example": "node-abc123",
            "examples": [
              "node-abc123"
            ]
          },
          "priority": {
            "type": "integer",
            "example": 1,
            "examples": [
              1
            ]
          }
        }
      },
      "TeamReq": {
        "type": "object",
        "required": [
          "teamName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Required for update/remove.",
            "example": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
            "examples": [
              "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901"
            ]
          },
          "clientRef": {
            "type": "string",
            "example": "MyClient",
            "examples": [
              "MyClient"
            ]
          },
          "teamName": {
            "type": "string",
            "example": "Support Team",
            "examples": [
              "Support Team"
            ]
          },
          "priority": {
            "type": "integer",
            "example": 1,
            "examples": [
              1
            ]
          },
          "selectedNextNodeId": {
            "type": [
              "string",
              "null"
            ],
            "example": "node-abc123",
            "examples": [
              "node-abc123"
            ]
          },
          "supervisorEmail": {
            "type": [
              "string",
              "null"
            ],
            "example": "supervisor@example.com",
            "examples": [
              "supervisor@example.com"
            ]
          }
        }
      },
      "MemberReq": {
        "type": "object",
        "required": [
          "teamId",
          "systemUserId"
        ],
        "properties": {
          "teamId": {
            "type": "string",
            "format": "uuid",
            "example": "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901",
            "examples": [
              "f2a3b4c5-d6e7-8901-f2a3-b4c5d6e78901"
            ]
          },
          "systemUserId": {
            "type": "string",
            "format": "uuid",
            "example": "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890",
            "examples": [
              "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890"
            ]
          }
        }
      },
      "SMSSendReceiveMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012",
            "examples": [
              "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012"
            ]
          },
          "createdTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "gstid": {
            "type": "string",
            "example": "sms-gst-56789",
            "examples": [
              "sms-gst-56789"
            ]
          },
          "receiver": {
            "type": "string",
            "example": "27821234567",
            "examples": [
              "27821234567"
            ]
          },
          "text": {
            "type": "string",
            "example": "Your verification code is 12345.",
            "examples": [
              "Your verification code is 12345."
            ]
          },
          "sent": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "delivered": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "failed": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "messageStatus": {
            "type": "string",
            "example": "DELIVERED",
            "examples": [
              "DELIVERED"
            ]
          },
          "messageStatusCode": {
            "type": "string",
            "example": "0",
            "examples": [
              "0"
            ]
          },
          "messageCost": {
            "type": "string",
            "example": "0.15",
            "examples": [
              "0.15"
            ]
          },
          "smsCTDId": {
            "type": "string",
            "example": "sms-ctd-001",
            "examples": [
              "sms-ctd-001"
            ]
          },
          "timeSentToPayless": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:00Z",
            "examples": [
              "2026-01-15T10:30:00Z"
            ]
          },
          "timeSentSMS": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:01Z",
            "examples": [
              "2026-01-15T10:30:01Z"
            ]
          },
          "timeDeliveredSMS": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T10:30:05Z",
            "examples": [
              "2026-01-15T10:30:05Z"
            ]
          },
          "messageType": {
            "type": "string",
            "enum": [
              "DIRECT",
              "FALLBACK"
            ],
            "example": "DIRECT",
            "examples": [
              "DIRECT"
            ]
          },
          "messageDirection": {
            "type": "string",
            "enum": [
              "OUTGOING",
              "INCOMING"
            ],
            "example": "OUTGOING",
            "examples": [
              "OUTGOING"
            ]
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "b4c5d6e7-f890-1234-b4c5-d6e7f8901234",
            "examples": [
              "b4c5d6e7-f890-1234-b4c5-d6e7f8901234"
            ]
          },
          "found": {
            "type": "boolean",
            "description": "Whether the contact was found on WhatsApp.",
            "example": true,
            "examples": [
              true
            ]
          },
          "firstName": {
            "type": "string",
            "example": "John",
            "examples": [
              "John"
            ]
          },
          "fullName": {
            "type": "string",
            "example": "John Doe",
            "examples": [
              "John Doe"
            ]
          },
          "pushName": {
            "type": "string",
            "example": "JD",
            "examples": [
              "JD"
            ]
          },
          "businessName": {
            "type": "string",
            "example": "Acme Corp",
            "examples": [
              "Acme Corp"
            ]
          },
          "redactedPhone": {
            "type": "string",
            "description": "Partially redacted phone number.",
            "example": "+27***4567",
            "examples": [
              "+27***4567"
            ]
          },
          "phoneNumber": {
            "type": "string",
            "example": "27821234567",
            "examples": [
              "27821234567"
            ]
          },
          "jid": {
            "type": "string",
            "description": "WhatsApp JID (e.g. 27821234567@s.whatsapp.net).",
            "example": "27821234567@s.whatsapp.net",
            "examples": [
              "27821234567@s.whatsapp.net"
            ]
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the client this contact belongs to.",
            "example": "dbdb8809-6fd0-4cd2-8574-502f0f61a69d",
            "examples": [
              "dbdb8809-6fd0-4cd2-8574-502f0f61a69d"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-05T15:06:42.606638+02:00",
            "examples": [
              "2026-01-05T15:06:42.606638+02:00"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-16T21:16:33.620179+02:00",
            "examples": [
              "2026-01-16T21:16:33.620179+02:00"
            ]
          }
        }
      },
      "WhatsAppBlockedNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "c5d6e7f8-9012-3456-c5d6-e7f890123456",
            "examples": [
              "c5d6e7f8-9012-3456-c5d6-e7f890123456"
            ]
          },
          "number": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "clientNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "blockedTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-14T12:00:00Z",
            "examples": [
              "2026-01-14T12:00:00Z"
            ]
          }
        }
      },
      "WhatsAppBlacklistNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "d6e7f890-1234-5678-d6e7-f89012345678",
            "examples": [
              "d6e7f890-1234-5678-d6e7-f89012345678"
            ]
          },
          "number": {
            "type": "string",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "clientNumber": {
            "type": "string",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "blacklistReason": {
            "type": "string",
            "example": "Customer requested opt-out",
            "examples": [
              "Customer requested opt-out"
            ]
          },
          "blacklistTime": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-13T15:30:00Z",
            "examples": [
              "2026-01-13T15:30:00Z"
            ]
          }
        }
      },
      "BlacklistRequestDto": {
        "type": "object",
        "required": [
          "number",
          "clientNumber"
        ],
        "properties": {
          "number": {
            "type": "string",
            "description": "Phone number to blacklist.",
            "example": "+27821234567",
            "examples": [
              "+27821234567"
            ]
          },
          "clientNumber": {
            "type": "string",
            "description": "Your WhatsApp sender number.",
            "example": "+27123456789",
            "examples": [
              "+27123456789"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Optional reason for blacklisting.",
            "example": "Customer requested opt-out",
            "examples": [
              "Customer requested opt-out"
            ]
          }
        }
      },
      "PaginatedResponse": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "totalElements": {
            "type": "integer",
            "example": 100,
            "examples": [
              100
            ]
          },
          "totalPages": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "size": {
            "type": "integer",
            "example": 10,
            "examples": [
              10
            ]
          },
          "number": {
            "type": "integer",
            "example": 0,
            "examples": [
              0
            ]
          },
          "first": {
            "type": "boolean",
            "example": true,
            "examples": [
              true
            ]
          },
          "last": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          },
          "empty": {
            "type": "boolean",
            "example": false,
            "examples": [
              false
            ]
          }
        }
      }
    },
    "examples": {
      "Template_Create_TextOnly": {
        "summary": "Text-only template",
        "value": {
          "template_name": "seasonal_promo_text",
          "language": "en_GB",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Hi {{1}}, don't miss our sale!",
              "example": {
                "body_text": [
                  [
                    "John"
                  ]
                ]
              }
            }
          ]
        }
      },
      "Template_Create_Media_Header": {
        "summary": "Media header template",
        "value": {
          "template_name": "invoice_delivery",
          "language": "en_GB",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "HEADER",
              "format": "DOCUMENT",
              "example": {
                "header_handle": [
                  "https://example.com/doc.pdf"
                ]
              }
            },
            {
              "type": "BODY",
              "text": "Your invoice #{{1}}.",
              "example": {
                "body_text": [
                  [
                    "001"
                  ]
                ]
              }
            }
          ]
        }
      },
      "Template_Create_Text_Header": {
        "summary": "Text header template",
        "value": {
          "template_name": "alert_header",
          "language": "en_US",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "HEADER",
              "format": "TEXT",
              "text": "Alert: {{1}}",
              "example": {
                "header_text": [
                  "Maintenance"
                ]
              }
            },
            {
              "type": "BODY",
              "text": "System is down."
            }
          ]
        }
      },
      "Template_Create_CTA": {
        "summary": "Quick-reply buttons template (a call-to-action variant)",
        "value": {
          "template_name": "feedback_cta",
          "language": "en_GB",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "We value your feedback."
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "QUICK_REPLY",
                  "text": "Yes"
                },
                {
                  "type": "QUICK_REPLY",
                  "text": "No"
                }
              ]
            }
          ]
        }
      },
      "Template_Create_Carousel": {
        "summary": "Carousel template",
        "value": {
          "template_name": "product_carousel_v1",
          "language": "en_GB",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Hi {{1}}, check out these items!",
              "example": {
                "body_text": [
                  [
                    "Alice"
                  ]
                ]
              }
            },
            {
              "type": "CAROUSEL",
              "cards": [
                {
                  "components": [
                    {
                      "type": "HEADER",
                      "format": "IMAGE",
                      "example": {
                        "header_handle": [
                          "https://example.com/img1.jpg"
                        ]
                      }
                    },
                    {
                      "type": "BODY",
                      "text": "Super Widget A"
                    },
                    {
                      "type": "BUTTONS",
                      "buttons": [
                        {
                          "type": "QUICK_REPLY",
                          "text": "Buy A"
                        },
                        {
                          "type": "URL",
                          "text": "View",
                          "url": "https://example.com/items"
                        }
                      ]
                    }
                  ]
                },
                {
                  "components": [
                    {
                      "type": "HEADER",
                      "format": "IMAGE",
                      "example": {
                        "header_handle": [
                          "https://example.com/img2.jpg"
                        ]
                      }
                    },
                    {
                      "type": "BODY",
                      "text": "Super Widget B"
                    },
                    {
                      "type": "BUTTONS",
                      "buttons": [
                        {
                          "type": "QUICK_REPLY",
                          "text": "Buy B"
                        },
                        {
                          "type": "URL",
                          "text": "View",
                          "url": "https://example.com/items/{{1}}",
                          "example": [
                            "new"
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      "Template_Auth_CopyCode": {
        "summary": "Auth copy code",
        "value": {
          "template_name": "auth_code_1",
          "language": "en_US",
          "category": "AUTHENTICATION",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "add_security_recommendation": true
            },
            {
              "type": "FOOTER",
              "code_expiration_minutes": 5
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "OTP",
                  "otp_type": "COPY_CODE",
                  "text": "Copy Code"
                }
              ]
            }
          ]
        }
      },
      "Template_Auth_OneTap": {
        "summary": "Auth one-tap",
        "value": {
          "template_name": "auth_onetap_1",
          "language": "en_US",
          "category": "AUTHENTICATION",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "add_security_recommendation": true
            },
            {
              "type": "FOOTER",
              "code_expiration_minutes": 5
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "OTP",
                  "otp_type": "ONE_TAP",
                  "text": "Copy Code",
                  "autofill_text": "Autofill",
                  "package_name": "com.example.app",
                  "signature_hash": "K8a72FAINcG"
                }
              ]
            }
          ]
        }
      },
      "Template_Flow": {
        "summary": "WhatsApp Flow",
        "value": {
          "template_name": "flow_test",
          "language": "en_US",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Book an appointment"
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "FLOW",
                  "text": "Book Now",
                  "flow_id": "123456",
                  "flow_action": "navigate",
                  "navigate_screen": "BOOKING_SCREEN"
                }
              ]
            }
          ]
        }
      },
      "Template_StaticUrlButton": {
        "summary": "Static URL button",
        "value": {
          "template_name": "website_link",
          "language": "en_US",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Visit our site"
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "URL",
                  "text": "Visit Now",
                  "url": "https://example.com"
                }
              ]
            }
          ]
        }
      },
      "Template_DynamicUrlButton": {
        "summary": "Dynamic URL button",
        "value": {
          "template_name": "tracking_link",
          "language": "en_US",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Track your package"
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "URL",
                  "text": "Track",
                  "url": "https://example.com/track/{{1}}",
                  "example": [
                    "TRK123"
                  ]
                }
              ]
            }
          ]
        }
      },
      "Template_PhoneNumber": {
        "summary": "Phone number button",
        "value": {
          "template_name": "call_us",
          "language": "en_US",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Need help? Call us."
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "PHONE_NUMBER",
                  "text": "Call Support",
                  "phone_number": "+15550123456"
                }
              ]
            }
          ]
        }
      },
      "Template_CouponCode": {
        "summary": "Coupon code button",
        "description": "A `COPY_CODE` button that shares a promo code the customer can copy. Supported on MARKETING and\nUTILITY templates. `example` carries a sample code for approval; the real code is supplied as\nthe button parameter at send time (see send example `15. Coupon Code`).\n",
        "value": {
          "template_name": "summer_promo",
          "language": "en_US",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Use this code at checkout for 25% off."
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "COPY_CODE",
                  "example": [
                    "25OFF"
                  ]
                }
              ]
            }
          ]
        }
      },
      "Template_RequestContactInfo": {
        "summary": "Request contact info button",
        "description": "A `REQUEST_CONTACT_INFO` button that asks a username (BSUID-only) customer to share their phone\nnumber. The label is fixed by WhatsApp and cannot be customised, so no `text` is sent. Allowed\non MARKETING and UTILITY templates. The shared number arrives on the inbound webhook as a `contacts` message.\n",
        "value": {
          "template_name": "recover_number",
          "language": "en_US",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Please share your phone number so we can continue."
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "REQUEST_CONTACT_INFO"
                }
              ]
            }
          ]
        }
      },
      "Template_CallPermissionRequest": {
        "summary": "Call permission request",
        "description": "A `CALL_PERMISSION_REQUEST` component that asks the customer to allow your business to call them on\nWhatsApp. WhatsApp adds its own \"allow calls\" prompt to the message, so the component carries only its\n`type`. Allowed once per template, on MARKETING and UTILITY templates, and not on carousel templates.\n",
        "value": {
          "template_name": "allow_calls",
          "language": "en_US",
          "category": "UTILITY",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Can we call you on WhatsApp about your order?"
            },
            {
              "type": "CALL_PERMISSION_REQUEST"
            }
          ]
        }
      },
      "Template_Create_MixedButtons": {
        "summary": "Mixed buttons (QR + static URL + phone)",
        "description": "A single BUTTONS component combining quick-reply, URL, and phone-number\nbuttons. At send time these are emitted as one `button` message component\nwhose `parameters` array is positional in this template order — see send\nexample #10 (`CTA — Mixed Buttons`).\n",
        "value": {
          "template_name": "mixed_cta",
          "language": "en_GB",
          "category": "MARKETING",
          "number": "+1234567890",
          "allow_category_change": true,
          "components": [
            {
              "type": "BODY",
              "text": "Hi {{1}}, can we help?",
              "example": {
                "body_text": [
                  [
                    "Alice"
                  ]
                ]
              }
            },
            {
              "type": "BUTTONS",
              "buttons": [
                {
                  "type": "QUICK_REPLY",
                  "text": "Yes"
                },
                {
                  "type": "QUICK_REPLY",
                  "text": "No"
                },
                {
                  "type": "URL",
                  "text": "Shop",
                  "url": "https://example.com/shop"
                },
                {
                  "type": "PHONE_NUMBER",
                  "text": "Call us",
                  "phone_number": "+15550123456"
                }
              ]
            }
          ]
        }
      },
      "Webhook_Create_ClientDefault_Full": {
        "summary": "Client default (all webhooks)",
        "description": "Full client-default configuration with every webhook type enabled. Applies to every WhatsApp number under your client unless overridden per-number.",
        "value": {
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming",
          "statusUpdateURL": "https://yourserver.com/webhooks/status",
          "sessionStatusURL": "https://yourserver.com/webhooks/session",
          "eventWebhookURL": "https://yourserver.com/webhooks/events",
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": false,
          "chatbotStopOnAgentAssignment": true
        }
      },
      "Webhook_Create_PerNumberOverride": {
        "summary": "Per-number override",
        "description": "Configuration scoped to a single WhatsApp number. Set `whatsAppNumberId` to the `WhatsAppNumbers.id` you want this override to apply to. Falls back to the client default for events on other numbers.\n\nNeed the id? Call `GET /payless4messaging-service/WhatsApp/WhatsAppClientNumbers/getForCurrentLoginUser?searchString=27123456789` (any partial MSISDN works) and copy the **nested** `whatsAppNumber.id` from the matching row — not the top-level `id` (that one is the client–number link, not the number itself).\n",
        "value": {
          "whatsAppNumberId": "f1e2d3c4-b5a6-9870-fedc-ba9876543210",
          "incomingMessageURL": "https://yourserver.com/webhooks/number-specific/incoming",
          "statusUpdateURL": "https://yourserver.com/webhooks/number-specific/status",
          "eventWebhookURL": "https://yourserver.com/webhooks/number-specific/events",
          "chatbotIncludeOutgoing": false,
          "chatbotStopOnAgentAssignment": false
        }
      },
      "Webhook_Create_IncomingOnly": {
        "summary": "Incoming messages only",
        "description": "Minimal setup that receives only customer-to-business messages. Use when you only care about inbound traffic, not delivery status, session state, or platform events.",
        "value": {
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming"
        }
      },
      "Webhook_Create_StatusOnly": {
        "summary": "Status updates only (delivery receipts)",
        "description": "Minimal setup that receives only delivery status updates (sent, delivered, read, failed). Use when you only care about message lifecycle, not customer replies.",
        "value": {
          "statusUpdateURL": "https://yourserver.com/webhooks/status"
        }
      },
      "Webhook_Create_Chatbot_AutoStop": {
        "summary": "Chatbot — auto-stop on agent handover",
        "description": "Chatbot conversation events with bot replies included. Emits stop once a chat participant is assigned to a human agent — useful when you only want bot-driven traffic on this URL.",
        "value": {
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": true,
          "chatbotStopOnAgentAssignment": true
        }
      },
      "Webhook_Create_Chatbot_AlwaysOn": {
        "summary": "Chatbot — always on (incoming only)",
        "description": "Chatbot conversation events for incoming customer messages only. Continues emitting after agent handover — useful when you want to mirror the full conversation lifecycle on your side.",
        "value": {
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": false,
          "chatbotStopOnAgentAssignment": false
        }
      },
      "Webhook_Create_Chatbot_V2Enriched": {
        "summary": "Chatbot — v2 enriched payload",
        "description": "Chatbot conversation events using the **`v2`** payload shape — same flat fields as `v1` plus nested `assignedTo` (full `SystemUser`) and `chatParticipant` (full chat participant). Lets your receiver render the full lifecycle without a follow-up `GET /ChatParticipant/{id}`.\n\n**Warning:** For now if you this set to null the version is v1, however we will be deprecating v1 and the default will be v2 and this field will be removed in the future.\n",
        "value": {
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": true,
          "chatbotStopOnAgentAssignment": false,
          "chatbotPayloadVersion": "v2"
        }
      },
      "Webhook_Create_WhatsAppLite": {
        "summary": "WhatsApp Lite (with session status)",
        "description": "Configuration for a WhatsApp Lite number. `sessionStatusURL` receives connection state changes — only emitted for Lite numbers, since Cloud sessions are managed by Meta.",
        "value": {
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming",
          "statusUpdateURL": "https://yourserver.com/webhooks/status",
          "sessionStatusURL": "https://yourserver.com/webhooks/session"
        }
      },
      "Webhook_Update_AllUrls": {
        "summary": "Update all URLs",
        "description": "Replace every webhook URL on an existing configuration. Include the `id` of the row being updated.",
        "value": {
          "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming-v2",
          "statusUpdateURL": "https://yourserver.com/webhooks/status-v2",
          "sessionStatusURL": "https://yourserver.com/webhooks/session-v2",
          "eventWebhookURL": "https://yourserver.com/webhooks/events-v2",
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot-v2",
          "chatbotIncludeOutgoing": true,
          "chatbotStopOnAgentAssignment": true
        }
      },
      "Webhook_Update_DisableType": {
        "summary": "Disable a webhook type",
        "description": "Set any URL to an empty string (`\"\"`) to stop emitting that event type, while keeping the other URLs active. Here `sessionStatusURL` is disabled.",
        "value": {
          "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming",
          "statusUpdateURL": "https://yourserver.com/webhooks/status",
          "sessionStatusURL": "",
          "eventWebhookURL": "https://yourserver.com/webhooks/events",
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": false,
          "chatbotStopOnAgentAssignment": true
        }
      },
      "Webhook_Update_ChatbotFlagsOnly": {
        "summary": "Toggle chatbot flags",
        "description": "Same URLs as before, but flips `chatbotIncludeOutgoing` to `true` to start receiving outgoing bot replies. Remember — this is a full-entity save, so include all fields you want to keep.",
        "value": {
          "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
          "incomingMessageURL": "https://yourserver.com/webhooks/incoming",
          "statusUpdateURL": "https://yourserver.com/webhooks/status",
          "sessionStatusURL": "https://yourserver.com/webhooks/session",
          "eventWebhookURL": "https://yourserver.com/webhooks/events",
          "chatbotWebhookURL": "https://yourserver.com/webhooks/chatbot",
          "chatbotIncludeOutgoing": true,
          "chatbotStopOnAgentAssignment": true
        }
      }
    }
  }
}