# Trigger phone calls from CRM: a webhook playbook

Source: https://dialmilo.com/hub/crm-triggered-phone-calls
Updated: 2026-11-14

Trigger phone calls from your CRM with one webhook: payload, idempotency keys, scheduling with at, and copy-paste setups for Customer.io, Braze, HubSpot, cron.

To trigger phone calls from your CRM, give every campaign one secret URL and let your journey tool POST people to it. Three details decide whether it works in production: a stable external_id so retries and re-fired journeys never double-call anyone, an at field when the call should happen later, and a results feed so the journey can branch on what happened on the call. Everything else is mapping fields.

Most "trigger a call from your CRM" guides stop at "add a webhook step". That's the easy 10%. The parts that bite in production are retries (every journey tool retries, sometimes a day later), re-entry (a person who qualifies twice gets enrolled twice), phone formats (CRMs store numbers however people typed them) and what happens after the call. This guide covers those, with payloads you can paste.

The examples use Dial Milo's start-a-call webhook. The concepts carry over to any calling API worth using.

## How to trigger phone calls from CRM: the shape of a call

  
    A lead fills in a form, a customer misses a payment, a player registers but doesn't deposit within 48 hours. Your journey tool sees the event or segment change.
  
  
    One person or up to 500 in a single request, with whatever context the call needs: language, offer code, plan name, the reason for the call.
  
  
    The dialler calls in the person's local calling hours, at the campaign's pace, with retries for no-answers and voicemail. Opt-outs and exclusions are rejected before anything is queued.
  
  
    Accepted, declined, callback requested with a time, opted out, wrong person. The journey branches on it: send the follow-up email, wait for the callback, or suppress the person from calls.
  

The point of this shape is that the CRM keeps deciding *who* and *why*, and the calling platform owns *when* and *how*. Your journey never has to know about calling hours, time zones or retry spacing.

## The payload

Each Dial Milo campaign has its own secret start-a-call URL. Create it on the campaign's **Connect your retention chains** panel, where you can also generate a new one (the old one stops working immediately) or turn it off. The token in the URL is the authentication, so treat the URL like a password.

A single person:

```json
{
  "phone": "+447700900123",
  "name": "James",
  "player_id": "123",
  "external_id": "nodeposit-123-2026-11-14",
  "language": "en",
  "offer_code": "FS50",
  "at": "2026-11-14T18:00:00Z",
  "context": {
    "segment": "registered, no deposit 48h",
    "favourite_game": "blackjack"
  }
}
```

For a batch, send a JSON array of those objects, or `{"players": [ ... ]}`, up to 500 per request.

| Field | Required | What it does |
| --- | --- | --- |
| `phone` | Yes | The number to call. Send E.164 (`+447700900123`). Forms like `0044 7700…` are normalised; a national number such as `07700 900123` is refused unless `context.country` says which country it is. |
| `name` | No | How Milo addresses the person. |
| `external_id` | Strongly advised | Your idempotency key. A second request with the same value for this campaign is ignored. |
| `at` | No | ISO 8601 date-time. Queue the call for then instead of now. |
| `language` | No | The language Milo opens in, such as `en`, `nl` or `de`. Milo can still switch if the person replies in another language. |
| `offer_code` | Engagement campaigns | Must match one of the campaign's offers, or the person is rejected. Milo presents only the terms you wrote for that offer. |
| `player_id`, `timezone`, `first_name`, `segment`, `brand` | No | Saved on the call and echoed back in the result. `timezone` (such as `Europe/London`) overrides the time zone worked out from the number. |
| `context` | No | Any extra flat key-value detail. Milo can use it in the conversation and in script placeholders. |

The response comes back immediately with HTTP 202:

```json
{
  "ok": true,
  "accepted": 498,
  "duplicates": 1,
  "rejected": [
    { "index": 17, "reason": "offer_code \"FS500\" is not one of the campaign's offers" }
  ]
}
```

`index` points at the position in your array, so your system can log exactly which record failed and why. An unknown or revoked token returns 404; a malformed body or more than 500 people returns 422.

## Idempotency: the field that saves you

Journey tools retry. That's a feature: a timeout shouldn't silently drop a customer. But it means your endpoint will see the same request more than once, and for phone calls a duplicate isn't a harmless extra row. It is a second call to a real person.

