Variable pools and unique promo codes
Variable pools and unique promo codes
Variable pools substitute a unique value — a promo code, a personal link, a certificate number, a PIN — into the message text, so you do not have to build a separate message per recipient on your own backend.
Values are referenced with a placeholder in double curly braces, both in the primary message text and in the cascade fallbacks (Viber, SMS).
1. Creating a pool in the Omni panel
- Sign in to SMSBAT Omni.
- Go to Broadcasts → the Variable pools tab.
- Click + Create.
- In the dialog, fill in:
- Organization — the organization the pool belongs to.
- Variable — the name, no spaces, for example
promo_code. - Values — enter values one by one or paste a list.
- File — or upload a CSV or TXT file of unique codes.
- Click Create.
2. What happens when you send
When a request contains a placeholder in its text, SMSBAT:
- Takes a free (Unused) value from the pool for that variable.
- Binds it to the recipient’s phone number.
- Flips the value to Used and records the exact time in
Used at. - Substitutes the same value into the primary channel and every cascade fallback, so the recipient sees one code, not several.
3. Example request
POST /bat/messagelist
Host: restapi.smsbat.com
Content-Type: application/json
X-Authorization-Key: YOUR_API_KEY
{
"messages": [
{
"from": "MasterZoo",
"to": "380936670003",
"type": "viber_trans",
"text": "Hello! Your promo code: {{promo_code}}\n\nValid until 30.08.2026.",
"ttl": "30",
"fallbacks": [
{
"from": "MasterZoo",
"to": "380936670003",
"type": "sms",
"text": "Hello! Your promo code: {{promo_code}}\n\nValid until 30.08.2026."
}
]
}
]
}
4. Tracking values in the panel
The Variable pools table shows the state of every value:
| Column | Meaning |
|---|---|
| Phone number | the recipient this value went to |
| Value | the promo code or dynamic value itself |
| Used | Unused — still free, Used — already handed out |
| Used at | when the value was bound to a send |
| Created At | when the value was added to the pool |
Watch the remaining balance
If the pool runs out mid-campaign, there is no value left to substitute. Check
the number of Unused values against your recipient count before a large send.
5. Why use a pool
- No duplicates — each value is handed out exactly once, to one number.
- Nothing to build — no per-recipient template assembly in your CRM or ERP.
- Auditable — you can always see which code went to which number and when.