---
title: "Ongoing CDRs"
method: POST
path: "/api/ongoing"
tags: ["CDRs"]
---

# Ongoing CDRs

`POST /api/ongoing`

## Request

- Base URL: `https://your-instance.stats.pbx.commpeak.com`
- URL: `https://your-instance.stats.pbx.commpeak.com/api/ongoing`
- Auth: API key in header `X-API-KEY`

### List Ongoing Calls

This endpoint allows you to retrieve a list of active calls in the PBX.

#### Request Body

- `format`: The format of the response.
    
- `destination`: Search by destination number.
    
- `bridged`: \[0 => not bridged , 1 => bridged\]
    
- `bill_duration_from`: Filter the bill duration from (sec).
    
- `bill_duration_till`: Filter the bill duration till (sec).
    
- `{custom_field}`: Filter by custom fields (Key -> field name, Value -> field value).
    

#### Response

The response will contain:

- `count`: The count of active calls.
    
- `cdrs`: An array of active call details including id, unique_id, channel_name, source, destination, original_destination, caller_id, call_start, duration, bill_duration, bridged, bridged_agent_name, bridged_agent_extension, direction, and custom_fields.

## Request body `application/x-www-form-urlencoded`

- object
  - `bill_duration_from` string
  - `bill_duration_till` string
  - `bridged` string
  - `destination` string
  - `format` string
  - `{custom_field}` string

## Response `200`

successful operation

- object
  - `cdrs` object[]
    - `bill_duration` string
    - `bridged` string
    - `bridged_agent_extension` string
    - `bridged_agent_name` string
    - `call_start` string
    - `caller_id` string
    - `channel_name` string
    - `custom_fields` string
    - `destination` string
    - `direction` string
    - `duration` string
    - `id` string
    - `original_destination` string
    - `source` string
    - `unique_id` string
  - `count` string

## Other responses

- `401`: Unauthorized

---

[API](https://skmtc.dev/commpeak/apis/pbx-stats-api.md) - [All operations](https://skmtc.dev/commpeak/apis/pbx-stats-api/llms.txt) - [OpenAPI document](https://skmtc.dev/commpeak/apis/pbx-stats-api/revisions/2f599eb625f8?raw)