The documented retry behaviour of the three big tools, as of November 2026:

| Tool | Retries on | How long | Timeout |
| --- | --- | --- | --- |
| Customer.io | Timeouts, 408, 409, 429, 5xx | Up to 11 times over about an hour ([Customer.io docs](https://docs.customer.io/journeys/webhooks-action.md)) | 16 seconds |
| Braze | 408, 429, 5xx | Up to five attempts, for up to 24 hours ([Braze docs](https://www.braze.com/docs/user_guide/channels/webhooks/create_a_webhook)) | 120 seconds |
| HubSpot workflows | Failures and 429; not other 4xx | Up to three days, intervals up to eight hours ([HubSpot knowledge base](https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows)) | Not stated |

Customer.io's docs make the consequence explicit: retries can happen when the server accepted the request but no 2xx came back, which "can cause the same value to appear more than once".

Dial Milo guards against this in two layers:

1. **external_id.** If any call in the campaign already carries that external_id, the request is counted under `duplicates` and nothing is queued. This holds after the first call has finished, too.
2. **Phone already queued.** Even without an external_id, a number that already has a call queued or in progress in that campaign isn't queued again.

The second layer stops floods. The first is the one you design. The rule of thumb: **one external_id per reason to call.**

- `nodeposit-123` means player 123 gets one no-deposit call from this campaign, ever.
- `nodeposit-123-2026-11-14` means at most one per day, so a player who re-qualifies next week can be called again.
- The journey tool's own event ID means one call per triggering event, which is what you want for "call me back" form submissions.

Don't use a value that changes on retry, such as a timestamp generated at send time. Then every retry looks new.

The contact cooldown is a separate safety net. Set "don't call again within N days" on the campaign and nobody who recently had a conversation with any of your campaigns is called again inside that window. They're scheduled for later rather than dropped. See the [calling hours and contact limits](/help/calling-hours-and-contact-limits) help article.

## Scheduling with "at"

Without `at`, the person joins the queue straight away and is called at the next allowed moment. With `at`, the call waits until that time.

Three patterns that use it well:

- **Delay after the trigger.** A trial ends at midnight; you'd rather the call happen the next evening. Compute the time in your journey and pass it.
- **Honouring a stated preference.** The person picked "evenings" on your form. Pass 18:00 on the next weekday in their time zone.
- **Lining up with other channels.** Your email goes at 09:00; set the call for 17:00 the same day so the call can refer to it.

Always include the offset or a `Z`. `2026-11-14T18:00:00Z` is 18:00 UTC; `2026-11-14T18:00:00+01:00` is 18:00 in Amsterdam in winter. The scheduled time is the *earliest* the call can happen. The campaign's calling hours still apply in the person's local time (the default window is 10:00 to 20:00), so an `at` of 22:00 local waits for the next morning's window. A paused campaign or a reached budget holds the call too.

Long retries plus scheduling can surprise you. If HubSpot retries for three days after an outage on your side, a "call within the hour" request can arrive two days late. Give time-sensitive campaigns an end date: at the campaign's "Stop calling at" time, anything still queued is cancelled.

## Customer.io

Customer.io is the one tool with a native two-way connection, which we cover in depth in [Customer.io AI phone calls](/hub/customer-io-ai-phone-calls). On the sending side it is a webhook action in a journey, with a JSON body using Customer.io's Liquid:

```json
{
  "phone": "{{customer.phone}}",
  "name": "{{customer.first_name}}",
  "player_id": "{{customer.id}}",
  "external_id": "{{event_id}}",
  "language": "{{customer.language}}",
  "offer_code": "FS50"
}
```

`{{event_id}}` is the ID of the event that triggered the journey ([Customer.io's Liquid reference](https://docs.customer.io/journeys/liquid-tag-list)), which makes it a natural idempotency key for event-triggered journeys. For segment-triggered journeys there's no event, so build a key from `{{customer.id}}` plus a fixed campaign name. Customer.io's docs recommend Liquid filters such as `strip` and `escape` to keep values valid JSON.

On the way back, Dial Milo updates the person's attributes (`milo_last_outcome`, `milo_callback_at`, `milo_opted_out_calls` and others) and fires events such as `milo_offer_accepted`, `milo_callback_requested` and `milo_opted_out`. Your journey waits for those events and branches. That loop is what makes chains like the [registered-but-no-deposit flow](/hub/registered-no-deposit-players) work: the call happens, the player says yes, `milo_offer_accepted` fires, and Customer.io sends the SMS and email with the code.

## Braze

Braze has no native Dial Milo integration, but its webhook campaigns and Canvas webhook steps do the job. In the Compose tab, set the method to POST, paste the campaign URL, add a `Content-Type: application/json` header and use a raw text body:

```json
{
  "phone": "{{${phone_number}}}",
  "name": "{{${first_name} | default: 'there'}}",
  "player_id": "{{${user_id}}}",
  "external_id": "{{campaign.${api_id}}}-{{${user_id}}}",
  "language": "{{${language}}}",
  "context": {
    "tier": "{{custom_attribute.${vip_tier}}}"
  }
}
```

Those are Braze's [supported personalisation tags](https://www.braze.com/docs/user_guide/personalization_and_dynamic_content/liquid/supported_personalization_tags). Braze's docs advise a default value for every user-specific field. Two Braze-specific cautions:

- **Phone format.** Make sure `phone_number` is stored in E.164 or carries a country, or the record comes back in `rejected`.
- **Canvas vs campaign IDs.** In a Canvas, use `{{canvas.${api_id}}}` instead of the campaign ID in your key. A key built from the Canvas ID and user ID means one call per user per Canvas; add a date if users can re-enter.

Use Braze's Test tab to send a test as a specific user before launch. Put your own number on that test profile and press **Test call** in Dial Milo first, so you hear the script before anyone else does.

## HubSpot workflows

HubSpot's **Send a webhook** action lives under Data ops in the workflow editor. HubSpot lists it as available on Data Hub Professional or Enterprise ([HubSpot knowledge base](https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows)), so check your subscription first. Webhook URLs must start with HTTPS, which the Dial Milo URL does.

Set the method to POST and choose **Customize request body** rather than including every property. That keeps the payload small and keeps unrelated customer data out of a system that doesn't need it. Map:

| Key | Value |
| --- | --- |
| `phone` | Phone number (or Mobile phone number) property |
| `name` | First name property |
| `player_id` | Record ID |
| `external_id` | A custom property you set earlier in the workflow, such as "call key" |
| `language` | Preferred language property, or a static value |
| `segment` | Static value, such as "renewal due 14 days" |

The custom-property trick matters because HubSpot maps each key to a single property or a static value, so you can't concatenate on the fly. If you set "call key" to the record ID plus the renewal date in an earlier step, re-enrolment next year produces a new key and a new call; a retry this week does not. If you'd rather not, leave `external_id` out: the "already queued" check still prevents a second call while the first is pending, but a re-enrolment after the first call finished will call again.

HubSpot phone properties are free text, so expect `(415) 555-0100` and similar. Add a country field to `context` or clean numbers before they reach the workflow. HubSpot's optional rate limit on the webhook action is useful if you enrol thousands at once, though the campaign's own concurrency and calls-per-hour limits already pace the calling.

## An in-house cron job

If your data lives in your own database, a scheduled script is often simpler than a journey tool. A worked example for the registered-but-no-deposit case:

```python
import json, os, datetime, urllib.request

URL = os.environ["MILO_CAMPAIGN_URL"]   # the campaign's secret URL
today = datetime.date.today().isoformat()

rows = db.query("""
  select id, phone_e164, first_name, language
  from players
  where registered_at between now() - interval '72 hours'
                          and now() - interval '48 hours'
    and first_deposit_at is null
    and marketing_calls_consent = true
""")

people = [{
    "phone": r.phone_e164,
    "name": r.first_name,
    "player_id": str(r.id),
    "external_id": f"nodeposit-{r.id}",   # one call per player, ever
    "language": r.language or "en",
    "offer_code": "WELCOME100",
} for r in rows]

for i in range(0, len(people), 500):        # 500 per request
    body = json.dumps(people[i:i + 500]).encode()
    req = urllib.request.Request(URL, data=body,
          headers={"Content-Type": "application/json"}, method="POST")
    with urllib.request.urlopen(req, timeout=30) as resp:
        result = json.load(resp)
        log(result["accepted"], result["duplicates"], result["rejected"])
```

Because the key is stable, you can run this every hour, or rerun it after a crash, without anyone being called twice. The 24-hour window in the query plus the key gives you belt and braces. Note the consent column in the `where` clause: whether you may call someone is your system's decision, and the cron job is where it has to be enforced.

## Getting the results back

For Customer.io, results flow back natively as attributes and events. For everything else, add a webhook endpoint in Dial Milo's settings for the **Campaign call completed** event. Each finished call is POSTed to your endpoint as `campaign.call_completed`, with the player fields you sent echoed back (so you can match on `player_id` or `external_id`), the call status and duration, whether it was the final attempt, and the outcome: result, offer, callback time, opted out, safer-gambling flag and summary.

Each delivery is signed. Verify it before trusting it:

```js
import crypto from "node:crypto"

function verify(rawBody, headers, secret) {
  const ts = headers["x-dialmilo-timestamp"]
  const expected = "sha256=" + crypto
    .createHmac("sha256", secret)
    .update(`${ts}.${rawBody}`)
    .digest("hex")
  const given = headers["x-dialmilo-signature"] || ""
  return given.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))
}
```

Hash the raw body exactly as received, not a re-serialised copy. Then write the outcome back to your CRM through its own API, or through middleware you already run. Branch on it the same way a Customer.io journey would:

- **Offer accepted:** send the confirmation by email and SMS from your own tools.
- **Callback requested:** wait until `callback_at`. Milo calls back itself if the campaign is still running; your journey just shouldn't send a competing message.
- **Opted out:** suppress the person from calls everywhere, not just in this campaign.
- **Final attempt, no answer:** fall back to email.

## Before you switch it on

1. Put your own number through the whole chain: CRM event, webhook, call, result back in the CRM.
2. Send the same request twice and confirm the second shows up as a duplicate.
3. Send a deliberately bad phone number and an unknown offer code and check your logs capture the `rejected` reasons.
4. Set a total and daily budget on the campaign. A misconfigured segment that enrols 40,000 people should hit a cap and an email alert, not your balance. Calls that don't connect have no minute charge, but connected ones add up; outbound runs roughly 14–20¢ a minute all in for US, UK and Dutch numbers, and you can price any number on the [rates page](/rates).

If you're building this for speed, the [speed-to-lead guide](/hub/speed-to-lead) covers why the first few minutes after a form fill matter. The [outbound campaign help article](/help/running-an-outbound-campaign) covers the campaign settings the webhook relies on. Dial Milo is pay as you go from a $10 top-up; [create an account](/signup), make a campaign and copy its URL into your journey.

## Frequently asked

**Can I trigger phone calls from any CRM?**

Any CRM, journey builder or in-house system that can send an HTTPS POST with a JSON body can start a Dial Milo call. That includes Customer.io, Braze webhook campaigns and Canvas steps, HubSpot workflows with the Send a webhook action, Optimove, and a cron job on your own server. Customer.io also gets results back natively; the others receive a signed results webhook.

**What stops the same person being called twice when a journey re-fires?**

Two things. Send an external_id with every request and Dial Milo ignores any later request with the same external_id for that campaign. Separately, a phone number that already has a call queued or in progress in the campaign is not queued again, even without an external_id.

**How do I schedule a call for later instead of now?**

Add an at field with an ISO 8601 date-time, such as 2026-11-20T18:00:00Z. The call is queued for that moment and still respects the campaign's calling hours, pause state and budget, so a time outside the person's calling window waits for the next allowed slot.

**What happens if my CRM retries a webhook that already succeeded?**

Nothing harmful, provided you send a stable external_id. Customer.io, Braze and HubSpot all retry on timeouts and server errors, sometimes hours later. The retried request is counted as a duplicate and the person is not queued a second time.

**Do I need a native HubSpot or Braze integration?**

No. Dial Milo has a native two-way integration with Customer.io only. Braze, HubSpot, Optimove and in-house systems use the same start-a-call webhook, and they get call outcomes back through Dial Milo's signed results webhook, which you point at your own endpoint or middleware.
