---
title: "Create new call report"
method: POST
path: "/call_reports"
tags: ["CDR"]
---

# Create new call report

`POST /call_reports`

## Request body

- object
  - `name` string, required — The name of call report.
  - `type` 'NORMAL' | 'EXTENSION_GROUP_CALL_COST' | 'QUEUE_PERFORMANCE' | 'QUEUE_DETAILED_STATISTICS' | 'QUEUE_ABANDONED_CALLS' | 'QUEUE_SLA_STATISTICS' | 'QUEUE_BREACHES_SLA_STATISTICS' | 'QUEUE_CALLBACKS' | 'QUEUE_FAILED_CALLBACKS' | 'TEAM_QUEUE_GENERAL_STATISTICS' | 'RING_GROUP_STATISTICS', required — The report types can be either: - `NORMAL`: - `EXTENSION_GROUP_CALL_COST`: - `QUEUE_PERFORMANCE`: - `QUEUE_DETAILED_STATISTICS`: - `QUEUE_ABANDONED_CALLS`: - `QUEUE_SLA_STATISTICS`: - `QUEUE_BREACHES_SLA_STATISTICS`: - `QUEUE_CALLBACKS`: - `QUEUE_FAILED_CALLBACKS`: - `TEAM_QUEUE_GENERAL_STATISTICS`: - `RING_GROUP_STATISTICS`:
  - `email` string, required — The email address.
  - `format` 'CSV' | 'HTML', required — The report output files format can be either: - `CSV`: - `HTML`:
  - `range` 'TODAY' | 'YESTERDAY' | 'LAST_WEEK' | 'LAST_SEVEN_DAYS' | 'LAST_MONTH' | 'LAST_THIRTY_DAYS' | 'CUSTOM', required — The report range can be either: - `TODAY`: the day the report was generated. - `YESTERDAY`: yesterday of the day the report was generated. - `LAST_WEEK`: the last week of the day the report was generated. - `LAST_SEVEN_DAYS`: seven days before the day the report was generated. - `LAST_MONTH`: the last month of the day the report was generated. - `LAST_THIRTY_DAYS`: thirty days before the day the report was generated. - `CUSTOM`: custom date range.
  - `started_at` string, date_time — The RFC 3339 format is defined by The date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, 2017-07-21T17:32:28Z
  - `ended_at` string, date_time — The RFC 3339 format is defined by The date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, 2017-07-21T17:32:28Z
  - `cron_expr` string — The crontab expression <https://en.wikipedia.org/wiki/Cron>
  - `filter` union, required
    - object
      - `from` 'ANY' | 'EXTENSION_OR_EXTENSION_RANGE' | 'NUMBER' | 'NUMBERS_START_WITH' | 'NUMBERS_CONTAIN' | 'INTERNAL_EXTENSIONS' | 'EXTERNAL_NUMBERS' — Filter calls with caller(s) number. Filter can be either: - `ANY`: - `EXTENSION_OR_EXTENSION_RANGE`: - `NUMBER`: - `NUMBERS_START_WITH`: - `NUMBERS_CONTAIN`: - `INTERNAL_EXTENSIONS`: - `EXTERNAL_NUMBERS`:
      - `from_value` string — This attribute must be specified, when the `from` is one of `EXTENSION_OR_EXTENSION_RANGE`, `NUMBER`, `NUMBERS_START_WITH`, `NUMBERS_CONTAIN`.
      - `to` 'ANY' | 'EXTENSION_OR_EXTENSION_RANGE' | 'NUMBER' | 'NUMBERS_START_WITH' | 'NUMBERS_CONTAIN' | 'INTERNAL_EXTENSIONS' | 'EXTERNAL_NUMBERS' — Filter calls with callee(s) number. Filter can be either: - `ANY`: - `EXTENSION_OR_EXTENSION_RANGE`: - `NUMBER`: - `NUMBERS_START_WITH`: - `NUMBERS_CONTAIN`: - `INTERNAL_EXTENSIONS`: - `EXTERNAL_NUMBERS`:
      - `to_value` string — This attribute must be specified when the `to` is either `EXTENSION_OR_EXTENSION_RANGE`, `NUMBER`, `NUMBERS_START_WITH`, `NUMBERS_CONTAIN`.
      - `answer_state` 'ANY' | 'ANSWERED' | 'NOT_ANSWERED' — Filter calls answered or not. State can be either: - `ANY`: - `ANSWERED`: - `NOT_ANSWERED`:
      - `duration` 'ANY' | 'RING_DURATION' | 'TALK_DURATION' — Filter calls duration range. Duration can be either: - `ANY`: - `RING_DURATION`: - `TALK_DURATION`:
      - `duration_from` integer — Filter calls with duration greater than or equal to specified seconds.
      - `duration_to` integer — Filter calls with duration less than or equal to specified seconds.
    - object
      - `extension` 'ANY' | 'EXTENSION_OR_EXTENSION_RANGE' — Filter calls with extension(s) number. Filter can be either: - `ANY`: - `EXTENSION_OR_EXTENSION_RANGE`:
      - `extension_value` string — This attribute must be specified when the `extension` is `EXTENSION_OR_EXTENSION_RANGE`.
      - `type` 'ANY' | 'INTERNAL' | 'EXTERNAL' — Filter whether the call is an internal or external call. Filter can be either: - `ANY`: - `INTERNAL`: - `EXTERNAL`:
    - object
      - `type` 'ANY' | 'LOCAL' | 'NATIONAL' | 'INTERNATIONAL' | 'MOBILE' — Filter calls with type. Filter can be either: - `ANY`: - `LOCAL`: - `NATIONAL`: - `INTERNATIONAL`: - `MOBILE`:
      - `groups` string[] — A collection of extension group names.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `enable_exclude_calls_dropped_before_seconds` boolean — Exclude calls dropped before specified seconds or not.
      - `exclude_calls_dropped_before_seconds` integer — Exclude calls dropped before specified seconds.
      - `call_queues` string[] — A collection of call queue extension numbers.
    - object
      - `ring_groups` string[] — A collection of ring group extension numbers.

## Response `201`

Created

- object
  - `id` string — The unique ID of the resource.

## Other responses

- `4XX` — Error

---

[API](https://skmtc.net/portsip/apis/portsip-pbx-rest-api.md) · [All operations](https://skmtc.net/portsip/apis/portsip-pbx-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portsip/portsip-pbx-rest-api/revisions/577415d4a3d5/schema)
