Skip to content

Connecting Your Account

Connecting your Twilio account to Loquent stores your credentials securely in Loquent’s database and enables BYO mode for your organization. No changes are made to your Twilio account during this step.

  • A Twilio account with at least one active phone number (or the ability to buy one)
  • Your Account SID — starts with AC, found on the Twilio Console homepage
  • Your Auth Token — found on the same page (click to reveal)
  1. Go to Settings in the Loquent dashboard
  2. Find the Twilio section (requires Twilio:Collection:Create permission or org owner)
  3. Enter your Account SID and Auth Token
  4. Click Connect

Loquent validates your credentials against the Twilio API before saving. If the credentials are invalid, you’ll see an error and nothing is written.

On success:

  • The form shows your masked SID (e.g. AC••••••••1234)
  • organization.byo_twilio is set to true
  • Your credentials are stored in organization.twilio_account_sid and organization.twilio_auth_token
POST /api/twilio/connect
→ Calls GET https://api.twilio.com/2010-04-01/Accounts/{sid}.json
with Basic auth (sid:token)
→ If 2xx: saves credentials to org record, sets byo_twilio = true
→ If error: returns validation failure, nothing written

The Auth Token is never returned in any API response and is never logged. The GET /api/settings endpoint only returns the masked SID.

Once connected, all Twilio operations use your credentials:

Every Twilio API call:
1. Load org record
2. org.twilio_account_sid present? → use BYO credentials
3. org.byo_twilio = true but no SID? → error (no shared fallback)
4. org.byo_twilio = false → use shared Loquent account

The connect endpoint requires the Twilio:Collection:Create permission. Org owners bypass this check.

MethodPathDescription
POST/api/twilio/connectValidate and save BYO credentials
GET/api/settingsReturns byo_twilio flag and masked SID
src/mods/twilio/
├── api/
│ └── connect_twilio_api.rs # POST /api/twilio/connect
└── utils/
└── validate_twilio_credentials_util.rs # Validates via Twilio API
src/mods/settings/
├── api/
│ └── get_settings_api.rs # Returns masked SID
├── types/
│ └── settings_data_type.rs # SettingsData struct
└── components/
└── twilio_connect_section_component.rs # UI connect form