From 5551821ca97745ff0e77b3dd55c029b28cc7b9e4 Mon Sep 17 00:00:00 2001 From: Margarita Gomez Date: Tue, 23 Sep 2025 20:33:11 -0500 Subject: [PATCH 1/5] feat: add consent docs --- fern/docs.yml | 2 + .../recording-consent-plan.mdx | 287 ++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 fern/security-and-privacy/recording-consent-plan.mdx diff --git a/fern/docs.yml b/fern/docs.yml index 12fb055b9..95570831f 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -636,6 +636,8 @@ navigation: contents: - page: JWT authentication path: customization/jwt-authentication.mdx + - page: Recording consent plan + path: security-and-privacy/recording-consent-plan.mdx - page: GDPR compliance path: security-and-privacy/GDPR.mdx - page: HIPAA compliance diff --git a/fern/security-and-privacy/recording-consent-plan.mdx b/fern/security-and-privacy/recording-consent-plan.mdx new file mode 100644 index 000000000..392af0b56 --- /dev/null +++ b/fern/security-and-privacy/recording-consent-plan.mdx @@ -0,0 +1,287 @@ +--- +title: Recording consent plan +subtitle: Configure consent management for call recording compliance +slug: security-and-privacy/recording-consent-plan +description: Learn how to configure recording consent plans to ensure compliance with privacy laws and regulations +--- + + + **Enterprise Feature**: Recording consent plans are only available for + Enterprise customers. Contact your account manager or [sales + team](https://form.typeform.com/to/iOcCsqVP?typeform-source=vapi.ai) to enable + this feature. + + +## Overview + +The recording consent plan feature automatically creates a consent assistant that asks users for permission to record calls before transferring them to your main assistant. Call recording only begins after consent is granted, ensuring compliance with privacy laws and regulations across different jurisdictions. + +**Recording consent plans enable you to:** + +- Automatically request recording consent before each call +- Handle consent through two different interaction patterns +- Ensure compliance with privacy regulations (GDPR, CCPA, etc.) +- Maintain audit trails of consent decisions while ensuring privacy during the consent process + +**How it works:** + +1. A consent assistant is automatically created and placed first in the call flow +2. Users interact with the consent assistant to grant or deny recording permission +3. If consent is granted, the call transfers to your original assistant +4. If consent is denied, the call ends or transfers based on your configuration + +## Consent Types + +Vapi supports two types of recording consent plans, each designed for different use cases and legal requirements. + +### Stay-on-Line Consent + +This type assumes consent is granted if the user remains on the call after hearing the consent message. It's commonly used for customer service scenarios where staying on the line implies agreement. + +**Best practices for stay-on-line messages:** + +- Clearly state that staying on the line implies consent +- Mention the purpose of recording (quality, training, etc.) +- Provide clear instructions to hang up if they don't consent + +**Example message:** + +``` +"For quality and training purposes, this call may be recorded. Please stay on the line if you agree to being recorded, or hang up if you do not consent." +``` + +### Verbal Consent + +This type requires explicit verbal consent from the user. The AI assistant will ask for clear confirmation and continue asking until the user provides explicit consent or declines. + +**Best practices for verbal consent messages:** + +- Ask for explicit verbal confirmation +- Use clear yes/no language +- Explain what happens if they decline + +**Example message:** + +``` +"This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline." +``` + +## Configuration + +Add the recording consent plan to your assistant's `compliancePlan`: + +### Basic Stay-on-Line Configuration + +```json +{ + "compliancePlan": { + "recordingConsentPlan": { + "type": "stay-on-line", + "message": "For quality and training purposes, this call may be recorded. Please stay on the line if you agree to being recorded, or hang up if you do not consent.", + "voice": { + "voiceId": "Neha", + "provider": "vapi" + }, + "waitSeconds": 3 + } + } +} +``` + +### Basic Verbal Consent Configuration + +```json +{ + "compliancePlan": { + "recordingConsentPlan": { + "type": "verbal", + "message": "Can I record you please?", + "voice": { + "voiceId": "Neha", + "provider": "vapi" + }, + "declineToolId": "09dd39cc-75f0-45eb-ace3-796ee3aa9c1e" + } + } +} +``` + +## Implementation + + + + Add the recording consent plan to your assistant's compliance plan configuration. + + + + 1. Navigate to **Assistants** in your Vapi dashboard + 2. Create a new assistant or edit an existing one + 3. Go to the **Compliance** section + 4. Enable **Recording Consent Plan** + 5. Choose your consent type (Stay-on-Line or Verbal) + 6. Enter your consent message + 7. Configure additional options (voice, decline tool, etc.) + 8. Save your assistant + + + ```typescript + import { VapiClient } from "@vapi-ai/server-sdk"; + + const client = new VapiClient({ token: process.env.VAPI_API_KEY }); + + const assistant = await client.assistants.create({ + name: "Customer Support Assistant", + model: { + provider: "openai", + model: "gpt-4o" + }, + voice: { + provider: "11labs", + voiceId: "sarah" + }, + compliancePlan: { + recordingConsentPlan: { + type: "verbal", + message: "This call may be recorded for quality and training purposes. Do you consent to being recorded?", + declineTool: { + type: "endCall" + } + } + } + }); + ``` + + + ```python + from vapi import Vapi + + client = Vapi(token=os.getenv("VAPI_API_KEY")) + + assistant = client.assistants.create({ + "name": "Customer Support Assistant", + "model": { + "provider": "openai", + "model": "gpt-4o" + }, + "voice": { + "provider": "11labs", + "voiceId": "sarah" + }, + "compliancePlan": { + "recordingConsentPlan": { + "type": "verbal", + "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded?", + "declineTool": { + "type": "endCall" + } + } + } + }) + ``` + + + + + + + Create a test call to verify your consent flow works correctly. + + + + 1. Go to your assistant's page + 2. Click **Test Call** + 3. Verify the consent message plays correctly + 4. Test both consent and decline scenarios + 5. Check that the call transfers properly after consent + + + ```typescript + // Create a test call + const call = await client.calls.create({ + assistantId: assistant.id, + phoneNumberId: "your-phone-number-id" + }); + + // Monitor the call to verify consent flow + console.log("Call created:", call.id); + ``` + + + + + + + Check your call logs to verify consent decisions are being recorded correctly. + + ```typescript + // Get call details to check consent status + const call = await client.calls.get(callId); + + if (call.compliance?.recordingConsent?.grantedAt) { + console.log("Consent granted at:", call.compliance.recordingConsent.grantedAt); + console.log("Consent type:", call.compliance.recordingConsent.type); + } else { + console.log("No consent was granted for this call"); + } + ``` + + + + +## Decline Tool Options + +When users decline recording consent, you can configure different actions using decline tools: + +For detailed information about these tools, see: + +- **[Handoff Tool](/tools/handoff)** - Transfer to other assistants +- **[Default Tools](/tools/default-tools)** - Transfer calls and end calls + +## Best Practices + +### Message Design + +- **Stay-on-Line**: Clearly state that staying implies consent +- **Verbal**: Ask for explicit confirmation with clear yes/no options +- **Length**: Keep messages concise but comprehensive +- **Tone**: Use professional, clear language appropriate for your industry + +### Voice Selection + +- Use a different voice for consent messages to create distinction +- Choose voices that match your brand and industry requirements +- Consider using more formal voices for compliance scenarios + +### Decline Handling + +- **End Call**: Use when you cannot provide service without recording +- **Transfer**: Use when you have alternative service options +- **Handoff**: Use when you have non-recording assistants available + +### Testing + +- Test both consent and decline scenarios thoroughly +- Verify timing works correctly for your use case +- Check that decline tools execute properly +- Monitor call logs to ensure compliance data is recorded + +## Troubleshooting + +**Users not hearing consent message** + +- Verify the consent message is not empty +- Check that the voice configuration is valid +- Test with different voice providers if needed + +**Decline tool not executing** + +- Verify the decline tool configuration is valid +- Check that referenced assistants or phone numbers exist +- Ensure the tool type matches your intended action + +## Next Steps + +- **[Call Recording](/assistants/call-recording)** - Learn about technical recording implementation +- **[Handoff Tool](/tools/handoff)** - Transfer between assistants +- **[Default Tools](/tools/default-tools)** - Transfer calls and end calls +- **[API Reference](/api-reference/assistants/create)** - Explore assistant configuration options From 5636e2d810deb28c64f76f07d67f4345e23a411b Mon Sep 17 00:00:00 2001 From: Margarita Gomez Date: Wed, 24 Sep 2025 09:09:35 -0500 Subject: [PATCH 2/5] chore: improve comments --- .../recording-consent-plan.mdx | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/fern/security-and-privacy/recording-consent-plan.mdx b/fern/security-and-privacy/recording-consent-plan.mdx index 392af0b56..67d44d56b 100644 --- a/fern/security-and-privacy/recording-consent-plan.mdx +++ b/fern/security-and-privacy/recording-consent-plan.mdx @@ -95,7 +95,7 @@ Add the recording consent plan to your assistant's `compliancePlan`: "compliancePlan": { "recordingConsentPlan": { "type": "verbal", - "message": "Can I record you please?", + "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", "voice": { "voiceId": "Neha", "provider": "vapi" @@ -106,6 +106,46 @@ Add the recording consent plan to your assistant's `compliancePlan`: } ``` +## Call Response Structure + +When you add a recording consent plan to your assistant, the call response will include a `compliance` field with recording consent information. Here's what the response looks like: + +### Successful Consent Response + +```json +{ + // ... Other call fields + "compliance": { + "recordingConsent": { + "type": "verbal", + "grantedAt": "2024-01-15T10:30:00Z" + } + } +} +``` + +### No Consent Response + +```json +{ + "// ... Other call fields + "compliance": { + "recordingConsent": { + "type": "verbal" + } + } +} +``` + +**Key points about the response structure:** + +- **`recordingConsent` field**: Always present when a consent plan is configured +- **`type`**: Shows which consent type was used (`"verbal"` or `"stay-on-line"`) +- **`grantedAt`**: Only set when the user explicitly grants permission +- **Missing `grantedAt`**: Indicates the user declined consent or hung up before granting permission + +This structure allows you to easily determine whether recording consent was granted and audit compliance decisions for each call. + ## Implementation @@ -142,7 +182,7 @@ Add the recording consent plan to your assistant's `compliancePlan`: compliancePlan: { recordingConsentPlan: { type: "verbal", - message: "This call may be recorded for quality and training purposes. Do you consent to being recorded?", + message: "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", declineTool: { type: "endCall" } @@ -170,7 +210,7 @@ Add the recording consent plan to your assistant's `compliancePlan`: "compliancePlan": { "recordingConsentPlan": { "type": "verbal", - "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded?", + "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", "declineTool": { "type": "endCall" } From e41042c7ff0070ee9e1114858313122bfa8ea67a Mon Sep 17 00:00:00 2001 From: Margarita Gomez Date: Wed, 24 Sep 2025 09:13:33 -0500 Subject: [PATCH 3/5] chore: end of call report --- .../recording-consent-plan.mdx | 64 +++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/fern/security-and-privacy/recording-consent-plan.mdx b/fern/security-and-privacy/recording-consent-plan.mdx index 67d44d56b..ae192f119 100644 --- a/fern/security-and-privacy/recording-consent-plan.mdx +++ b/fern/security-and-privacy/recording-consent-plan.mdx @@ -106,45 +106,73 @@ Add the recording consent plan to your assistant's `compliancePlan`: } ``` -## Call Response Structure +## End-of-Call Report Structure -When you add a recording consent plan to your assistant, the call response will include a `compliance` field with recording consent information. Here's what the response looks like: +When you add a recording consent plan to your assistant, the compliance data will be included in the end-of-call-report webhook. Here's what the compliance section looks like in the webhook payload: -### Successful Consent Response +### Successful Consent Webhook ```json { - // ... Other call fields - "compliance": { - "recordingConsent": { - "type": "verbal", - "grantedAt": "2024-01-15T10:30:00Z" - } + "message": { + "type": "end-of-call-report", + "analysis": { + /* call analysis data */ + }, + "artifact": { + /* call artifacts */ + }, + "startedAt": "2024-01-15T10:25:00Z", + "endedAt": "2024-01-15T10:35:00Z", + "endedReason": "assistantEndedCall", + "cost": 0.15, + "compliance": { + "recordingConsent": { + "type": "verbal", + "grantedAt": "2024-01-15T10:30:00Z" + } + }, + "transcript": "/* call transcript */", + "recordingUrl": "https://...", + "stereoRecordingUrl": "https://..." } } ``` -### No Consent Response +### No Consent Webhook ```json { - "// ... Other call fields - "compliance": { - "recordingConsent": { - "type": "verbal" - } + "message": { + "type": "end-of-call-report", + "analysis": { + /* call analysis data */ + }, + "artifact": { + /* call artifacts */ + }, + "startedAt": "2024-01-15T10:25:00Z", + "endedAt": "2024-01-15T10:30:00Z", + "endedReason": "assistantEndedCall", + "cost": 0.1, + "compliance": { + "recordingConsent": { + "type": "verbal" + } + }, + "transcript": "/* call transcript */" } } ``` -**Key points about the response structure:** +**Key points about the webhook structure:** -- **`recordingConsent` field**: Always present when a consent plan is configured +- **`recordingConsent` field**: Always present in the `compliance` object when a consent plan is configured - **`type`**: Shows which consent type was used (`"verbal"` or `"stay-on-line"`) - **`grantedAt`**: Only set when the user explicitly grants permission - **Missing `grantedAt`**: Indicates the user declined consent or hung up before granting permission -This structure allows you to easily determine whether recording consent was granted and audit compliance decisions for each call. +This webhook structure allows you to easily determine whether recording consent was granted and audit compliance decisions for each call. The compliance data is sent as part of the end-of-call-report webhook, which includes all call details, analysis, and compliance information. ## Implementation From cbf8d361c655a340696c34b57442d9617608bcd5 Mon Sep 17 00:00:00 2001 From: Margarita Gomez Date: Wed, 24 Sep 2025 13:56:40 -0500 Subject: [PATCH 4/5] chore: change to agree --- fern/security-and-privacy/recording-consent-plan.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fern/security-and-privacy/recording-consent-plan.mdx b/fern/security-and-privacy/recording-consent-plan.mdx index ae192f119..725e1aa05 100644 --- a/fern/security-and-privacy/recording-consent-plan.mdx +++ b/fern/security-and-privacy/recording-consent-plan.mdx @@ -63,7 +63,7 @@ This type requires explicit verbal consent from the user. The AI assistant will **Example message:** ``` -"This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline." +"This call may be recorded for quality and training purposes. Do you agree to being recorded? Please say 'yes' if you agree or 'no' if you decline." ``` ## Configuration @@ -95,7 +95,7 @@ Add the recording consent plan to your assistant's `compliancePlan`: "compliancePlan": { "recordingConsentPlan": { "type": "verbal", - "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", + "message": "This call may be recorded for quality and training purposes. Do you agree to being recorded? Please say 'yes' if you agree or 'no' if you decline.", "voice": { "voiceId": "Neha", "provider": "vapi" @@ -210,7 +210,7 @@ This webhook structure allows you to easily determine whether recording consent compliancePlan: { recordingConsentPlan: { type: "verbal", - message: "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", + message: "This call may be recorded for quality and training purposes. Do you agree to being recorded? Please say 'yes' if you agree or 'no' if you decline.", declineTool: { type: "endCall" } @@ -238,7 +238,7 @@ This webhook structure allows you to easily determine whether recording consent "compliancePlan": { "recordingConsentPlan": { "type": "verbal", - "message": "This call may be recorded for quality and training purposes. Do you consent to being recorded? Please say 'yes' if you agree or 'no' if you decline.", + "message": "This call may be recorded for quality and training purposes. Do you agree to being recorded? Please say 'yes' if you agree or 'no' if you decline.", "declineTool": { "type": "endCall" } From f408be437542c2410a5a9a05d8f50664f1e0ee55 Mon Sep 17 00:00:00 2001 From: Margarita Gomez Date: Wed, 24 Sep 2025 21:52:56 -0500 Subject: [PATCH 5/5] chore: remove python --- .../recording-consent-plan.mdx | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/fern/security-and-privacy/recording-consent-plan.mdx b/fern/security-and-privacy/recording-consent-plan.mdx index 725e1aa05..dff59c8f6 100644 --- a/fern/security-and-privacy/recording-consent-plan.mdx +++ b/fern/security-and-privacy/recording-consent-plan.mdx @@ -219,34 +219,6 @@ This webhook structure allows you to easily determine whether recording consent }); ``` - - ```python - from vapi import Vapi - - client = Vapi(token=os.getenv("VAPI_API_KEY")) - - assistant = client.assistants.create({ - "name": "Customer Support Assistant", - "model": { - "provider": "openai", - "model": "gpt-4o" - }, - "voice": { - "provider": "11labs", - "voiceId": "sarah" - }, - "compliancePlan": { - "recordingConsentPlan": { - "type": "verbal", - "message": "This call may be recorded for quality and training purposes. Do you agree to being recorded? Please say 'yes' if you agree or 'no' if you decline.", - "declineTool": { - "type": "endCall" - } - } - } - }) - ``` -