> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracklysms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Listen to a Call in the Browser

> Attach an authorized receive-only browser listener to a managed call.

`POST /api/v1/voice/calls/{callId}/browser-monitor` attaches a supervisor's browser listener to the active salesperson audio leg of a Trackly-managed call. This route does not dial a supervisor telephone number. It supports listening only: there is no microphone transmission, coaching, DTMF, or conference-role change. The listener cannot remain on the recipient's audio after the salesperson or call ends. For a phone supervisor, use [Monitor a Call](https://docs.tracklysms.com/api-reference/voice/calls/monitor-call.md).

Requires `voice_calls.write`, the **Voice Calls** product entitlement, and an API key created by a current account owner. Your authenticated backend must also authorize the supervisor and derive their `externalSubject`; the browser's target call ID is not authorization. The target must be an established managed call with one active browser agent leg.

## Sequence

1. Create or reuse a WebRTC agent for the authenticated supervisor under the issuing API key.
2. [Create a browser session](https://docs.tracklysms.com/api-reference/voice/calls/browser-sessions.md) with `POST /browser-sessions`, `{externalSubject, purpose: "monitor", targetCallId: callId}`, and a stable `Idempotency-Key`. The response includes `{session, transport}`; `session.purpose` is `monitor`, `session.targetCallId` is the primary call ID, and `session.receiveIncoming` is `false`. The session is bound to that call's active agent leg.
3. Connect a separate SDK helper configured with `monitorCallId: callId`. Its `createSession` callback performs step 2; `connect()` prepares receive-only playback without requesting microphone access.
4. Start one listener attempt with `startMonitoring({idempotencyKey})`. Its `createMonitorCall` callback calls this route with the returned `sessionId` and the same target call ID.
5. Read the returned child with `GET /browser-calls/{id}`. `POST /browser-calls/{id}/hangup` requests listener-only cleanup and revokes its monitor session. `DELETE /browser-sessions/{id}` also revokes that session. Create a new session for another listening attempt.

Use the primary call ID for both the session and this route. A `202` accepts a durable listener attempt; it does not prove audio is attached. Read child state and use the SDK's verified media status before showing listening as active. Reuse the same idempotency key and body after an uncertain response.

## Path Parameters

**callId** `string` *required*

Primary ID of the established Trackly-managed call to listen to.

## Body Parameters

**sessionId** `string` *required*

Active monitor-purpose browser session issued for this call and API key. No other fields are accepted.

## Headers

**Idempotency-Key** `string` *required*

Stable, nonblank identifier of at most 128 characters for this listener attempt.

## Response Fields

**call** `object`

The monitor child call. Its `id` identifies only the listener, `purpose` is `monitor`, `targetCallId` is the primary call ID, and `sessionId` identifies the monitor session. `state` and `revision` describe the child lifecycle; `agentSipCallId` identifies the browser invitation. Use `id` to read or end only the listener.

The response's `Location` header points to `/api/v1/voice/browser-calls/{call.id}`.

## Example

```bash cURL theme={null}
curl -X POST https://api.tracklysms.com/api/v1/voice/calls/665f1e2a9c4b1a0012ab34cd/browser-monitor \
  -H "X-Api-Key: trk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: supervisor-listen-123" \
  -d '{"sessionId":"665f1e2a9c4b1a0012ab99ff"}'
```

## Error Codes

| Status | Code | Meaning |
| - | - | - |
| 403 | `owner_required`, `monitor_owner_required` | The issuing key's creator lacks current owner authority. |
| 404 | `call_not_found`, `browser_resource_not_found` | The target call or listener session is not available in this account. |
| 409 | `call_not_established`, `agent_leg_required` | The target has no active browser salesperson leg. |
| 409 | `monitor_session_unavailable`, `monitor_target_changed` | The listener session is inactive or bound to a different physical agent leg. |
| 422 | `invalid_fields`, `idempotency_key_required` | Supply exactly `sessionId` and a bounded attempt key. |

> [!NOTE]
>
> Browser listening requires a compatible deployed API, media service, SDK bundle, and account activation. Source support alone does not establish live availability for your account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.