Centro de ayuda Variable pools and unique promo codes

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

  1. Sign in to SMSBAT Omni.
  2. Go to Broadcasts → the Variable pools tab.
  3. Click + Create.
  4. 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.
  5. Click Create.

2. What happens when you send

When a request contains a placeholder in its text, SMSBAT:

  1. Takes a free (Unused) value from the pool for that variable.
  2. Binds it to the recipient’s phone number.
  3. Flips the value to Used and records the exact time in Used at.
  4. 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:

ColumnMeaning
Phone numberthe recipient this value went to
Valuethe promo code or dynamic value itself
UsedUnused — still free, Used — already handed out
Used atwhen the value was bound to a send
Created Atwhen 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.