0
# Advanced Services
1
2
Specialized Twilio services including video conferencing, real-time chat, identity verification, push notifications, visual workflows, serverless functions, and contact center solutions.
3
4
## Capabilities
5
6
### Video Conferencing
7
8
Programmable Video API for building video applications with rooms, participants, and recordings.
9
10
```python { .api }
11
class RoomInstance:
12
"""Video room for conferences"""
13
sid: str # Room SID
14
unique_name: str # Room unique name
15
status: str # Room status ('in-progress', 'completed')
16
type: str # Room type ('group', 'peer-to-peer', 'go')
17
max_participants: int # Maximum participants
18
duration: int # Room duration in seconds
19
date_created: datetime # Creation time
20
date_updated: datetime # Last update
21
22
class VideoV1:
23
def rooms(self) -> RoomList:
24
"""Access video rooms"""
25
26
def recordings(self) -> RecordingList:
27
"""Access video recordings"""
28
29
def compositions(self) -> CompositionList:
30
"""Access video compositions"""
31
32
def create(
33
self,
34
unique_name: str = None,
35
type: str = None,
36
status_callback: str = None,
37
status_callback_method: str = None,
38
max_participants: int = None,
39
record_participants_on_connect: bool = None,
40
video_codecs: list = None,
41
media_region: str = None,
42
recording_rules: dict = None,
43
large_room: bool = None
44
) -> RoomInstance:
45
"""
46
Create video room.
47
48
Args:
49
unique_name (str): Unique room identifier
50
type (str): Room type ('group', 'peer-to-peer', 'go')
51
max_participants (int): Maximum participants (default: 50)
52
record_participants_on_connect (bool): Auto-record participants
53
video_codecs (list): Supported video codecs
54
media_region (str): Media processing region
55
56
Returns:
57
RoomInstance: Created room
58
"""
59
```
60
61
### Conversations & Chat
62
63
Real-time messaging and chat functionality with conversation management.
64
65
```python { .api }
66
class ConversationInstance:
67
"""Messaging conversation"""
68
sid: str # Conversation SID
69
unique_name: str # Unique identifier
70
friendly_name: str # Display name
71
attributes: dict # Custom attributes
72
messaging_service_sid: str # Associated messaging service
73
date_created: datetime # Creation time
74
date_updated: datetime # Last update
75
state: str # Conversation state
76
77
class ConversationsV1:
78
def conversations(self) -> ConversationList:
79
"""Access conversations"""
80
81
def users(self) -> UserList:
82
"""Access conversation users"""
83
84
def services(self) -> ServiceList:
85
"""Access conversation services"""
86
87
def create(
88
self,
89
friendly_name: str = None,
90
unique_name: str = None,
91
attributes: dict = None,
92
messaging_service_sid: str = None,
93
date_created: datetime = None,
94
date_updated: datetime = None,
95
state: str = None,
96
timers: dict = None,
97
bindings: dict = None
98
) -> ConversationInstance:
99
"""
100
Create conversation.
101
102
Args:
103
friendly_name (str): Display name
104
unique_name (str): Unique identifier
105
attributes (dict): Custom metadata
106
messaging_service_sid (str): Messaging service
107
108
Returns:
109
ConversationInstance: Created conversation
110
"""
111
```
112
113
### Identity Verification
114
115
Verify user identities via SMS, voice, email, or push notifications.
116
117
```python { .api }
118
class ServiceInstance:
119
"""Verification service"""
120
sid: str # Service SID
121
account_sid: str # Account SID
122
friendly_name: str # Service name
123
code_length: int # Verification code length
124
lookup_enabled: bool # Phone lookup enabled
125
psd2_enabled: bool # PSD2 compliance enabled
126
skip_sms_to_landlines: bool # Skip SMS to landlines
127
dtmf_input_required: bool # Require DTMF input
128
tts_name: str # Text-to-speech voice
129
date_created: datetime # Creation time
130
date_updated: datetime # Last update
131
132
class VerificationInstance:
133
"""Identity verification attempt"""
134
sid: str # Verification SID
135
service_sid: str # Service SID
136
account_sid: str # Account SID
137
to: str # Recipient identifier
138
channel: str # Verification channel
139
status: str # Verification status
140
valid: bool # Is verification valid
141
date_created: datetime # Creation time
142
date_updated: datetime # Last update
143
144
class VerifyV2:
145
def services(self) -> ServiceList:
146
"""Access verification services"""
147
148
def create(
149
self,
150
to: str,
151
channel: str,
152
custom_friendly_name: str = None,
153
custom_message: str = None,
154
send_digits: str = None,
155
locale: str = None,
156
custom_code: str = None,
157
amount: str = None,
158
payee: str = None,
159
rate_limits: dict = None,
160
channel_configuration: dict = None,
161
app_hash: str = None,
162
template_sid: str = None,
163
template_custom_substitutions: dict = None,
164
device_ip: str = None,
165
risk_check: str = None,
166
tags: dict = None
167
) -> VerificationInstance:
168
"""
169
Start verification process.
170
171
Args:
172
to (str): Phone number or email to verify
173
channel (str): Channel ('sms', 'call', 'email', 'whatsapp')
174
custom_message (str): Custom verification message
175
locale (str): Localization language
176
177
Returns:
178
VerificationInstance: Started verification
179
"""
180
```
181
182
### Push Notifications
183
184
Send push notifications to mobile apps and web browsers.
185
186
```python { .api }
187
class NotificationInstance:
188
"""Push notification"""
189
sid: str # Notification SID
190
account_sid: str # Account SID
191
service_sid: str # Notify service SID
192
date_created: datetime # Creation time
193
identities: list # Target identities
194
tags: list # Target tags
195
segments: list # Target segments
196
priority: str # Notification priority
197
ttl: int # Time to live
198
title: str # Notification title
199
body: str # Notification body
200
sound: str # Notification sound
201
action: str # Action URL
202
data: dict # Custom data
203
apn: dict # Apple Push settings
204
gcm: dict # Google Cloud Messaging settings
205
fcm: dict # Firebase Cloud Messaging settings
206
sms: dict # SMS fallback settings
207
208
class NotifyV1:
209
def services(self) -> ServiceList:
210
"""Access notification services"""
211
212
def create(
213
self,
214
identity: list = None,
215
tag: list = None,
216
body: str = None,
217
priority: str = None,
218
ttl: int = None,
219
title: str = None,
220
sound: str = None,
221
action: str = None,
222
data: dict = None,
223
apn: dict = None,
224
gcm: dict = None,
225
fcm: dict = None,
226
sms: dict = None,
227
facebook_messenger: dict = None,
228
alexa: dict = None
229
) -> NotificationInstance:
230
"""
231
Send push notification.
232
233
Args:
234
identity (list): Target user identities
235
tag (list): Target user tags
236
body (str): Notification message
237
title (str): Notification title
238
data (dict): Custom payload data
239
240
Returns:
241
NotificationInstance: Sent notification
242
"""
243
```
244
245
### Real-time Data Sync
246
247
Synchronize data across devices and applications in real-time.
248
249
```python { .api }
250
class DocumentInstance:
251
"""Sync document"""
252
sid: str # Document SID
253
unique_name: str # Document name
254
account_sid: str # Account SID
255
service_sid: str # Sync service SID
256
url: str # Document URL
257
links: dict # Related resources
258
revision: str # Document revision
259
data: dict # Document data
260
date_expires: datetime # Expiration time
261
date_created: datetime # Creation time
262
date_updated: datetime # Last update
263
created_by: str # Creator identity
264
265
class SyncV1:
266
def services(self) -> ServiceList:
267
"""Access sync services"""
268
269
def update(
270
self,
271
data: dict = None,
272
ttl: int = None,
273
if_match: str = None
274
) -> DocumentInstance:
275
"""
276
Update sync document.
277
278
Args:
279
data (dict): Document data
280
ttl (int): Time to live in seconds
281
if_match (str): Conditional update revision
282
283
Returns:
284
DocumentInstance: Updated document
285
"""
286
```
287
288
### Studio Workflows
289
290
Visual workflow builder for complex communication flows.
291
292
```python { .api }
293
class FlowInstance:
294
"""Studio flow"""
295
sid: str # Flow SID
296
account_sid: str # Account SID
297
friendly_name: str # Flow name
298
definition: dict # Flow definition JSON
299
status: str # Flow status
300
revision: int # Flow revision number
301
commit_message: str # Last commit message
302
valid: bool # Is flow valid
303
errors: list # Validation errors
304
warnings: list # Validation warnings
305
date_created: datetime # Creation time
306
date_updated: datetime # Last update
307
date_published: datetime # Publication time
308
url: str # Flow URL
309
webhook_url: str # Webhook URL
310
311
class ExecutionInstance:
312
"""Flow execution"""
313
sid: str # Execution SID
314
account_sid: str # Account SID
315
flow_sid: str # Flow SID
316
contact_channel_address: str # Contact address
317
context: dict # Execution context
318
status: str # Execution status
319
date_created: datetime # Start time
320
date_updated: datetime # Last update
321
322
class StudioV2:
323
def flows(self) -> FlowList:
324
"""Access Studio flows"""
325
326
def create(
327
self,
328
friendly_name: str,
329
status: str,
330
definition: dict = None,
331
commit_message: str = None
332
) -> FlowInstance:
333
"""
334
Create Studio flow.
335
336
Args:
337
friendly_name (str): Flow name
338
status (str): Flow status ('draft' or 'published')
339
definition (dict): Flow widget definition
340
commit_message (str): Commit message
341
342
Returns:
343
FlowInstance: Created flow
344
"""
345
```
346
347
### Serverless Functions
348
349
Deploy and manage serverless functions and assets.
350
351
```python { .api }
352
class FunctionInstance:
353
"""Serverless function"""
354
sid: str # Function SID
355
account_sid: str # Account SID
356
service_sid: str # Service SID
357
friendly_name: str # Function name
358
date_created: datetime # Creation time
359
date_updated: datetime # Last update
360
url: str # Function URL
361
links: dict # Related resources
362
363
class AssetInstance:
364
"""Serverless asset"""
365
sid: str # Asset SID
366
account_sid: str # Account SID
367
service_sid: str # Service SID
368
friendly_name: str # Asset name
369
date_created: datetime # Creation time
370
date_updated: datetime # Last update
371
url: str # Asset URL
372
links: dict # Related resources
373
374
class ServerlessV1:
375
def services(self) -> ServiceList:
376
"""Access serverless services"""
377
378
### AI Assistants
379
380
AI-powered assistants for building conversational experiences and automation.
381
382
```python { .api }
383
class AssistantInstance:
384
"""AI assistant"""
385
sid: str # Assistant SID
386
account_sid: str # Account SID
387
friendly_name: str # Assistant name
388
unique_name: str # Unique identifier
389
instructions: str # Assistant instructions
390
fallback_actions: list # Fallback actions
391
initiation_actions: list # Initiation actions
392
model_build_sid: str # Associated model build
393
date_created: datetime # Creation time
394
date_updated: datetime # Last update
395
396
class AssistantsV1:
397
def assistants(self) -> AssistantList:
398
"""Access AI assistants"""
399
400
def model_builds(self) -> ModelBuildList:
401
"""Access model builds"""
402
403
### Frontline API
404
405
Customer conversation management platform for customer service teams.
406
407
```python { .api }
408
class UserInstance:
409
"""Frontline user"""
410
sid: str # User SID
411
identity: str # User identity
412
friendly_name: str # Display name
413
avatar: str # Avatar URL
414
state: str # User state
415
is_available: bool # Availability status
416
date_created: datetime # Creation time
417
date_updated: datetime # Last update
418
419
class Frontline_ApiV1:
420
def users(self) -> UserList:
421
"""Access Frontline users"""
422
```
423
424
Usage examples:
425
426
```python
427
# Create video room
428
room = client.video.v1.rooms.create(
429
unique_name="daily-standup",
430
type="group",
431
max_participants=10
432
)
433
434
# Start verification
435
verification = client.verify.v2.services.get("VAxxxxx").verifications.create(
436
to="+15551234567",
437
channel="sms"
438
)
439
440
# Send push notification
441
notification = client.notify.v1.services.get("ISxxxxx").notifications.create(
442
identity=["alice", "bob"],
443
body="New message received"
444
)
445
446
# Update sync document
447
document = client.sync.v1.services.get("ISxxxxx").documents.get("MyDoc").update(
448
data={"counter": 42, "updated": "now"}
449
)
450
```