---
title: Enabling Applet-Level Call Recording
slug: voice-apis/enabling-applet-level-call-recording
docTags: 
createdAt: 2025-11-13T07:04:07.120Z
---

Enabling Applet-Level Call Recording

### Overview

This guide demonstrates how enterprises can dynamically control call recording within their Exotel applet flow using the **Passthru Applet** (GET request) and **Recording API** (POST request). This setup enables selective, event-driven recording control — for example, starting the recording before a greeting or IVR prompt and stopping it before agent transfer.

The implementation combines the[Passthru Applet](docId\:CQ8K-ivzyBxEZr3xySYpS) and[Call Recordings](docId:3ssnZ3G1MgRr4dPdxihsh) to allow real-time backend-triggered recording.

### How It Works

1. **Use Passthru Applet (GET):** The Passthru applet sends call information such as CallSID, From, and To parameters to your backend via a GET request.
2. **Backend Triggers Recording API (POST):** Your backend receives the GET request, extracts the CallSID, and immediately makes a POST call to the **Recording API** to start recording.
3. **Continue Call Flow:** The call proceeds through the configured applets (Greeting, IVR, Gather, etc.) while recording remains active.
4. **End-of-Flow Stop Recording:** At the final stage, another Passthru applet sends a GET request to your backend endpoint (e.g., /stop\_recording), which triggers a POST API call to stop recording.

This ensures Exotel only records the specific portion of the call you need, such as the main interaction, and not hold or transfer periods.

### Step-by-Step Implementation

### 1. Configure the Passthru Applet (Start Recording)

- Add a **Passthru Applet** at the point in the flow where you want to begin recording.
- Set the Passthru applet’s GET **URL** to a backend endpoint like https\://yourdomain.com/start\_recording.
- When executed, Exotel performs a **GET** request to this endpoint with call details appended as query parameters:

:::BlockQuote

https\://yourdomain.com/start\_recording?CallSid=abcd1234efgh5678\&From=%2B919900112233\&To=08088919888\&CallType=outgoing
:::


Your backend should capture the CallSid from this GET request quer params

### 2. Backend: Invoke Start Recording API (POST)

Your backend now calls Exotel’s Recording API using the captured CallSid.

`POST`

:::BlockQuote
https\://\<your\_api\_key>:\<your\_api\_token>\<subdomain>/v1/Accounts/\<your\_sid>/Calls/\<CallSID>/recording.json
:::

**Example:**

```curl
curl --location 'https://<base_url>/v1/Accounts/<AccountSID>/Calls/<CallSID>/recording.json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'Action=START' \
--data-urlencode 'RecordingChannels=dual' \
--data-urlencode 'RecordingFormat=mp3-hq' \
--data-urlencode 'StatusCallback=<status_callback_url>' \
--data-urlencode 'Leg1Recording=True'
```

Replace `<your_api_key>` and `<your_api_token>` with the API key and token created by you.

- Replace `<your_sid>` with your “Account sid”
- Replace `<subdomain>` with the region of your account
  1. `<subdomain>` of Singapore cluster is @api.exotel.com
  2. `<subdomain>` of Mumbai cluster is @api.in.exotel.com

`<your_api_key>` , `<your_api_token>` and `<your_sid>` are available in the API settings page of your Exotel Dashboard

**Parameter Reference:**

| **Parameter**         | **Type** | **Description**                                                                                                                                       |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Action**            | String   | START or STOP to control recording.                                                                                                                   |
| **RecordingChannels** | String   | Optional — Audio channels. • single *(default)* – Both legs mixed. • dual – Caller/callee recorded separately.                                        |
| **RecordingFormat**   | String   | Optional — Audio quality. • mp3 *(default)* – Standard bitrate. • mp3-hq – High bitrate (32 kbps/channel). Requires enablement via hello\@exotel.com. |
| **StatusCallback**    | URL      | Callback endpoint for recording status.                                                                                                               |
| **Leg1Recording**     | Boolean  | True to record only the first call leg.                                                                                                               |

### 3. Continue with Business Applets

After triggering the start recording API, your flow continues normally with applets such as:

- **Greeting Applet:** Playback welcome message.
- **IVR Applet:** Capture user selections.
- **Gather Applet:** Collect input.
- **Connect Applet:** Transfer to agent.

**Example Flow:**

:::BlockQuote
Passthru (GET → start\_recording) → Backend (POST → Start Recording API) → Greeting → IVR → Gather → Passthru (GET → stop\_recording)
:::

### 4. Configure Passthru Applet (Stop Recording)

At the end of the flow:

- Add another **Passthru Applet** configured to call a URL like `https://yourdomain.com/stop_recording.`
- This GET request from Exotel again includes the CallSid.
- Your backend receives this GET, extracts the CallSid, and invokes:

```curl
curl --location 'https://<your_api_key>:<your_api_token><subdomain>/v1/Accounts/<your_sid>/Calls/<CallSID>/recording.json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'Action=STOP'
```

This cleanly terminates recording at the end of the call.

### Recording Access

- **Dashboard:** Under each call log.
- \*\*Call Detail APIs: \*\*https\://developer.exotel.com/api/make-a-call-api#call-details

### Compliance Notes

- The Passthru applet always sends a **GET request** to your backend; the enterprise must use POST to trigger or stop recording.
- Obtain customer consent per regional compliance rules.
- *mp3-hq* is an optional, on-demand feature.
- Recordings are stored securely in Exotel’s environment.

### Example Use Case

**Scenario:** A customer support survey where only the IVR interaction is recorded.

1. Passthru applet sends GET to backend → backend triggers **Start Recording (POST)**.
2. IVR runs and records customer input.
3. Final Passthru sends GET → backend triggers **Stop Recording (POST)** before agent connection.

This ensures only the main customer interaction is captured.

### References

[Passthru Applet](docId\:CQ8K-ivzyBxEZr3xySYpS)

[Call Recordings](docId:3ssnZ3G1MgRr4dPdxihsh)

[Secure Call Recording](docId\:b89H_wKLyWIc8PhKjcqtT)
