> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio

> 3 production-ready jobs — SMS conversation analysis with Mave, call recording transcription to meeting-style analysis, and WhatsApp business message persona insights

Twilio handles billions of communications — SMS, voice calls, and WhatsApp messages — making it the richest source of actual customer language most companies ignore. These three jobs pull conversation data from Twilio's REST API and Conversations API into Mavera's surfaces (Mave Agent, Brand Voice, Personas, Generate) to analyze SMS patterns, turn call recordings into meeting-style intelligence, and extract persona insights from WhatsApp business conversations.

***

## API Reference Card

| Detail                | Value                                                                    |
| --------------------- | ------------------------------------------------------------------------ |
| **Messaging API**     | `https://api.twilio.com/2010-04-01/Accounts/{sid}/Messages.json`         |
| **Conversations API** | `https://conversations.twilio.com/v1`                                    |
| **Auth**              | HTTP Basic Auth (`AccountSid:AuthToken`)                                 |
| **Rate limits**       | Conversations: 20 req/sec; Messaging: 100 req/sec                        |
| **Recordings**        | `https://api.twilio.com/2010-04-01/Accounts/{sid}/Recordings/{sid}.json` |
| **Mavera base**       | `https://app.mavera.io/api/v1`                                           |
| **Mavera auth**       | `Authorization: Bearer mvra_live_...`                                    |

<Info>
  All examples use `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, and `MAVERA_API_KEY`. Twilio uses HTTP Basic Auth with your Account SID as username and Auth Token as password. Find both in your [Twilio Console](https://console.twilio.com/).
</Info>

***

## Prerequisites

<Steps>
  <Step title="Twilio account with messaging">You need an active Twilio account with at least one phone number provisioned for SMS. For WhatsApp, you need a [WhatsApp Business Profile](https://www.twilio.com/docs/whatsapp) approved.</Step>
  <Step title="Account credentials">Find your Account SID and Auth Token in the [Twilio Console](https://console.twilio.com/) dashboard.</Step>
  <Step title="Call recordings enabled">For Job 2, enable call recording in your TwiML or Studio flows. Recordings are stored as audio files accessible via the Recordings API.</Step>
  <Step title="Mavera API key">Get your key from [Mavera dashboard](https://app.mavera.io/settings/api-keys).</Step>

  <Step title="Environment variables">
    ```bash theme={"dark"}
    export TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    export TWILIO_AUTH_TOKEN="your-auth-token"
    export MAVERA_API_KEY="mvra_live_xxxxx"
    ```
  </Step>
</Steps>

***

## Jobs

| # | Job                                                                  | Twilio Data       | Mavera Surface    | Output                           |
| - | -------------------------------------------------------------------- | ----------------- | ----------------- | -------------------------------- |
| 1 | [SMS Conversation Analysis](sms-conversation-analysis)               | Conversations API | Mave Agent (Chat) | Conversation intelligence report |
| 2 | [Call Recording → Meeting Analysis](call-recording-meeting-analysis) | Recordings API    | Mave Agent (Chat) | Meeting-style call analysis      |
| 3 | [WhatsApp Messages → Persona Insights](whatsapp-persona-insights)    | Messages API      | Personas + Speak  | Persona-based insight report     |

***

## Rate Limits & Production Notes

| Twilio Endpoint   | Limit              | Strategy                                  |
| ----------------- | ------------------ | ----------------------------------------- |
| Conversations API | 20 req/sec         | Batch conversation fetches; cache locally |
| Messages API      | 100 req/sec        | Paginate with `PageSize=200`              |
| Recordings API    | 100 req/sec        | Fetch only recordings with transcriptions |
| WhatsApp outbound | Template-dependent | Pre-approve templates in Twilio Console   |

<Warning>
  Twilio bills per API call and per message. The jobs above make 5-50 API calls per run — negligible cost. However, WhatsApp Business API has a 24-hour reply window and requires pre-approved templates for outbound messages. SMS opt-out compliance (STOP/HELP) is mandatory. Store credentials in env vars. Never log auth tokens. For call recordings, respect retention policies and data privacy regulations. Monitor Mavera credits at [Dashboard](https://app.mavera.io/settings/usage).
</Warning>

***

<CardGroup cols={3}>
  <Card title="All Integrations" icon="plug" href="/integrations" />

  <Card title="Twilio API Docs" icon="phone" href="https://www.twilio.com/docs" />

  <Card title="Brand Voice" icon="microphone" href="/features/brand-voice" />

  <Card title="Personas" icon="user" href="/features/personas" />

  <Card title="Mave Agent" icon="brain" href="/features/mave-agent" />

  <Card title="Generate" icon="pen" href="/features/generate" />
</CardGroup>
