LaraCopilot
LaraCopilot
Integrations

Twilio

Connect your Twilio account so the LaraCopilot AI agent and your generated apps can send SMS, WhatsApp, and OTP messages to your users.

LaraCopilot can connect to your own Twilio account so that both the AI assistant and the apps you generate can send SMS and WhatsApp messages. You add your Twilio credentials once at the account level, and they're forwarded to the AI on each request and synced into every generated project's .env.

This integration is messaging-only — it wires up sending SMS/WhatsApp (and OTP-style verification flows). It does not configure Twilio Voice, Video, or other Twilio products.

Step 1 — Get your Twilio credentials

  1. Sign in to the Twilio Console
  2. From the dashboard, copy your Account SID and Auth Token
  3. Note the phone number(s) you've provisioned for SMS, and — if you use WhatsApp — your WhatsApp-enabled sender

A Twilio trial account works too. On a trial account you can only send to numbers you've verified in the Twilio Console, and every message is prefixed with "Sent from a Twilio trial account."

Step 2 — Connect Twilio to LaraCopilot

  1. In LaraCopilot, open Twilio from the sidebar
  2. Fill in the connection form:
FieldRequiredNotes
Account SIDYesFrom your Twilio Console dashboard
Auth TokenYesFrom your Twilio Console dashboard
Default From (SMS)NoThe number SMS is sent from by default
WhatsApp FromNoYour WhatsApp-enabled sender (include the whatsapp: prefix)
Messaging Service SIDNoUse a Twilio Messaging Service instead of a single number
Account labelNoA friendly name to identify this account
  1. Click Save — LaraCopilot verifies the credentials against Twilio and, on success, shows a Connected status

Once connected, the page can look up the numbers available on your account and offer them when choosing a default From number.

WhatsApp senders must be approved by Twilio (or set up through the WhatsApp sandbox) before they can send. Always include the whatsapp: prefix on a WhatsApp From number, e.g. whatsapp:+14155238886.

How your apps use Twilio

When your account has a Twilio connection, the credentials are:

  • Forwarded to the AI agent per request, so it knows your connected sender details when generating messaging code

  • Synced into each generated project's .env as:

    TWILIO_ACCOUNT_SID=...
    TWILIO_AUTH_TOKEN=...
    TWILIO_FROM=...                  # default SMS sender
    TWILIO_WHATSAPP_FROM=...         # WhatsApp sender (whatsapp: prefix)
    TWILIO_MESSAGING_SERVICE_SID=... # optional

Generated apps call Twilio's REST API directly through Laravel's HTTP client — no Twilio SDK is installed or required. Sends are typically queued so they don't block requests.

When generating code, the AI only writes the messaging logic — it does not send a live message. It will send a real test message only when you explicitly ask it to (for example, "send a test SMS to my verified number").

Connection status

The Twilio page shows the details of your saved connection, including the account label, the last four characters of your Account SID, your default From and WhatsApp numbers, any Messaging Service SID, and whether the account is a trial account.

Disconnecting

To remove the connection, click Disconnect (or Remove) on the Twilio page. Your stored credentials are deleted. Existing generated projects keep the values already written to their .env until you change or regenerate them.

Troubleshooting

ProblemSolution
"Something went wrong with Twilio" after savingRe-check the Account SID and Auth Token — they're copied exactly from the Twilio Console dashboard.
Messages don't arrive on a trial accountVerify the recipient number in the Twilio Console; trial accounts can only message verified numbers.
WhatsApp messages failConfirm your WhatsApp sender is approved (or in the sandbox) and that the number includes the whatsapp: prefix.
No numbers appear to choose fromMake sure the credentials are saved and valid; the number list is fetched live from your Twilio account.

On this page