---
title: "Twilio Flex Connector"
description: "Vollständiger Leitfaden zur Twilio-Flex-Integration für die Synchronisierung von Contact-Center-Interaktionen, Agent:innen-Aktivität und Kund:innen-Gesprächen mit Brevo über Tajo."
url: https://tajo.io/de/docs/connectors/custom/twilio-flex/
markdown: https://tajo.io/de/docs/connectors/custom/twilio-flex.md
lang: de-DE
robots: noindex
---

Beantrage frühzeitigen Zugang

Gib deinen Vornamen und deine geschäftliche E-Mail-Adresse ein. Wir senden dir einen Link, mit dem du deine Anfrage für den Tajo-Zugang bestätigst.

# Twilio Flex Connector

Connector-Status: Geplant Noch nicht gebaut. Tajo betreibt diesen Connector heute nicht.

| Quellfeld | Zielfeld | Beispielwert |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

Verbinde dein Twilio-Flex-Contact-Center über Tajo mit Brevo, um einheitliche Kund:innen-Interaktionshistorien, Post-Conversation-Marketing-Flows und supportgetriebene Engagement-Analysen zu ermöglichen.

## Überblick

| Eigenschaft | Wert |
| --- | --- |
| **Plattform** | Twilio Flex |
| **Kategorie** | Custom |
| **Einrichtungsaufwand** | Fortgeschritten |
| **Offizielle Integration** | Nein |
| **Synchronisierte Daten** | Kund:innen, Gespräche, Events |
| **Genutzte APIs** | Flex API, Conversations API, TaskRouter API |
| **Authentifizierung** | Account SID + Auth Token / API Key |
| **Basis-URL** | `https://flex-api.twilio.com` |

## Funktionen

- **Gesprächs-Synchronisation** - Leite Voice-, SMS-, WhatsApp- und Chat-Interaktionen an Brevo-Zeitleisten weiter
- **Kund:innen-Profil-Anreicherung** - Synchronisiere Flex-Kund:innen-Daten in Brevo-Kontaktattribute
- **Post-Interaktions-Kampagnen** - Löse Brevo-Workflows nach Ende von Support-Gesprächen aus
- **CSAT-Event-Tracking** - Synchronisiere Ergebnisse von Zufriedenheitsumfragen als Brevo-Events
- **Agent:innen-Aktivitätsdaten** - Verfolge Agent:innen-Performance-Metriken fürs operative Reporting
- **Queue-Analysen** - Leite Wartezeit- und Abbruchdaten für die Experience-Optimierung weiter

## Voraussetzungen

Bevor du beginnst, stelle sicher, dass du Folgendes hast:

1. Ein Twilio-Konto mit aktiviertem Flex
2. Deine Twilio Account SID und deinen Auth Token
3. Eine Flex-Instanz mit aktiven Channels (Voice, SMS, Chat oder WhatsApp)
4. Einen konfigurierten TaskRouter-Workspace
5. Ein Brevo-Konto mit API-Zugriff
6. Ein Tajo-Konto mit aktivem Abonnement

## Authentifizierung

Twilio Flex nutzt die Standard-Authentifizierungsmethoden von Twilio.

### Konto-Zugangsdaten

```bash
# Basic Auth: Account SID as username, Auth Token as password
curl -X GET "https://flex-api.twilio.com/v1/Configuration" \
  -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN"
```

### API Key (empfohlen für Produktion)

1. Gehe zu **Twilio Console** > **Account** > **API keys & tokens**
2. Klicke auf **Create API Key**
3. Wähle den Key-Typ **Standard**
4. Speichere SID und Secret sicher

```bash
curl -X GET "https://flex-api.twilio.com/v1/Configuration" \
  -u "$TWILIO_API_KEY_SID:$TWILIO_API_KEY_SECRET"
```

Auth Token vs. API Key

Dein Auth Token gewährt vollständigen Kontozugriff. Für die Produktion nutze gescopte API Keys. API Keys lassen sich einzeln widerrufen, ohne andere Integrationen zu stören.

### Verbinden mit Tajo

```bash
tajo connectors install twilio-flex \
  --account-sid $TWILIO_ACCOUNT_SID \
  --auth-token $TWILIO_AUTH_TOKEN \
  --flex-flow-sid $TWILIO_FLEX_FLOW_SID
```

## Konfiguration

### Grundeinrichtung

