ml-connector
OdooTwilio

Odoo and Twilio integration

Odoo manages your business data - customers, vendors, employees, and transactions. Twilio delivers messages and voice calls at scale. Connecting the two lets you send order confirmations, payment reminders, and delivery alerts from Odoo directly to customer phones via Twilio SMS, while simultaneously logging every incoming message and call back into Odoo as a contact activity. This keeps your customer communication audit trail attached to the customer record in Odoo without manual re-entry or separate tools.

How Odoo works

Odoo exposes res.partner (contacts), account.move (invoices and expenses), purchase.order, account.payment, hr.employee, and other business entities through XML-RPC over HTTP POST to {base_url}/xmlrpc/2/object or JSON-2 REST to {base_url}/json/2/{model}/{method} on Odoo Online, Odoo.sh, or self-hosted instances. Authentication uses an API key paired with username login, and JSON-2 accepts the API key as a Bearer token in the Authorization header. Odoo has no production-grade webhooks, so external systems must poll using high-water-mark timestamp filters on the write_date field for incremental reads.

How Twilio works

Twilio is a REST-based communications platform with endpoints for SMS, voice calls, messaging services, and phone number management at https://api.twilio.com/2010-04-01 and regional variants. Authentication is HTTP Basic Auth using either Account SID plus Auth Token, or an API Key SID plus API Secret. Twilio provides outgoing APIs to send SMS and voice messages, and webhooks for real-time inbound message and call events, status callbacks, and recording completion notifications. Webhook signature validation uses HMAC-SHA1 with the Auth Token as the key.

What moves between them

Odoo contact records (res.partner with phone and mobile fields) flow into Twilio for outbound SMS and call campaigns managed from Odoo or triggered by workflows. Incoming SMS messages and voice calls are received via Twilio webhooks and logged back into Odoo as customer activities (mail.activity or crm.activity records) linked to the matching contact. Outbound transactional messages such as order confirmations and payment reminders originate in Odoo and are routed through Twilio for immediate delivery. The integration runs on a schedule you set, with incremental Odoo polls triggered by write_date changes on res.partner and message delivery tracked via Twilio status callbacks.

How ml-connector handles it

ml-connector stores Twilio Account SID and Auth Token encrypted and presents HTTP Basic Auth on every Twilio API call. On the Odoo side, it accepts the instance URL (Odoo Online, Odoo.sh, or self-hosted) and the API key, then polls res.partner records using a high-water-mark timestamp on write_date to detect new or updated contacts. Outbound SMS and voice messages are initiated by server-side Odoo actions or workflows and queued for delivery through Twilio. Twilio webhooks push incoming message and call events to a webhook listener in ml-connector, which parses the HMAC-SHA1 signature for authenticity and writes matching activities back into Odoo using the JSON-2 API. Contact phone numbers are normalized before lookup to handle international format variations. Twilio rate limits and status callbacks are tracked so message delivery failures can be detected and retried. Every interaction carries an audit trail linking the Twilio message ID and Odoo activity record.

A real-world example

A regional B2B services company manages customer contracts and invoices in Odoo and uses Twilio to deliver SMS alerts and voice confirmations for field technician appointments and service completion. Before the integration, appointment confirmations were sent manually from Odoo via a separate Twilio dashboard, and incoming customer confirmation replies over SMS were copied by hand into Odoo activity notes. With Odoo and Twilio connected, workflow-triggered appointment reminders now send automatically to customer phones via SMS, and every incoming response is logged directly into Odoo against the customer record, creating a complete communication trail linked to the contract. The team no longer toggles between two platforms or re-enters message content.

What you can do

  • Sync Odoo contacts (res.partner) to Twilio for outbound SMS and voice notifications with phone number normalization.
  • Send transactional SMS messages and voice calls from Odoo workflows and server actions through Twilio without leaving Odoo.
  • Receive incoming Twilio SMS and voice events via webhooks and log them as activities in Odoo linked to the matching contact.
  • Validate Twilio webhook signatures using HMAC-SHA1 to ensure message authenticity and prevent replay attacks.
  • Track Twilio message delivery status and correlate status callbacks with Odoo records for a complete audit trail.

Questions

Can I send SMS from Odoo to Twilio and receive replies back in Odoo?
Yes. Odoo workflows and server actions can trigger outbound SMS through Twilio REST endpoints. Incoming replies are received via Twilio webhooks, validated, and logged as customer activities in Odoo linked to the originating contact. Every message carries a Twilio message ID and Odoo record reference for full traceability.
How does ml-connector handle Odoo's lack of production webhooks?
ml-connector polls Odoo res.partner records on a schedule you set, using the write_date field with a high-water-mark timestamp to fetch only new or changed contacts since the last run. This avoids full table scans and keeps the polling cadence efficient. Outbound messages initiated from Odoo are pushed immediately to Twilio without waiting for the next poll cycle.
What authentication does Twilio require, and is it secure?
Twilio uses HTTP Basic Auth with Account SID and Auth Token (or API Key SID and Secret). ml-connector stores these credentials encrypted in the database and presents them on every API call. Webhook events from Twilio are validated using HMAC-SHA1 signatures with your Auth Token as the key, ensuring that only authentic Twilio requests update your Odoo records.

Related integrations

Connect Odoo and Twilio

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started