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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.poly.ai/feedback

```json
{
  "path": "/api-reference/external-events/endpoint/bridge-ended",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Bridge ended notification

> Internal endpoint that receives notifications when a call bridge (transfer) completes. Triggered automatically by the telephony system after a bridged call ends, allowing configured project functions to process bridge metadata and call duration information.

## Overview

The bridge-ended endpoint receives notifications when a call bridge (transfer) completes. This endpoint is triggered automatically by the telephony system after a bridged call ends, allowing configured project functions to process bridge metadata and call duration information.

## Use cases

* Log bridge duration for analytics
* Trigger post-transfer workflows
* Update CRM systems with transfer outcomes
* Calculate agent availability based on bridge time

## Request body

The endpoint accepts the following parameters:

| Parameter                 | Type   | Required | Description                                |
| ------------------------- | ------ | -------- | ------------------------------------------ |
| `conversation_id`         | string | Yes      | The unique identifier for the conversation |
| `bridge_duration_seconds` | number | Yes      | Duration of the bridge/transfer in seconds |
| `call_duration_seconds`   | number | Yes      | Total call duration in seconds             |

## Example request

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "conversation_id": "conv_abc123xyz",
  "bridge_duration_seconds": 180,
  "call_duration_seconds": 300
}
```

## Behavior

When this endpoint receives a bridge-ended notification:

1. The system extracts the conversation ID and bridge metadata
2. Configured project functions are triggered with the bridge data
3. Functions can access bridge duration and call duration for processing
4. The conversation state is updated to reflect the bridge completion

## Configuration

This endpoint is automatically configured when you set up call transfer/bridge functionality in your project. Contact your PolyAI representative to enable bridge-ended notifications for your project.


## OpenAPI

````yaml POST /internal/v1/agentic-dial/bridge-ended
openapi: 3.0.1
info:
  title: PolyAI External Events API
  description: Schema for the PolyAI External Events webhook
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.us-1.platform.polyai.app
    description: US base url
  - url: https://api.uk-1.platform.polyai.app
    description: UK base url
  - url: https://api.euw-1.platform.polyai.app
    description: EUW base url
security:
  - ExternalEventsApiKey: []
paths:
  /internal/v1/agentic-dial/bridge-ended:
    post:
      tags:
        - External Events
      summary: Bridge ended notification
      description: >-
        Internal endpoint that receives notifications when a call bridge
        (transfer) completes. Triggered automatically by the telephony system
        after a bridged call ends, allowing configured project functions to
        process bridge metadata and call duration information.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - conversation_id
                - bridge_duration_seconds
                - call_duration_seconds
              properties:
                conversation_id:
                  type: string
                  description: The unique identifier for the conversation
                bridge_duration_seconds:
                  type: number
                  description: Duration of the bridge/transfer in seconds
                call_duration_seconds:
                  type: number
                  description: Total call duration in seconds
            examples:
              bridge_ended:
                summary: Bridge ended notification
                value:
                  conversation_id: conv_abc123xyz
                  bridge_duration_seconds: 180
                  call_duration_seconds: 300
      responses:
        '200':
          description: Bridge ended notification received and processed successfully.
        '400':
          description: Malformed request (for example, missing required fields).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalEventsError'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalEventsError'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X POST
            "https://api.us-1.platform.polyai.app/internal/v1/agentic-dial/bridge-ended"
            -H "Content-Type: application/json" -d
            '{"conversation_id":"conv_abc123xyz","bridge_duration_seconds":180,"call_duration_seconds":300}'
        - lang: python
          label: Python (requests)
          source: >
            import requests


            url =
            "https://api.us-1.platform.polyai.app/internal/v1/agentic-dial/bridge-ended"

            headers = {"Content-Type": "application/json"}

            payload = {
                "conversation_id": "conv_abc123xyz",
                "bridge_duration_seconds": 180,
                "call_duration_seconds": 300
            }

            resp = requests.post(url, headers=headers, json=payload)

            print(resp.status_code)  # 200 on success
components:
  schemas:
    ExternalEventsError:
      type: object
      properties:
        error_message:
          type: string
          description: Reason for the error.
  securitySchemes:
    ExternalEventsApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key for the External Events webhook. Contact your PolyAI
        representative to obtain credentials.

````