Skip to content

Set up Twilio

On a self-hosted install, SMS and phone calls go through your own Twilio account. Set it up once and every page by SMS or call uses it. On the cloud we run Twilio for you, so you can skip this page.

You need: a Twilio account with a balance, a phone number that can send SMS and make calls, and a public https:// address for your Argavon install.

1. Account and number

  1. Create a Twilio account and add a balance. A trial account is not enough for paging: when we tested, it blocked SMS with our own text and the call script that reads the page out and takes your keypress. Upgrade the account before you rely on it.
  2. Buy a number with SMS and Voice.
  3. Copy the Account SID and Auth Token from the Twilio console.

2. Settings

Add these to the server's environment (.env with Docker Compose):

TWILIO_ACCOUNT_SID=AC0123456789abcdef0123456789abcdef
TWILIO_AUTH_TOKEN=<your auth token>
TWILIO_FROM_NUMBER=+14155550100
TWILIO_CALLBACK_BASE=https://pager.example.com
Setting Required What it does
TWILIO_ACCOUNT_SID yes Turns on SMS and calls. Without it, the SMS and phone call types don't appear.
TWILIO_AUTH_TOKEN yes Signs the API calls and checks Twilio's callbacks.
TWILIO_FROM_NUMBER yes The number pages come from, in international format. Calls always need it.
TWILIO_MESSAGING_SERVICE_SID no Send SMS through a messaging service instead of the from number. Calls still use TWILIO_FROM_NUMBER.
TWILIO_CALLBACK_BASE no The public address Twilio calls back. Defaults to FRONTEND_ORIGIN when that starts with https://.

Restart the server. It checks the settings at start and refuses to start with a half-set Twilio, for example a missing TWILIO_FROM_NUMBER.

Without a callback address, pages still go out, but an SMS or call counts as sent as soon as Twilio accepts it. Nobody can acknowledge with the keypad or by SMS reply, unanswered calls don't ring again, and the incident page can't say whether a page reached the phone. Set it.

3. Point the number at Argavon

Argavon tells Twilio where to send delivery reports and keypresses with every message and call. You only set up one webhook by hand: the one for SMS replies.

In the Twilio console, open the number in TWILIO_FROM_NUMBER (or each number of the messaging service). Under Messaging, set A message comes in to Webhook, HTTP POST:

<TWILIO_CALLBACK_BASE>/api/v1/hooks/twilio/sms

The full list of webhook addresses:

Address Set by Receives
/api/v1/hooks/twilio/status/<workspace>/<delivery> Argavon, per message and call Delivery reports
/api/v1/hooks/twilio/voice/<workspace>/<delivery> Argavon, per call The key pressed on a call
/api/v1/hooks/twilio/sms you, on the number SMS sent to the number (reply 1 to acknowledge)

Twilio signs each request over its full address. TWILIO_CALLBACK_BASE must be exactly the public address Twilio calls, or the signature doesn't match and the request gets 403. Behind a proxy that changes the host or the scheme, set it explicitly.

4. Test with your own phone

  1. Open My notifications.
  2. Add a contact method of type SMS with your number in international format, such as +14155550100, and click Verify. Type the 6-digit code you get. Do the same for Phone call: the code is read out in a call.
  3. Click Send test next to each method.
  4. Check Recent deliveries on the same page (in the Classic interface). Reached you should say something like "reached the phone in 3 s" for the SMS and "answered in 8 s" for the call. "waiting for the network's report" that never changes means Twilio can't reach TWILIO_CALLBACK_BASE.
  5. Send yourself a real page: trigger a critical alert routed to you, or, in the Pro interface, use Send me a test page on the board. Reply 1 to the SMS. You should get "Acknowledged: " back, and the incident shows as acknowledged.</li> </ol> <p>Codes and test messages don't count against the plan's SMS and calls. Each person can send 10 a day, and a workspace 30.</p> <h2 id="if-it-doesnt-work">If it doesn't work<a class="headerlink" href="#if-it-doesnt-work" title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>What you see</th> <th>What to do</th> </tr> </thead> <tbody> <tr> <td>The server doesn't start: <code>TWILIO_FROM_NUMBER is required (calls always need it)</code></td> <td>Set <code>TWILIO_FROM_NUMBER</code>.</td> </tr> <tr> <td>The SMS and phone call types are missing</td> <td><code>TWILIO_ACCOUNT_SID</code> isn't set on the server, or the server wasn't restarted.</td> </tr> <tr> <td><code>did not reach the phone: Twilio error ...</code></td> <td>Twilio's own error code. Look it up in the Twilio console's error log. On a trial account, upgrade it.</td> </tr> <tr> <td>An SMS reply gets no answer</td> <td>The number's <strong>A message comes in</strong> webhook isn't set, or the reply came from a number that isn't a verified SMS method.</td> </tr> <tr> <td>Twilio's request log shows <code>403</code></td> <td><code>TWILIO_CALLBACK_BASE</code> is not the exact public address Twilio calls.</td> </tr> </tbody> </table> <p>More on contact methods and rules: <a href="../notifications/">Notifications</a>. Paging through Telnyx when Twilio is down: <a href="../telnyx-failover/">Telnyx failover</a>.</p> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type="button" class="md-top md-icon" data-md-component="top" hidden> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class="md-footer"> <nav class="md-footer__inner md-grid" aria-label="Footer" > <a href="../relay/" class="md-footer__link md-footer__link--prev" aria-label="Previous: SMS and voice relay"> <div class="md-footer__button md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </div> <div class="md-footer__title"> <span class="md-footer__direction"> Previous </span> <div class="md-ellipsis"> SMS and voice relay </div> </div> </a> <a href="../telnyx-failover/" class="md-footer__link md-footer__link--next" aria-label="Next: Telnyx failover (Enterprise)"> <div class="md-footer__title"> <span class="md-footer__direction"> Next </span> <div class="md-ellipsis"> Telnyx failover (Enterprise) </div> </div> <div class="md-footer__button md-icon"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg> </div> </a> </nav> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-copyright"> </div> <div class="md-social"> <a href="https://github.com/argavon" target="_blank" rel="noopener" title="Argavon on GitHub" class="md-social__link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> </div> </div> </div> </footer> </div> <div class="md-dialog" data-md-component="dialog"> <div class="md-dialog__inner md-typeset"></div> </div> <div class="md-progress" data-md-component="progress" role="progressbar"></div> <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.tabs.sticky", "navigation.sections", "navigation.top", "navigation.instant", "navigation.instant.progress", "navigation.indexes", "navigation.footer", "toc.follow", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate", "content.tabs.link"], "search": "../../assets/javascripts/workers/search.a7633da7.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script> <script src="../../assets/javascripts/bundle.a5f9d56c.min.js"></script> </body> </html>