Skip to main content

Scenario

Your sales, support, or appointment-reminder SMS flows generate thousands of two-way conversations. This job pulls conversations from Twilio’s Conversations API, aggregates message threads, and sends them to Mave for structured analysis — response rates, sentiment patterns, drop-off points, and messaging optimization recommendations. Flow: Twilio GET /v1/ConversationsGET /v1/Conversations/{sid}/Messages → Mavera POST /mave/chat → Conversation intelligence

Code

Example Output

Error Handling

The Conversations API (conversations.twilio.com) manages multi-party threads. The older Messages API (api.twilio.com) stores individual SMS records. Use Conversations for thread-level analysis, Messages for volume metrics.
Conversations API: 20 req/sec. The code fetches 30 conversations × 1 message request = 30 calls. At 100ms delay, ~3 seconds total. Well within limits.
SMS has 160-char segments. Long messages are concatenated by carriers. Twilio stores the full message body. No truncation handling needed.