{
  "openapi": "3.1.0",
  "info": {
    "title": "Biz SMS API",
    "version": "2.62",
    "summary": "High-volume batch SMS with two-way replies, delivery receipts and virtual numbers.",
    "description": "**Biz SMS** (the eCommunicate Automated Interactive SMS gateway) is a batch-oriented HTTP SMS API built for high-volume, two-way campaigns with delivery receipts, reply routing via virtual numbers, scheduling, and credit/charge queries.\n\nIt is a distinct product from the JSON [SMS Gateway API](./sms.yaml) and the WhatsApp-centric [Omnichannel Integration API](./omnichannel.yaml).\n\nAn **Email-to-SMS** facility is also available — send an email addressed to `cellnumber@ecommunicate.biz` and the gateway sends the SMS. See the Biz SMS guide for details.\n\n## How it works\n\n- Requests are sent as **`application/x-www-form-urlencoded`** parameters\n  (\"keywords\"). Production traffic must use **HTTP POST**; `GET` is only for\n  light testing (roughly five numbers or fewer).\n- Responses are **XML** documents in the namespace\n  `https://messaging.ecommunicate.biz/sms/response` (the `httpresponse`\n  diagnostic returns plain text). Always parse with a namespace-aware XML\n  parser — attribute order and tag counts are not fixed.\n- Implement **HTTP/1.1 Keep-Alive**. Break large batches into ~200 numbers per\n  POST, reusing the same `batchref` and incrementing `batchid`.\n\n\n## Correlation: batchref + batchid\n\nThere is no per-message id. Each send is identified by a client-chosen `batchref` (max 80 chars) plus a `batchid` (unique within the batchref, max 20 chars). You pull delivery receipts and replies later using the same pair. Re-sending an identical `batchref`+`batchid` does **not** resend — the gateway returns the original response wrapped in `<previousxml>` (status `1034`).\n\n## Authentication\n\nEvery request is authenticated with an **API key**: send an `X-API-Key: ecom_...` header. Generate and revoke keys from the client portal.\n\nThe optional `specversion`, `commsversion`, and `appversion` keywords are advisory. The gateway keys on major version **2**.\n\n## Status codes\n\nEvery outcome is carried in the XML `<status code=\"...\">`. Ranges: `0` success · `1`–`99` partial success / fail · `1000`–`1999` keyword error · `2000`–`2999` functional error · `3000`–`3999` system error. A send is successful when the code is `0` (or `1` = partial, some invalid numbers). Common codes: `1010` authentication failed · `1021` message keyword missing · `1034` duplicate batchref+batchid · `1071` all numbers invalid · `1100` senderid required · `2012` insufficient credits · `1310` bad `futuredatetime` format.",
    "contact": {
      "name": "eCommunicate Support",
      "email": "support@ecommunicate.co.za",
      "url": "https://www.ecommunicate.co.za/"
    }
  },
  "servers": [
    {
      "url": "https://messaging.ecommunicate.biz",
      "description": "Production (HTTPS also available on port 8443)"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Messaging",
      "description": "Send batch SMS."
    },
    {
      "name": "Delivery Receipts",
      "description": "Pull delivery receipts for a sent batch."
    },
    {
      "name": "Replies",
      "description": "Pull inbound replies routed to virtual numbers."
    },
    {
      "name": "Inbound",
      "description": "Retrieve messages sent by handsets to a keyword-routed number."
    },
    {
      "name": "Account",
      "description": "Credit checks, server time, and SMS cost queries."
    },
    {
      "name": "Templates",
      "description": "Predefined messages and cell-number groups."
    },
    {
      "name": "Batches",
      "description": "Manage scheduled (delayed) batches."
    },
    {
      "name": "Webhooks",
      "description": "Push callbacks the gateway POSTs to your server (not yet supported)."
    }
  ],
  "paths": {
    "/smsbatch/sms": {
      "post": {
        "summary": "Send SMS batch",
        "description": "Send one message to one or many numbers, immediately or scheduled. Provide a source of replies by **either** setting `senderid` (non-priority) **or** `priority=true` with one of `repliesperuserid` or `manageownreplies`+`virtualname`. Also available over `GET` for testing (~5 numbers). Returns an XML batch-send result; check `<status code>` is `0` (or `1` for partial success).",
        "operationId": "sendBatch",
        "tags": [
          "Messaging"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SendRequest"
              },
              "examples": {
                "senderid": {
                  "summary": "Non-priority send with a sender id",
                  "value": {
                    "specversion": "2.61",
                    "batchref": "Finance-2026-05",
                    "batchid": "1",
                    "senderid": "eCommunicate",
                    "message": "Your statement is ready",
                    "cell": "27821234567, Jane Doe | 27821234568",
                    "rdr": "true"
                  }
                },
                "priorityReplies": {
                  "summary": "Priority send with per-userid replies",
                  "value": {
                    "specversion": "2.61",
                    "batchref": "Campaign-2026-05",
                    "batchid": "1",
                    "priority": "true",
                    "repliesperuserid": "true",
                    "rdr": "true",
                    "message": "Reply YES to confirm",
                    "cell": "27821234567"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML batch-send result.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "Namespaced XML `<ecomm:response>` document."
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<ecomm:response xmlns:ecomm=\"http://messaging.ecommunicate.biz/sms/response\">\n    <ecomm:result>\n        <ecomm:status code=\"1\">partial-success</ecomm:status>\n        <ecomm:explanation>Some sms sent. There were invalid numbers in the batch.</ecomm:explanation>\n        <ecomm:completiontime>2026-01-17T23:03:17.356+02:00</ecomm:completiontime>\n        <ecomm:userid>your-userid</ecomm:userid>\n        <ecomm:clientref>your-client-ref</ecomm:clientref>\n    </ecomm:result>\n    <ecomm:batchsend status=\"\">\n        <ecomm:batch>\n            <ecomm:batchref>Finance-2026-05</ecomm:batchref>\n            <ecomm:batchid>1</ecomm:batchid>\n        </ecomm:batch>\n        <ecomm:totalnumbers>2</ecomm:totalnumbers>\n        <ecomm:correctnumbers>1</ecomm:correctnumbers>\n        <ecomm:incorrectformat quantity=\"1\">\n            <ecomm:numbers>\n                <ecomm:number>084300123</ecomm:number>\n                <ecomm:reason>Number Length Error</ecomm:reason>\n            </ecomm:numbers>\n        </ecomm:incorrectformat>\n        <ecomm:nonetworkconfig quantity=\"0\"/>\n    </ecomm:batchsend>\n</ecomm:response>\n"
              }
            }
          }
        }
      }
    },
    "/smsbatch/deliveryreceiptscheck": {
      "post": {
        "summary": "Check delivery receipts",
        "description": "Pull delivery receipts for a previously sent batch. The original send must have used `rdr=true`. Use `repeatallreceipts=true` to re-fetch receipts you have already retrieved. Until a message reaches a final state it is `PENDING` and returns no receipt.",
        "operationId": "checkDeliveryReceipts",
        "tags": [
          "Delivery Receipts"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptsRequest"
              },
              "example": {
                "specversion": "2.60",
                "batchref": "Finance-2026-05",
                "batchid": "1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML receipts document.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "Namespaced XML. Final states include `DELIVRD`, `UNDELIV`, `EXPIRED`, `REJECTD`, `UNKNOWN`, `NOTAVAIL`."
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<ecomm:response xmlns:ecomm=\"http://messaging.ecommunicate.biz/sms/response\">\n    <ecomm:result>\n        <ecomm:status code=\"0\">success</ecomm:status>\n        <ecomm:explanation>Received the request and returning receipts</ecomm:explanation>\n        <ecomm:completiontime>2026-02-09T08:53:52.340+02:00</ecomm:completiontime>\n        <ecomm:userid>your-userid</ecomm:userid>\n        <ecomm:clientref>your-client-ref</ecomm:clientref>\n    </ecomm:result>\n    <ecomm:receipts status=\"receipts\">\n        <ecomm:batchref value=\"Finance-2026-05\">\n            <ecomm:batchid status=\"receipts\" value=\"1\">\n                <ecomm:receipt errorcode=\"0\" status=\"DELIVRD\" delivtimestamp=\"2026-01-05T11:20:43+02:00\" identifier=\"Jane Doe\">\n                    <ecomm:number>27821234567</ecomm:number>\n                </ecomm:receipt>\n                <ecomm:receipt errorcode=\"92\" status=\"REJECTD\">\n                    <ecomm:number>27821234599</ecomm:number>\n                    <ecomm:reason>The mobile number does not exist on the network.</ecomm:reason>\n                </ecomm:receipt>\n            </ecomm:batchid>\n        </ecomm:batchref>\n    </ecomm:receipts>\n</ecomm:response>\n"
              }
            }
          }
        }
      }
    },
    "/smsbatch/replysmscheck": {
      "post": {
        "summary": "Check replies",
        "description": "Pull inbound replies routed to your virtual numbers. The original send must have used `repliesperuserid` or `manageownreplies`. Use `repeatallreplies=true` to re-fetch replies already returned. Only a client admin userid may filter by `virtualname`.",
        "operationId": "checkReplies",
        "tags": [
          "Replies"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/RepliesRequest"
              },
              "example": {
                "specversion": "2.60"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML replies document.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "Namespaced XML `<ecomm:replies>` document."
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<ecomm:response xmlns:ecomm=\"http://messaging.ecommunicate.biz/sms/response\">\n    <ecomm:result>\n        <ecomm:status code=\"0\">success</ecomm:status>\n        <ecomm:explanation>Received the request and returning replies</ecomm:explanation>\n        <ecomm:completiontime>2026-11-06T21:34:32.347+02:00</ecomm:completiontime>\n        <ecomm:userid>your-userid</ecomm:userid>\n        <ecomm:clientref>your-client-ref</ecomm:clientref>\n    </ecomm:result>\n    <ecomm:replies status=\"replies\">\n        <ecomm:replymessage identifier=\"Susan Blake\" number=\"27732304004\" status=\"\" virtualname=\"user1vn1\">\n            <ecomm:message>Yes, please confirm my booking.</ecomm:message>\n            <ecomm:receivedtime>2026-11-06T14:22:11+02:00</ecomm:receivedtime>\n        </ecomm:replymessage>\n    </ecomm:replies>\n</ecomm:response>\n"
              }
            }
          }
        }
      }
    },
    "/smsservice/messagecheck": {
      "post": {
        "summary": "Check incoming messages",
        "description": "Retrieve messages sent by handsets to a keyword-routed mobile number. Requires a campaign/keyword setup with eCommunicate. Filter to a sub-campaign with `smskeyword`. Uses a different namespace (`http://messaging.ecommunicate.biz/sms/service`) and a plain `<response>` root.",
        "operationId": "checkIncomingMessages",
        "tags": [
          "Inbound"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/IncomingRequest"
              },
              "example": {
                "smskeyword": "hotel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML modem-messages document.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "XML in the `.../sms/service` namespace."
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<response clientref=\"your-client-ref\" code=\"0\" completiontime=\"2026-02-09T22:32:47.125+02:00\" explanation=\"Received the request and returning modem messages\" userid=\"your-admin-userid\" xmlns=\"http://messaging.ecommunicate.biz/sms/service\">\n    <modemmessages destcellno=\"27833219018\" keyword=\"hotel\" modemtime=\"2026-02-09T10:37:22+02:00\" srccellno=\"27823241010\">\n        <message>hotel please send list of available hotels</message>\n    </modemmessages>\n</response>\n"
              }
            }
          }
        }
      }
    },
    "/smsbatch/servicequery": {
      "post": {
        "summary": "Service query",
        "description": "Credit checks, server time, SMS cost, and connectivity diagnostics. Exactly one of `servertime`, `httpresponse`, `creditcheck`, or `charge` is required. `charge` also requires `version` > 2.00 and `cell`.",
        "operationId": "serviceQuery",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ServiceQueryRequest"
              },
              "examples": {
                "creditcheck": {
                  "summary": "Credit check",
                  "value": {
                    "version": "2.55",
                    "creditcheck": "true"
                  }
                },
                "charge": {
                  "summary": "SMS cost query",
                  "value": {
                    "version": "2.55",
                    "charge": "true",
                    "cell": "26771333444"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML service-query result (plain text for `httpresponse`).",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "description": "Namespaced XML `<ecomm:creditcheck>` document."
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<ecomm:response xmlns:ecomm=\"http://messaging.ecommunicate.biz/sms/response\">\n    <ecomm:result>\n        <ecomm:status code=\"0\">success</ecomm:status>\n        <ecomm:explanation>The request was processed correctly</ecomm:explanation>\n        <ecomm:completiontime>2026-06-28T22:40:11.399+02:00</ecomm:completiontime>\n        <ecomm:userid>your-userid</ecomm:userid>\n        <ecomm:clientref>your-client-ref</ecomm:clientref>\n    </ecomm:result>\n    <ecomm:creditcheck status=\"\">\n        <ecomm:credits>200</ecomm:credits>\n    </ecomm:creditcheck>\n</ecomm:response>\n"
              },
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "Returned only for `httpresponse=true`."
                },
                "example": "The server time is Mon Jul 04 10:27:30 SAST 2026. Have a nice day!"
              }
            }
          }
        }
      }
    },
    "/smsbatch/templates": {
      "post": {
        "summary": "Manage templates",
        "description": "Register a predefined message (`pmessage` + `message`) or a predefined cell group (`pgroup` + `cell`) to reference later instead of inlining. Requires `version=2.55`. Note: this operation is not yet fully implemented.",
        "operationId": "manageTemplates",
        "tags": [
          "Templates"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TemplatesRequest"
              },
              "example": {
                "version": "2.55",
                "pmessage": "HappyBirthday",
                "message": "Happy birthday from all of us!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML template result.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<response xmlns=\"http://messaging.ecommunicate.biz/sms/response\">\n    <result>\n        <status code=\"0\">success</status>\n        <explanation>The request was processed correctly</explanation>\n        <completiontime>2026-06-28T22:40:11.399+02:00</completiontime>\n    </result>\n    <batchsend status=\"\">\n        <pmessagename>HappyBirthday</pmessagename>\n    </batchsend>\n</response>\n"
              }
            }
          }
        }
      }
    },
    "/smsbatch/managebatch": {
      "post": {
        "summary": "Manage delayed batches",
        "description": "Delete an unsent delayed (`futuredatetime`) batch. Best-effort, not guaranteed. Requires `deletebatch=true` with the original `batchref` and `batchid`, and `version=2.55`.",
        "operationId": "manageBatch",
        "tags": [
          "Batches"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ManageBatchRequest"
              },
              "example": {
                "version": "2.55",
                "deletebatch": "true",
                "batchref": "Finance-2026-05",
                "batchid": "1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "XML delete-batch result (`100` deleted, `105` not found).",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<ecomm:response xmlns:ecomm=\"http://messaging.ecommunicate.biz/sms/response\">\n    <ecomm:result>\n        <ecomm:status code=\"0\">success</ecomm:status>\n        <ecomm:explanation>The request was processed correctly</ecomm:explanation>\n        <ecomm:completiontime>2026-01-18T21:58:23.869+02:00</ecomm:completiontime>\n    </ecomm:result>\n    <ecomm:deletebatch>\n        <ecomm:batch>\n            <ecomm:batchref>Finance-2026-05</ecomm:batchref>\n            <ecomm:batchid>1</ecomm:batchid>\n        </ecomm:batch>\n        <ecomm:result>\n            <ecomm:status code=\"100\">success</ecomm:status>\n            <ecomm:explanation>The delayed batch was successfully deleted</ecomm:explanation>\n        </ecomm:result>\n    </ecomm:deletebatch>\n</ecomm:response>\n"
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "urlreceipts": {
      "post": {
        "summary": "Delivery receipt push",
        "description": "When `urlreceipts` is set on a send (and `rdr=true`), the gateway POSTs form parameters to your URL as final receipts arrive. `PENDING` states are not pushed. **Not yet supported** in this version.",
        "operationId": "onReceiptPush",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "destaddress": {
                    "type": "string",
                    "description": "Recipient cell number.",
                    "example": "27821234567"
                  },
                  "status": {
                    "type": "string",
                    "description": "Final status of the SMS.",
                    "example": "DELIVRD"
                  },
                  "batchref": {
                    "type": "string",
                    "example": "Finance-2026-05"
                  },
                  "batchid": {
                    "type": "string",
                    "example": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "urlreplies": {
      "post": {
        "summary": "Reply push",
        "description": "When `urlreplies` is set on a send (with `repliesperuserid` or `manageownreplies`), the gateway POSTs form parameters to your URL for each reply. **Not yet supported** in this version.",
        "operationId": "onReplyPush",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "srcaddress": {
                    "type": "string",
                    "description": "Cell number of the replying recipient.",
                    "example": "27821234567"
                  },
                  "appaddress": {
                    "type": "string",
                    "description": "Virtual number / short code replied to.",
                    "example": "36001"
                  },
                  "message": {
                    "type": "string",
                    "description": "The reply text.",
                    "example": "Yes, confirm"
                  },
                  "userid": {
                    "type": "string",
                    "example": "your-userid"
                  },
                  "batchref": {
                    "type": "string",
                    "example": "Campaign-2026-05"
                  },
                  "batchid": {
                    "type": "string",
                    "example": "1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Per-client API key, prefixed `ecom_`. Required on every request. Generate and revoke keys from the client portal."
      }
    },
    "schemas": {
      "CommonKeywords": {
        "type": "object",
        "description": "Advisory version keywords sent with every operation.",
        "properties": {
          "specversion": {
            "type": "string",
            "description": "Spec version coded against. The gateway keys on major version 2.",
            "example": "2.61"
          },
          "commsversion": {
            "type": "string",
            "description": "Communication protocol/version (advisory, for support).",
            "example": "1.0"
          },
          "appversion": {
            "type": "string",
            "description": "Sending-application version (advisory, for support).",
            "example": "1.0"
          }
        }
      },
      "SendRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "required": [
              "batchref",
              "batchid",
              "message",
              "cell"
            ],
            "properties": {
              "batchref": {
                "type": "string",
                "description": "Client batch reference (max 80 alphanumeric). Reusable across sends.",
                "example": "Finance-2026-05"
              },
              "batchid": {
                "type": "string",
                "description": "Unique id within the batchref (max 20 alphanumeric).",
                "example": "1"
              },
              "message": {
                "type": "string",
                "description": "Message text. Single SMS max 160 chars; longer messages split into segments (see `concat`/`maxparts`). URL-encode non-GSM characters.",
                "example": "Your statement is ready"
              },
              "cell": {
                "type": "string",
                "description": "One or many numbers, comma-separated, each optionally prefixed with an identifier (use a `|` when the identifier contains digits).",
                "example": "27821234567, Jane Doe | 27821234568"
              },
              "senderid": {
                "type": "string",
                "description": "Source/from address (max 11 alphanumeric) for non-priority sends. A numeric, reply-capable senderid must start `27`. Must not be used with `priority`.",
                "example": "eCommunicate"
              },
              "priority": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Prioritise the batch. Requires `repliesperuserid` or `manageownreplies`.",
                "example": "true"
              },
              "repliesperuserid": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "One reply path per userid. Mutually exclusive with `manageownreplies`.",
                "example": "true"
              },
              "manageownreplies": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Multiple reply paths via virtual names. Requires `virtualname`.",
                "example": "true"
              },
              "virtualname": {
                "type": "string",
                "description": "Client-chosen virtual name (max 50), required with `manageownreplies`.",
                "example": "campaign-vn1"
              },
              "concat": {
                "type": "string",
                "enum": [
                  "true",
                  "false"
                ],
                "description": "Concatenate long messages into one handset SMS (153 chars/part, max 9).",
                "example": "false"
              },
              "maxparts": {
                "type": "integer",
                "description": "Maximum message segments (default 9). `0`/`1` rejects anything over 160 chars.",
                "example": 3
              },
              "flash": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Send as a flash SMS (shown on screen, not stored).",
                "example": "true"
              },
              "unicode": {
                "type": "string",
                "enum": [
                  "true",
                  "false"
                ],
                "description": "Send Unicode (UCS-2). 70 chars/SMS, 67/part concatenated.",
                "example": "false"
              },
              "rdr": {
                "type": "string",
                "enum": [
                  "true",
                  "false"
                ],
                "description": "Request Delivery Receipt for each SMS. Required to later pull receipts or use delivery emails/summaries.",
                "example": "true"
              },
              "dsm": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Don't save message (not stored in the database). Not usable with `futuredatetime`.",
                "example": "true"
              },
              "futuredatetime": {
                "type": "string",
                "description": "Hold the batch until this time (`YYYY-MM-DD hh:mm:ss`).",
                "example": "2026-05-22 13:10:00"
              },
              "expirydatetime": {
                "type": "string",
                "description": "Cancel (and refund) if not sent by this time (`YYYY-MM-DD hh:mm:ss`).",
                "example": "2026-05-31 13:10:00"
              },
              "validity": {
                "type": "integer",
                "description": "SMSC retry window in minutes (default 10080 = 7 days).",
                "example": 10080
              },
              "fromemail": {
                "type": "string",
                "format": "email",
                "description": "From address used for all system-originated emails for this batch.",
                "example": "noreply@yourcompany.co.za"
              },
              "sendingemail": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Enable send-confirmation emails (master switch).",
                "example": "true"
              },
              "sendingemailaddress1": {
                "type": "string",
                "format": "email",
                "description": "First send-confirmation email address.",
                "example": "ops@yourcompany.co.za"
              },
              "deliveryemail": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Enable delivery-receipt emails (master switch; requires `rdr`).",
                "example": "true"
              },
              "deliveryemailaddress1": {
                "type": "string",
                "format": "email",
                "description": "First delivery-receipt email address.",
                "example": "ops@yourcompany.co.za"
              },
              "replyemail1": {
                "type": "string",
                "format": "email",
                "description": "Email address notified per reply SMS.",
                "example": "replies@yourcompany.co.za"
              },
              "failuretosendemailaddress": {
                "type": "string",
                "format": "email",
                "description": "Notified if the batch fails before send-out.",
                "example": "alerts@yourcompany.co.za"
              },
              "urlreceipts": {
                "type": "string",
                "description": "URL the gateway POSTs receipts to (requires `rdr`). Not yet supported.",
                "example": "https://your-server.com/receipts"
              },
              "urlreplies": {
                "type": "string",
                "description": "URL the gateway POSTs replies to (requires a replies keyword). Not yet supported.",
                "example": "https://your-server.com/replies"
              }
            }
          }
        ]
      },
      "ReceiptsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "required": [
              "batchref",
              "batchid"
            ],
            "properties": {
              "batchref": {
                "type": "string",
                "description": "Original batchref (must match the send).",
                "example": "Finance-2026-05"
              },
              "batchid": {
                "type": "string",
                "description": "Original batchid.",
                "example": "1"
              },
              "repeatallreceipts": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Re-query all receipts for the batch. Required to re-fetch already-returned receipts.",
                "example": "true"
              },
              "cell": {
                "type": "string",
                "description": "Limit the repeat to specific numbers (only valid with `repeatallreceipts`).",
                "example": "27821234567"
              },
              "startdate": {
                "type": "string",
                "description": "Receipts on/after this date (`yyyy-mm-dd`).",
                "example": "2026-05-01"
              },
              "enddate": {
                "type": "string",
                "description": "Receipts on/before this date. Uses `00:00:00`, so use the day after.",
                "example": "2026-05-08"
              }
            }
          }
        ]
      },
      "RepliesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "properties": {
              "repeatallreplies": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Return all replies for the userid again.",
                "example": "true"
              },
              "cell": {
                "type": "string",
                "description": "Limit the re-check to specific numbers (only with `repeatallreplies`).",
                "example": "27821234567"
              },
              "virtualname": {
                "type": "string",
                "description": "Filter to one virtual name (client admin userid only).",
                "example": "campaign-vn1"
              },
              "startdate": {
                "type": "string",
                "description": "Replies on/after this date (`yyyy-mm-dd`).",
                "example": "2026-05-01"
              },
              "enddate": {
                "type": "string",
                "description": "Replies on/before this date (day-after semantics).",
                "example": "2026-05-08"
              }
            }
          }
        ]
      },
      "IncomingRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "properties": {
              "repeatallmessages": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Re-query the entire incoming-message set.",
                "example": "true"
              },
              "smskeyword": {
                "type": "string",
                "description": "Leading keyword identifying the sub-campaign. Blank = all messages.",
                "example": "hotel"
              },
              "startdate": {
                "type": "string",
                "description": "Messages on/after this date (`yyyy-mm-dd`).",
                "example": "2026-05-01"
              },
              "enddate": {
                "type": "string",
                "description": "Messages on/before this date (day-after semantics).",
                "example": "2026-05-08"
              }
            }
          }
        ]
      },
      "ServiceQueryRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "properties": {
              "servertime": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Return server time (default option).",
                "example": "true"
              },
              "httpresponse": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Plain-text diagnostic to test firewalls blocking XML.",
                "example": "true"
              },
              "creditcheck": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Return remaining credits.",
                "example": "true"
              },
              "charge": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Query the cost of an SMS. Requires `version` > 2.00 and `cell`.",
                "example": "true"
              },
              "version": {
                "type": "string",
                "description": "Set to `2` or `2.x` for the credits-per-user layout; required for `charge`.",
                "example": "2.55"
              },
              "cell": {
                "type": "string",
                "description": "Mobile number for a `charge` query (may start with `+`).",
                "example": "26771333444"
              },
              "allusers": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Admin-only. Include per-user credit breakdown.",
                "example": "true"
              }
            }
          }
        ]
      },
      "TemplatesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "required": [
              "version"
            ],
            "properties": {
              "version": {
                "type": "string",
                "description": "Set to `2.55`.",
                "example": "2.55"
              },
              "pmessage": {
                "type": "string",
                "description": "Predefined message name to associate with `message`.",
                "example": "HappyBirthday"
              },
              "message": {
                "type": "string",
                "description": "Message text to store under the pmessage.",
                "example": "Happy birthday from all of us!"
              },
              "pgroup": {
                "type": "string",
                "description": "Predefined group name to associate with the cell numbers.",
                "example": "finance-team"
              },
              "cell": {
                "type": "string",
                "description": "Comma-separated numbers (27 format) to store under the pgroup.",
                "example": "27821234567,27821234568"
              }
            }
          }
        ]
      },
      "ManageBatchRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommonKeywords"
          },
          {
            "type": "object",
            "required": [
              "version",
              "batchref",
              "batchid"
            ],
            "properties": {
              "version": {
                "type": "string",
                "description": "Set to `2.55`.",
                "example": "2.55"
              },
              "deletebatch": {
                "type": "string",
                "enum": [
                  "true"
                ],
                "description": "Delete a delayed (`futuredatetime`) batch.",
                "example": "true"
              },
              "batchref": {
                "type": "string",
                "description": "Original batchref.",
                "example": "Finance-2026-05"
              },
              "batchid": {
                "type": "string",
                "description": "Original batchid.",
                "example": "1"
              }
            }
          }
        ]
      }
    }
  }
}