diff --git a/fern/call-forwarding.mdx b/fern/call-forwarding.mdx index 479ce1371..680aef9d6 100644 --- a/fern/call-forwarding.mdx +++ b/fern/call-forwarding.mdx @@ -386,6 +386,7 @@ In this mode, Vapi dials the destination number and places the caller on hold (w - Provide a `message` to be spoken to the operator when they answer. - Optionally define a `summaryPlan` that will take precedence over the message if enabled. - Configure a `fallbackPlan` with a message and whether to end the call if transfer fails. + - Optionally provide a `holdAudioUrl` to play custom hold music to the customer during the transfer. - Configure `voicemailDetectionType` to customize how human voice detection is performed (only applies when the provider is Google or OpenAI): - `"audio"` (default): Supports a wide range of machine detection including beep detection and other audio cues - `"transcript"`: Uses transcript-based detection with the lowest latency and faster transfer processing times @@ -397,6 +398,7 @@ In this mode, Vapi dials the destination number and places the caller on hold (w "transferPlan": { "mode": "warm-transfer-experimental", "message": "Transferring a customer to you.", + "holdAudioUrl": "https://api.twilio.com/cowbell.mp3", "voicemailDetectionType": "transcript", "fallbackPlan": { "message": "Could not transfer your call, goodbye.", @@ -436,6 +438,7 @@ Here is a full example of a `transferCall` payload using the experimental warm t "transferPlan": { "mode": "warm-transfer-experimental", "message": "Transferring a customer to you.", + "holdAudioUrl": "https://assets.example.com/music.mp3", "voicemailDetectionType": "audio", "fallbackPlan": { "message": "Could not transfer your call, goodbye.", @@ -465,6 +468,7 @@ Here is a full example of a `transferCall` payload using the experimental warm t **Notes:** - In all warm transfer modes, the `{{transcript}}` variable contains the full transcript of the call and can be used within the `summaryPlan`. +- The `holdAudioUrl` property (available only in `warm-transfer-experimental` mode) allows you to specify a custom MP3 file URL that will be played to the customer while they are on hold during the transfer. If not provided, the default hold audio will be used. - The `voicemailDetectionType` parameter allows you to optimize the detection method based on your needs: - Use `"transcript"` for the fastest transfer processing with lowest latency - Use `"audio"` (default) for comprehensive machine detection including beep detection and other audio cues diff --git a/fern/chat/quickstart.mdx b/fern/chat/quickstart.mdx index 6aa36ff84..1f010c443 100644 --- a/fern/chat/quickstart.mdx +++ b/fern/chat/quickstart.mdx @@ -318,6 +318,18 @@ We'll create a customer support chat for "TechFlow", a software company that wan - Server webhook events (status updates, end-of-call reports, etc.) are not supported +## Webhook Support + + +The chat API supports the following webhook events through server messaging: +- **`chat.created`** - Triggered when a new chat conversation is initiated +- **`chat.deleted`** - Triggered when a chat conversation is deleted + +To receive these webhooks, go to your Assistant page in the Dashboard and navigate to "Server Messaging" and select the events you want to receive. + +These webhooks are useful for tracking conversation analytics, maintaining conversation history in your own database, and triggering follow-up actions. + + ## Next Steps Take your chat bot to the next level: diff --git a/fern/chat/session-management.mdx b/fern/chat/session-management.mdx index 88f670529..6a0a09d79 100644 --- a/fern/chat/session-management.mdx +++ b/fern/chat/session-management.mdx @@ -132,6 +132,11 @@ Create a persistent session that groups multiple chats. + +- Sessions expire automatically after 24 hours by default. After expiration, you'll need to create a new session to continue conversations. +- Web chat widget and SMS conversations automatically manage session creation and expiration. You don't need to manually create or manage sessions when using these channels. + + Here's a TypeScript implementation of the session manager: ```typescript title="session-manager.ts" @@ -234,6 +239,21 @@ await sendToAssistant("billing_agent", "Can you help with this?"); --- +## Webhook Support + + +Sessions support the following webhook events through server messaging: +- **`session.created`** - Triggered when a new session is created +- **`session.updated`** - Triggered when a session is updated +- **`session.deleted`** - Triggered when a session is deleted + +To receive these webhooks, go to your Assistant page in the Dashboard and navigate to "Server Messaging" and select the events you want to receive. + +These webhooks are useful for tracking session lifecycle, managing session state in your own database, and triggering workflows based on session changes. + + +--- + ## Next Steps * **[Streaming responses](/chat/streaming)** - Add real-time responses to session-managed chats diff --git a/fern/docs.yml b/fern/docs.yml index 8475198ee..83e237c36 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -963,3 +963,5 @@ redirects: destination: /workflows/examples/lead-qualification - source: /fern/api-reference destination: /api-reference/calls/list + - source: /documentation/chat/chat + destination: /api-reference/chats