```yaml
connectors:
  twilio_flex:
    enabled: true
    account_sid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    flex_flow_sid: "FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

    sync:
      conversations: true
      tasks: true
      customers: true
      csat: true
      agent_activity: false

    lists:
      support_contacts: 32
      csat_respondents: 33

    channels:
      - voice
      - sms
      - whatsapp
      - webchat
```

### Feld-Mapping

Mappe Flex-Kund:innen- und Interaktionsdaten auf Brevo-Attribute:

```yaml
field_mapping:
  # Customer fields
  identity: FLEX_IDENTITY
  friendly_name: FIRSTNAME
  attributes.email: email
  attributes.phone: SMS

  # Interaction metrics
  last_conversation_date: LAST_SUPPORT_DATE
  total_conversations: SUPPORT_TICKET_COUNT
  avg_wait_time: AVG_WAIT_TIME
  last_csat_score: CSAT_SCORE
  preferred_channel: PREFERRED_CHANNEL

  # Custom attributes
  customer_tier: VIP_TIER
  account_id: ACCOUNT_ID
```

### Event-Mapping

```yaml
event_mapping:
  task.created: SUPPORT_REQUESTED
  task.completed: SUPPORT_RESOLVED
  task.canceled: SUPPORT_ABANDONED
  conversation.ended: CONVERSATION_ENDED
  survey.completed: CSAT_SUBMITTED
```

## API-Endpoints

Tajo integriert sich mit den folgenden Twilio-Flex- und verwandten API-Endpoints:

| Endpoint | Methode | API | Zweck |
| --- | --- | --- | --- |
| `/v1/Configuration` | GET | Flex | Flex-Konfiguration abrufen |
| `/v1/Interactions` | GET | Flex | Interaktionen auflisten |
| `/v1/Channels` | GET | Flex | Flex-Channels auflisten |
| `/v1/WebChannels` | POST | Flex | Web-Chat-Channel erstellen |
| `/v1/Conversations` | GET | Conversations | Gespräche auflisten |
| `/v1/Conversations/{sid}/Messages` | GET | Conversations | Nachrichten eines Gesprächs auflisten |
| `/v1/Conversations/{sid}/Participants` | GET | Conversations | Teilnehmende auflisten |
| `/v1/Workspaces/{sid}/Tasks` | GET | TaskRouter | Tasks auflisten |
| `/v1/Workspaces/{sid}/Workers` | GET | TaskRouter | Worker (Agent:innen) auflisten |
| `/v1/Workspaces/{sid}/TaskQueues` | GET | TaskRouter | Task-Queues auflisten |
| `/v1/Workspaces/{sid}/Events` | GET | TaskRouter | Workspace-Events auflisten |

## Code-Beispiele

### Connector initialisieren

```javascript
import { TajoClient } from '@tajo/sdk';

const tajo = new TajoClient({
  apiKey: process.env.TAJO_API_KEY,
  brevoApiKey: process.env.BREVO_API_KEY
});

await tajo.connectors.connect('twilio-flex', {
  accountSid: process.env.TWILIO_ACCOUNT_SID,
  authToken: process.env.TWILIO_AUTH_TOKEN,
  flexFlowSid: process.env.TWILIO_FLEX_FLOW_SID
});
```

### Gesprächsverlauf synchronisieren

```javascript
await tajo.connectors.sync('twilio-flex', {
  type: 'incremental',
  resources: ['conversations'],
  since: '2024-01-01',
  channels: ['voice', 'sms', 'whatsapp']
});

const status = await tajo.connectors.status('twilio-flex');
console.log(status);
// {
//   connected: true,
//   lastSync: '2024-03-15T16:00:00Z',
//   conversationsTracked: 12400,
//   customersLinked: 8900,
//   agentsMonitored: 45
// }
```

### Post-Conversation-Kampagnen-Trigger

```javascript
// Trigger a Brevo follow-up after a support conversation ends
app.post('/webhooks/flex/task-complete', async (req, res) => {
  const task = req.body;

  await tajo.connectors.handleEvent('twilio-flex', {
    type: 'task.completed',
    payload: {
      taskSid: task.TaskSid,
      customerEmail: task.TaskAttributes?.email,
      channel: task.TaskChannelUniqueName,
      duration: task.Age,
      queueName: task.TaskQueueFriendlyName
    }
  });

  res.status(200).send('OK');
});
```

### Flex-Plugin-Integration

