Overview
Compliance failures block sends, get numbers suspended, and expose your customer to legal liability. This skill covers the ongoing rules that apply to live traffic — what you can send, when, and to whom.
Lifecycle: Choose numbers (twilio-numbers-senders) → Register them (twilio-compliance-onboarding) → Follow traffic rules (this skill) → Secure everything (twilio-security-hardening)
For registrations required before traffic works (A2P 10DLC, toll-free verification, WhatsApp/RCS sender approval, voice trust programs), see twilio-compliance-onboarding.
TCPA (Telephone Consumer Protection Act)
Applies to all US voice calls and SMS.
Consent Requirements
| Communication type |
Consent required |
Notes |
| Informational SMS (order updates) |
Prior express consent |
Providing phone number during transaction usually qualifies |
| Marketing SMS |
Prior express written consent |
Must be clear and conspicuous, separate from T&C |
| Manual voice calls |
None for existing business relationship |
18-month window |
| Autodialed / prerecorded voice |
Prior express consent (informational) or written (marketing) |
AI voice agents typically count as autodialed and must disclose who is calling |
| Emergency / fraud alerts |
No consent required |
Must be genuinely urgent |
Quiet Hours
- 8:00 AM – 9:00 PM in the recipient's local time zone
- Applies to telemarketing and non-emergency calls
- Your application must determine the recipient's time zone — Twilio does not enforce this
- Use
twilio-lookup-phone-intelligence to determine carrier/region for time zone inference
Do Not Call
- Maintain an internal Do Not Call list
- Honor opt-outs within 10 business days (best practice: immediately)
- Scrub against the National Do Not Call Registry for telemarketing
GDPR (EU/EEA)
Consent for Communications
| Basis |
When it applies |
Requirements |
| Explicit consent |
Marketing messages, new customer outreach |
Must be freely given, specific, informed, unambiguous. Pre-checked boxes do NOT qualify. |
| Legitimate interest |
Transactional messages, existing customer relationship |
Requires documented balancing test. Must offer opt-out. |
| Contractual necessity |
Order confirmations, shipping updates |
Directly related to contract performance |
Right to Deletion
Applies to ALL data stored by your application via Twilio:
- Call recordings and transcripts
- SMS/messaging logs
- Conversation Memory observations and profiles
- Conversation Intelligence operator results
- Customer profiles in your database
Implementation: Build a deletion endpoint that removes data from all systems. Twilio retains message logs for 400 days — you can delete recordings via API but cannot delete message logs from Twilio's system before the retention window.
Call Recording Consent
- EU calls require explicit consent before recording, or a documented legitimate interest basis
- Play a recording notice at the start of every call:
<Say>This call may be recorded for quality assurance.</Say>
- Store consent records with timestamp
PCI DSS (Payment Card Industry)
Never Record Card Numbers
- If recording calls, pause recording during payment:
Python
# Pause recording when customer gives card number
client.calls(call_sid).recordings(recording_sid).update(status="paused")
# Use <Pay> verb instead of collecting card numbers verbally
response = VoiceResponse()
response.pay(
payment_connector="stripe_connector",
charge_amount="49.99",
currency="usd",
status_callback="https://yourapp.com/pay-status"
)
- Never let an LLM process, log, or repeat card numbers
- Never store card numbers in Conversation Memory observations or Conversation Intelligence transcripts
PCI Mode Warning
PCI Mode is IRREVERSIBLE and account-wide. Once enabled:
- All recordings are encrypted
- Transcript access is restricted
- Cannot be disabled — ever
Recommendation: If you need PCI compliance for one use case, create a separate sub-account. See twilio-account-setup.
HIPAA (Healthcare)
Requirements
- BAA required: Execute a Business Associate Agreement with Twilio before handling PHI
- Recording encryption: Mandatory for any call recording containing PHI
- PHI minimization in TTS: Don't speak full patient details via
<Say>. Use minimum necessary information.
- API key rotation: Regular rotation required. See
twilio-iam-auth-setup
- Access controls: Restrict who can access recordings and transcripts
Safe Notification Content
| Channel |
Safe |
Unsafe |
| SMS |
"Your appointment is tomorrow at 2pm" |
"Your appointment with Dr. Smith for diabetes follow-up" |
| Voice IVR |
"Press 1 to confirm your upcoming appointment" |
"Press 1 to confirm your cardiology appointment" |
| Email |
Can include more detail if encrypted/authenticated |
Never send PHI in subject line |
FDCPA / Regulation F (Debt Collection)
Requirements
- Mini-Miranda disclosure required on every communication: "This is an attempt to collect a debt and any information obtained will be used for that purpose."
- Call attempt limits: Max 7 call attempts per debt per 7-day rolling window
- Voicemail: Must include disclosure or use limited-content message (name, phone number, request to call back — no mention of debt)
- SMS consent: Requires separate consent from voice consent
- Time restrictions: Same as TCPA quiet hours (8am-9pm local time)
- Developer responsibility: Twilio does NOT enforce FDCPA limits. Your application must track attempt counts and timing.
Python
# Track call attempts per debt
def can_attempt_call(debt_id, db):
seven_days_ago = datetime.now() - timedelta(days=7)
attempts = db.count_attempts(debt_id, since=seven_days_ago)
return attempts < 7
# Include Mini-Miranda in IVR
response = VoiceResponse()
response.say("This is an attempt to collect a debt and any information obtained will be used for that purpose.")
response.pause(length=1)
response.say("Please press 1 to speak with a representative.")
response.gather(num_digits=1, action="/handle-keypress")
WhatsApp Compliance
Template Requirements
- Outbound messages require pre-approved Message Templates (submitted to Meta, 24-48 hour approval)
- Free-form messages only within 24-hour service window after customer initiates
- Template rejections: vague descriptions, missing variables, promotional language in utility templates
Quality Rating
- WhatsApp enforces quality scoring — too many blocks/reports = rate limited or suspended
- Monitor quality in WhatsApp Manager dashboard
- Opt-in required before sending any WhatsApp messages
Opt-In Best Practices
- Collect WhatsApp-specific consent (separate from SMS consent)
- Clearly state what types of messages will be sent
- Provide easy opt-out (reply STOP)
CAN-SPAM (Email)
- Physical mailing address required in every marketing email
- One-click unsubscribe required (SendGrid handles automatically via List-Unsubscribe header)
- Honor unsubscribe within 10 business days
- Subject line must not be misleading
- "From" address must be accurate
See twilio-sendgrid-email-send for SendGrid-specific compliance features.
SHAKEN/STIR (Caller ID Verification)
Attestation Levels
| Level |
Meaning |
Caller ID display |
| A (Full) |
Carrier vouches for caller identity and right to use number |
Green checkmark ✅ |
| B (Partial) |
Carrier vouches for caller but not number ownership |
Neutral display |
| C (Gateway) |
Carrier knows where call entered network, nothing else |
May show "Spam Likely" |
- Only Level A produces a trusted caller ID display
- Affects answer rates significantly for outbound campaigns
- E.164 formatting required for proper attestation
- Twilio signs outbound calls automatically when you own the number
Consent Management Pattern
Store Consent Records
# Minimum consent record
consent_record = {
"phone": "+15558675310",
"channel": "sms", # sms, voice, whatsapp, email
"consent_type": "marketing", # marketing, transactional, debt_collection
"consent_method": "web_form", # web_form, verbal, paper, api
"consent_timestamp": "2026-04-13T14:30:00Z",
"consent_source": "checkout_page", # where consent was collected
"ip_address": "203.0.113.42", # for web consent
"opted_out": False,
"opt_out_timestamp": None
}
Opt-Out Handling
- Process STOP/CANCEL/UNSUBSCRIBE/END/QUIT keywords immediately
- Messaging Services handle keyword opt-out automatically for SMS
- For voice: maintain your own Do Not Call list
- For WhatsApp: handle via webhook when user blocks
- For email: SendGrid manages suppression lists automatically
CANNOT
- Cannot rely on Twilio to enforce compliance rules — Your application must implement TCPA, GDPR, PCI, and other rules. Twilio provides tools, not enforcement.
- Cannot apply A2P 10DLC registration outside the US — Other countries have their own regimes
- Cannot use public link shorteners (bit.ly, tinyurl, goo.gl, short.io, etc.) — Messages with public short links are categorically filtered by carriers. Use a branded/vanity short domain (e.g.,
go.yourcompany.com) configured in your Messaging Service. Twilio's shared twil.io domain is not sufficient — you must register your own branded domain in Console under Messaging > Link Shortening.
- Cannot reverse PCI Mode — Irreversible and account-wide once enabled
- Cannot fully clear message logs via GDPR deletion — Twilio retains internal message logs for 400 days regardless of deletion requests
- Cannot assume regulations are static — Compliance requirements change. Verify current regulations before launch.
- Cannot apply this skill's guidance outside US/EU — India TRAI DLT, Brazil LGPD, Australia Spam Act, and other jurisdictions require additional research
Next Steps
- Registration before traffic works:
twilio-compliance-onboarding
- WhatsApp sender setup:
twilio-whatsapp-manage-senders
- Credential security:
twilio-iam-auth-setup
- Account structure for PCI isolation:
twilio-account-setup
1---2name: twilio-compliance-traffic3description: >4 Rules for Twilio messaging and voice traffic. Covers TCPA (consent tiers, quiet hours,5 DNC), GDPR (EU consent, right to deletion), PCI DSS (payment recording, Pay verb), HIPAA6 (BAA, PHI), FDCPA (debt collection limits), CAN-SPAM, WhatsApp policies, SHAKEN/STIR,7 and consent management patterns. Use when developers have working traffic to ensure they8 follow the rules.910metadata:11 source: https://skillmd.com/skills/stanfish06/twilio-compliance-traffic12---1314## Overview1516Compliance failures block sends, get numbers suspended, and expose your customer to legal liability. This skill covers the **ongoing rules** that apply to live traffic — what you can send, when, and to whom.1718**Lifecycle:** Choose numbers (`twilio-numbers-senders`) → Register them (`twilio-compliance-onboarding`) → Follow traffic rules (this skill) → Secure everything (`twilio-security-hardening`)1920For registrations required before traffic works (A2P 10DLC, toll-free verification, WhatsApp/RCS sender approval, voice trust programs), see `twilio-compliance-onboarding`.2122---2324## TCPA (Telephone Consumer Protection Act)2526Applies to all US voice calls and SMS.2728### Consent Requirements2930| Communication type | Consent required | Notes |31|-------------------|-----------------|-------|32| Informational SMS (order updates) | Prior express consent | Providing phone number during transaction usually qualifies |33| Marketing SMS | Prior express written consent | Must be clear and conspicuous, separate from T&C |34| Manual voice calls | None for existing business relationship | 18-month window |35| Autodialed / prerecorded voice | Prior express consent (informational) or written (marketing) | AI voice agents typically count as autodialed and must disclose who is calling |36| Emergency / fraud alerts | No consent required | Must be genuinely urgent |3738### Quiet Hours3940- **8:00 AM – 9:00 PM** in the recipient's local time zone41- Applies to telemarketing and non-emergency calls42- Your application must determine the recipient's time zone — Twilio does not enforce this43- Use `twilio-lookup-phone-intelligence` to determine carrier/region for time zone inference4445### Do Not Call4647- Maintain an internal Do Not Call list48- Honor opt-outs within 10 business days (best practice: immediately)49- Scrub against the National Do Not Call Registry for telemarketing5051---5253## GDPR (EU/EEA)5455### Consent for Communications5657| Basis | When it applies | Requirements |58|-------|----------------|-------------|59| Explicit consent | Marketing messages, new customer outreach | Must be freely given, specific, informed, unambiguous. Pre-checked boxes do NOT qualify. |60| Legitimate interest | Transactional messages, existing customer relationship | Requires documented balancing test. Must offer opt-out. |61| Contractual necessity | Order confirmations, shipping updates | Directly related to contract performance |6263### Right to Deletion6465Applies to ALL data stored by your application via Twilio:66- Call recordings and transcripts67- SMS/messaging logs68- Conversation Memory observations and profiles69- Conversation Intelligence operator results70- Customer profiles in your database7172**Implementation:** Build a deletion endpoint that removes data from all systems. Twilio retains message logs for 400 days — you can delete recordings via API but cannot delete message logs from Twilio's system before the retention window.7374### Call Recording Consent7576- EU calls require explicit consent before recording, or a documented legitimate interest basis77- Play a recording notice at the start of every call: `<Say>This call may be recorded for quality assurance.</Say>`78- Store consent records with timestamp7980---8182## PCI DSS (Payment Card Industry)8384### Never Record Card Numbers8586- If recording calls, **pause recording** during payment:8788**Python**89```python90# Pause recording when customer gives card number91client.calls(call_sid).recordings(recording_sid).update(status="paused")9293# Use <Pay> verb instead of collecting card numbers verbally94response = VoiceResponse()95response.pay(96 payment_connector="stripe_connector",97 charge_amount="49.99",98 currency="usd",99 status_callback="https://yourapp.com/pay-status"100)101```102103- Never let an LLM process, log, or repeat card numbers104- Never store card numbers in Conversation Memory observations or Conversation Intelligence transcripts105106### PCI Mode Warning107108**PCI Mode is IRREVERSIBLE and account-wide.** Once enabled:109- All recordings are encrypted110- Transcript access is restricted111- Cannot be disabled — ever112113**Recommendation:** If you need PCI compliance for one use case, create a separate sub-account. See `twilio-account-setup`.114115---116117## HIPAA (Healthcare)118119### Requirements120121- **BAA required:** Execute a Business Associate Agreement with Twilio before handling PHI122- **Recording encryption:** Mandatory for any call recording containing PHI123- **PHI minimization in TTS:** Don't speak full patient details via `<Say>`. Use minimum necessary information.124- **API key rotation:** Regular rotation required. See `twilio-iam-auth-setup`125- **Access controls:** Restrict who can access recordings and transcripts126127### Safe Notification Content128129| Channel | Safe | Unsafe |130|---------|------|--------|131| SMS | "Your appointment is tomorrow at 2pm" | "Your appointment with Dr. Smith for diabetes follow-up" |132| Voice IVR | "Press 1 to confirm your upcoming appointment" | "Press 1 to confirm your cardiology appointment" |133| Email | Can include more detail if encrypted/authenticated | Never send PHI in subject line |134135---136137## FDCPA / Regulation F (Debt Collection)138139### Requirements140141- **Mini-Miranda disclosure** required on every communication: "This is an attempt to collect a debt and any information obtained will be used for that purpose."142- **Call attempt limits:** Max 7 call attempts per debt per 7-day rolling window143- **Voicemail:** Must include disclosure or use limited-content message (name, phone number, request to call back — no mention of debt)144- **SMS consent:** Requires separate consent from voice consent145- **Time restrictions:** Same as TCPA quiet hours (8am-9pm local time)146- **Developer responsibility:** Twilio does NOT enforce FDCPA limits. Your application must track attempt counts and timing.147148**Python**149```python150# Track call attempts per debt151def can_attempt_call(debt_id, db):152 seven_days_ago = datetime.now() - timedelta(days=7)153 attempts = db.count_attempts(debt_id, since=seven_days_ago)154 return attempts < 7155156# Include Mini-Miranda in IVR157response = VoiceResponse()158response.say("This is an attempt to collect a debt and any information obtained will be used for that purpose.")159response.pause(length=1)160response.say("Please press 1 to speak with a representative.")161response.gather(num_digits=1, action="/handle-keypress")162```163164---165166## WhatsApp Compliance167168### Template Requirements169- Outbound messages require pre-approved Message Templates (submitted to Meta, 24-48 hour approval)170- Free-form messages only within 24-hour service window after customer initiates171- Template rejections: vague descriptions, missing variables, promotional language in utility templates172173### Quality Rating174- WhatsApp enforces quality scoring — too many blocks/reports = rate limited or suspended175- Monitor quality in WhatsApp Manager dashboard176- Opt-in required before sending any WhatsApp messages177178### Opt-In Best Practices179- Collect WhatsApp-specific consent (separate from SMS consent)180- Clearly state what types of messages will be sent181- Provide easy opt-out (reply STOP)182183---184185## CAN-SPAM (Email)186187- Physical mailing address required in every marketing email188- One-click unsubscribe required (SendGrid handles automatically via List-Unsubscribe header)189- Honor unsubscribe within 10 business days190- Subject line must not be misleading191- "From" address must be accurate192193See `twilio-sendgrid-email-send` for SendGrid-specific compliance features.194195---196197## SHAKEN/STIR (Caller ID Verification)198199### Attestation Levels200201| Level | Meaning | Caller ID display |202|-------|---------|-------------------|203| **A (Full)** | Carrier vouches for caller identity and right to use number | Green checkmark ✅ |204| **B (Partial)** | Carrier vouches for caller but not number ownership | Neutral display |205| **C (Gateway)** | Carrier knows where call entered network, nothing else | May show "Spam Likely" |206207- Only Level A produces a trusted caller ID display208- Affects answer rates significantly for outbound campaigns209- E.164 formatting required for proper attestation210- Twilio signs outbound calls automatically when you own the number211212---213214## Consent Management Pattern215216### Store Consent Records217218```python219# Minimum consent record220consent_record = {221 "phone": "+15558675310",222 "channel": "sms", # sms, voice, whatsapp, email223 "consent_type": "marketing", # marketing, transactional, debt_collection224 "consent_method": "web_form", # web_form, verbal, paper, api225 "consent_timestamp": "2026-04-13T14:30:00Z",226 "consent_source": "checkout_page", # where consent was collected227 "ip_address": "203.0.113.42", # for web consent228 "opted_out": False,229 "opt_out_timestamp": None230}231```232233### Opt-Out Handling234235- Process STOP/CANCEL/UNSUBSCRIBE/END/QUIT keywords immediately236- Messaging Services handle keyword opt-out automatically for SMS237- For voice: maintain your own Do Not Call list238- For WhatsApp: handle via webhook when user blocks239- For email: SendGrid manages suppression lists automatically240241---242243## CANNOT244245- **Cannot rely on Twilio to enforce compliance rules** — Your application must implement TCPA, GDPR, PCI, and other rules. Twilio provides tools, not enforcement.246- **Cannot apply A2P 10DLC registration outside the US** — Other countries have their own regimes247- **Cannot use public link shorteners (bit.ly, tinyurl, goo.gl, short.io, etc.)** — Messages with public short links are categorically filtered by carriers. Use a branded/vanity short domain (e.g., `go.yourcompany.com`) configured in your Messaging Service. Twilio's shared `twil.io` domain is not sufficient — you must register your own branded domain in Console under Messaging > Link Shortening.248- **Cannot reverse PCI Mode** — Irreversible and account-wide once enabled249- **Cannot fully clear message logs via GDPR deletion** — Twilio retains internal message logs for 400 days regardless of deletion requests250- **Cannot assume regulations are static** — Compliance requirements change. Verify current regulations before launch.251- **Cannot apply this skill's guidance outside US/EU** — India TRAI DLT, Brazil LGPD, Australia Spam Act, and other jurisdictions require additional research252253---254255## Next Steps256257- **Registration before traffic works:** `twilio-compliance-onboarding`258- **WhatsApp sender setup:** `twilio-whatsapp-manage-senders`259- **Credential security:** `twilio-iam-auth-setup`260- **Account structure for PCI isolation:** `twilio-account-setup`