```javascript
// Inside a Flex UI Plugin - send data to Tajo
import { FlexPlugin } from '@twilio/flex-plugin';

class TajoPlugin extends FlexPlugin {
  init(flex, manager) {
    flex.Actions.addListener('afterCompleteTask', async (payload) => {
      await fetch('https://api.example.com/webhooks/flex/task-complete', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          TaskSid: payload.task.sid,
          TaskAttributes: payload.task.attributes,
          TaskChannelUniqueName: payload.task.taskChannelUniqueName,
          Age: payload.task.age
        })
      });
    });
  }
}
```

Caution

Die Adresse `example.com` oben ist ein Platzhalter, bis der Tajo-Endpunkt verfügbar ist.

## Rate Limits

Twilio erzwingt Rate Limits über seine APIs hinweg:

| API | Rate Limit | Hinweise |
| --- | --- | --- |
| **Flex API** | 100 Anfragen/Sekunde | Pro Konto |
| **Conversations API** | 100 Anfragen/Sekunde | Pro Konto |
| **TaskRouter API** | 30 Read-Anfragen/Sekunde | Pro Workspace |
| **TaskRouter Events** | 20 Anfragen/Sekunde | Pro Workspace |

Event Streams

Für die Verarbeitung großer Event-Volumen empfiehlt sich Twilio Event Streams statt Polling auf TaskRouter-Events. Event Streams pushen Events in Echtzeit über Webhooks oder Kinesis.

## Fehlerbehebung

### Häufige Probleme

| Problem | Ursache | Lösung |
| --- | --- | --- |
| 401 Unauthorized | Ungültige SID oder Token | Account SID und Auth Token in der Twilio Console prüfen |
| 403 Forbidden | Flex nicht aktiviert | Sicherstellen, dass Flex in deinem Twilio-Konto aktiviert ist |
| Gespräche fehlen | Falscher Datumsbereich | Sync-Datumsbereich erweitern oder Gesprächsstatus prüfen |
| Tasks werden nicht erfasst | Falscher TaskRouter-Workspace | Korrekten Workspace-SID prüfen |
| Plugin feuert nicht | Event-Listener nicht registriert | Prüfen, dass das Flex-Plugin deployed und aktiv ist |

### Debug-Modus

```yaml
connectors:
  twilio_flex:
    debug: true
    log_level: verbose
    log_api_calls: true
```

### Verbindung testen

```bash
tajo connectors test twilio-flex
# ✓ Flex API connection successful
# ✓ Conversations API accessible
# ✓ TaskRouter workspace found
# ✓ Agent list readable
# ✓ Queue configuration loaded
```

## Best Practices

1. **API Keys statt Auth Tokens** - API Keys lassen sich scopen und einzeln widerrufen
2. **Event Streams nutzen** - Push-basierte Events sind effizienter als Polling auf TaskRouter
3. **Flex-Plugin bauen** - Nutze ein UI-Plugin, um Task-Completion-Events in Echtzeit zu erfassen
4. **Channels einheitlich mappen** - Normalisiere Voice-, SMS- und Chat-Daten zu einheitlichen Brevo-Events
5. **CSAT-Scores tracken** - Synchronisiere Zufriedenheitsdaten in Brevo für experience-basierte Segmentierung
6. **Queue-Metriken überwachen** - Nutze Wartezeitdaten, um proaktive Kund:innen-Kommunikation auszulösen

## Sicherheit

- **Account SID + Auth Token** - Standard-Twilio-Authentifizierung
- **API Keys** - Widerrufbare Non-Root-Zugangsdaten für den Produktiveinsatz
- **Nur HTTPS** - Die gesamte API-Kommunikation läuft verschlüsselt über TLS 1.2+
- **Webhook-Validierung** - Verifiziere Twilio-Webhook-Signaturen mit `X-Twilio-Signature`
- **PCI-Konformität** - Twilio Flex ist PCI DSS Level 1 konform
- **Verschlüsselte Speicherung** - Zugangsdaten werden in Tajo at Rest verschlüsselt

## Verwandte Ressourcen

- [Gorgias Connector](https://tajo.io/de/docs/connectors/support/gorgias)
- [Jira Connector](https://tajo.io/de/docs/connectors/custom/jira)
- [Customer-Sync-Skill](https://tajo.io/de/docs/skills/data-sync/customer-sync)
- [Brevo Contacts API](https://tajo.io/de/docs/contact-management)
