# Dataflow

Manage Dataflow Functions.

## Get current queue KPI summary

> Retrieve KPI metrics for one or multiple queues within a specified time range.  \
> When multiple queues are specified, the system returns their averaged KPI metrics.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/queues/summary":{"post":{"tags":["Dataflow"],"operationId":"getQueueKpiSummary","summary":"Get current queue KPI summary","description":"Retrieve KPI metrics for one or multiple queues within a specified time range.  \nWhen multiple queues are specified, the system returns their averaged KPI metrics.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queues":{"type":"array","description":"List of queues to calculate KPI metrics for.\n","items":{"type":"object","properties":{"number":{"type":"string","description":"The queue number."},"sla_secs":{"type":"integer","description":"SLA threshold in seconds."}}}},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"metrics":{"type":"object","description":"Queue KPI metrics summary.","properties":{"offered":{"type":"integer","description":"The total number of calls distributed to agents after entering the queue,  \nincluding both answered and unanswered calls.  \nShort-abandoned calls are excluded if short-abandon exclusion is enabled.\n"},"accepted":{"type":"integer","description":"The number of calls that were successfully answered by agents.\n"},"abandoned":{"type":"integer","description":"The number of calls that entered the queue but were abandoned before being answered.  \nExcludes queue callbacks, queue exits, and calls rejected due to queue full.\n"},"sla_pct":{"type":"number","format":"float","description":"The percentage of calls answered within the SLA time threshold.  \nShort-abandoned calls are excluded if short-abandon exclusion is enabled.\n"},"aht_sec":{"type":"integer","description":"Average Handle Time (AHT) in seconds.  \nCalculated as: (Total handling time ÷ Accepted calls).  \nHandling time = Talk time + Wrap-up time.\n"},"att_sec":{"type":"integer","description":"Average Talk Time (ATT) in seconds — the average call duration after being answered.\n"},"avg_wrap_time_sec":{"type":"integer","description":"Average wrap-up time in seconds — the average time agents spend after call completion.\n"},"asa_sec":{"type":"integer","description":"Average Speed of Answer (ASA) in seconds — the average waiting time  \nfrom entering the queue to being answered (only for answered calls).\n"}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get queue call timeseries

> Retrieve call timeseries data for a specific queue within a specified time range.  \
> The data is returned in intervals specified by the \`interval\` field.  \
> Maximum supported time range is 24 hours.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/queues/timeseries":{"post":{"tags":["Dataflow"],"operationId":"getQueueTimeseries","summary":"Get queue call timeseries","description":"Retrieve call timeseries data for a specific queue within a specified time range.  \nThe data is returned in intervals specified by the `interval` field.  \nMaximum supported time range is 24 hours.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"string","description":"Queue number."},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"interval":{"type":"string","description":"Interval for aggregating timeseries points. Supported values:\n1h, 2h, 3h, 4h, 6h, 8h\n"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string","format":"date-time","description":"Timestamp of the timeseries point."},"offered":{"type":"integer","description":"The total number of calls distributed to agents after entering the queue,  \nincluding both answered and unanswered calls.  \nShort-abandoned calls are excluded if short-abandon exclusion is enabled.\n"},"accepted":{"type":"integer","description":"The number of calls that were successfully answered by agents.\n"},"abandoned":{"type":"integer","description":"The number of calls that entered the queue but were abandoned before being answered.  \nExcludes queue callbacks, queue exits, and calls rejected due to queue full.\n"},"asa_sec":{"type":"integer","description":"Average Speed of Answer (ASA) in seconds — the average waiting time  \nfrom entering the queue to being answered (only for answered calls).\n"},"cb_ok":{"type":"integer","description":"Total number of callbacks that successfully connected the customer with an agent."},"cb_fail":{"type":"integer","description":"Percentage of callback interactions that were not completed successfully."}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get agent queue summary

> Retrieve summary metrics for a specific agent in a specific queue within a given time range.  \
> Maximum supported time range is 24 hours.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/queues/agent/summary":{"post":{"tags":["Dataflow"],"operationId":"getAgentQueueSummary","summary":"Get agent queue summary","description":"Retrieve summary metrics for a specific agent in a specific queue within a given time range.  \nMaximum supported time range is 24 hours.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"string","description":"Agent number."},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"points":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of calls received by the agent within the time range.  \nCalls with the same session ID counted only once.\n"},"accepted":{"type":"integer","description":"The number of calls that were successfully answered by agents.\n"},"occupancy_pct":{"type":"number","format":"float","description":"Agent occupancy percentage during the period."},"aht_sec":{"type":"integer","description":"Average Handle Time (AHT) in seconds.  \nCalculated as: (Total handling time ÷ Accepted calls).  \nHandling time = Talk time + Wrap-up time.\n"},"att_sec":{"type":"integer","description":"Average Talk Time (ATT) in seconds — the average call duration after being answered.\n"},"avg_wrap_time_sec":{"type":"integer","description":"Average wrap-up time in seconds — the average time agents spend after call completion.\n"},"average_ring_time_sec":{"type":"integer","description":"Average ring time before the agent answers, in seconds."}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get agent queue timeseries

> Retrieve segmented timeseries metrics for a specific agent in a specific queue within a given time range.\
> The maximum supported time range is \*\*24 hours\*\*.  \
> Returned data is grouped into time intervals defined by the \`interval\` parameter.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/queues/agent/timeseries":{"post":{"tags":["Dataflow"],"operationId":"getAgentQueueTimeseries","summary":"Get agent queue timeseries","description":"Retrieve segmented timeseries metrics for a specific agent in a specific queue within a given time range.\nThe maximum supported time range is **24 hours**.  \nReturned data is grouped into time intervals defined by the `interval` parameter.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"string","description":"Agent number."},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"interval":{"type":"string","description":"Interval for aggregating timeseries points. Supported values:\n1h, 2h, 3h, 4h, 6h, 8h\n"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string","format":"date-time","description":"Timestamp of the timeseries point."},"occupancy_pct":{"type":"number","format":"float","description":"Agent occupancy percentage during the period."},"aht_sec":{"type":"integer","description":"Average Handle Time (AHT) in seconds.  \nCalculated as: (Total handling time ÷ Accepted calls).  \nHandling time = Talk time + Wrap-up time.\n"},"att_sec":{"type":"integer","description":"Average Talk Time (ATT) in seconds — the average call duration after being answered.\n"},"accepted":{"type":"integer","description":"The number of calls that were successfully answered by agents.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get calls timeseries

> Retrieve the call volume time series within a specified time range.\
> \- Supports up to \*\*365 days\*\* range and a minimum of \*\*1 day\*\*.\
> \- If the range is \*\*1 day\*\*, results are grouped hourly (24 intervals).\
> \- If the range is \*\*multiple days\*\*, results are grouped daily.\
> \- Returned data includes total, answered, and not answered call counts.\
> \- Tenant users do not need to specify \`tenants\` and can only query their own data.\
> \- System administrators can specify multiple tenant IDs, or leave \`tenants\` empty to query all tenants.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/analytics/calls/timeseries":{"post":{"tags":["Dataflow"],"operationId":"getCallsTimeseries","summary":"Get calls timeseries","description":"Retrieve the call volume time series within a specified time range.\n- Supports up to **365 days** range and a minimum of **1 day**.\n- If the range is **1 day**, results are grouped hourly (24 intervals).\n- If the range is **multiple days**, results are grouped daily.\n- Returned data includes total, answered, and not answered call counts.\n- Tenant users do not need to specify `tenants` and can only query their own data.\n- System administrators can specify multiple tenant IDs, or leave `tenants` empty to query all tenants.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenants":{"type":"array","description":"Array of tenant IDs.  \n- For tenant users, this field is ignored.  \n- For system administrators, leave empty to query all tenants.\n","items":{"type":"integer"}},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"interval":{"type":"string","description":"Interval for aggregating timeseries points. Supported values:\n1h, 2h, 3h, 4h, 6h, 8h\n"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string","format":"date-time","description":"Timestamp of the timeseries point."},"total":{"type":"integer","description":"Total number of calls received by the agent within the time range.  \nCalls with the same session ID counted only once.\n"},"answered":{"type":"integer","description":"Number of answered calls."},"not_answered":{"type":"integer","description":"Number of not answered calls."}}}}}}}}},"4XX":{"description":"Error response"}}}}}}
```

## Get call history analytics

> Retrieve detailed call history analytics within a specified time range.\
> \- Supports up to \*\*365 days\*\* range.\
> \- Allows filtering by caller (\`from\`), callee (\`to\`), duration, status, and session ID.\
> \- Supports pagination via \`top\` and \`skip\`.\
> \- Time fields (\`start\_time\`, \`end\_time\`, \`start\_hour\_of\_day\`, \`end\_hour\_of\_day\`) must include timezone information (e.g., \`+08:00\`).\
> \- The \`status\` field is an enumeration with possible values: \`NONE\`, \`ANSWERED\`, \`NOT\_ANSWERED\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/analytics/calls/history":{"post":{"tags":["Dataflow"],"operationId":"getCallsHistory","summary":"Get call history analytics","description":"Retrieve detailed call history analytics within a specified time range.\n- Supports up to **365 days** range.\n- Allows filtering by caller (`from`), callee (`to`), duration, status, and session ID.\n- Supports pagination via `top` and `skip`.\n- Time fields (`start_time`, `end_time`, `start_hour_of_day`, `end_hour_of_day`) must include timezone information (e.g., `+08:00`).\n- The `status` field is an enumeration with possible values: `NONE`, `ANSWERED`, `NOT_ANSWERED`.\n","parameters":[{"name":"count","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Use the $count=true query option to include a count of entities that match the filter criteria.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","description":"Caller number."},"to":{"type":"string","description":"Callee number."},"start_duration":{"type":"integer","description":"Call duration from start time in seconds."},"end_duration":{"type":"integer","description":"Call duration until end time in seconds."},"start_hour_of_day":{"type":"integer","description":"Specify the start hour of the call time range (0–23)."},"end_hour_of_day":{"type":"integer","description":"Specify the end hour of the call time range (1–24)."},"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"session_id":{"type":"string","description":"Unique session ID for the call."}},"required":["start_time","end_time"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of records"},"items":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string","description":"Unique session ID for the call."},"caller":{"type":"string","description":"Caller number."},"caller_display_name":{"type":"string","description":"Display name of the caller."},"caller_endpoint":{"type":"string","description":"Caller endpoint type."},"call_id":{"type":"string","description":"Unique call ID."},"service_number":{"type":"string","description":"Service number involved in the call."},"service_name":{"type":"string","description":"Service name."},"service_type":{"type":"string","description":"Type of service."},"callee":{"type":"string","description":"Callee number."},"callee_display_name":{"type":"string","description":"Callee display name."},"callee_endpoint":{"type":"string","description":"Callee endpoint type."},"started_at":{"type":"integer","format":"int64","description":"Call start time in Unix timestamp (seconds)."},"rang_at":{"type":"integer","format":"int64","description":"Ring start time of the call in Unix timestamp (seconds)."},"answered_at":{"type":"integer","format":"int64","description":"Answer time of the call in Unix timestamp (seconds)."},"ended_at":{"type":"integer","format":"int64","description":"Call end time in Unix timestamp (seconds)."},"party":{"type":"string","description":"Call party type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.\n","enum":["NONE","INBOUND","OUTBOUND","INTERNAL","IN_TO_OUT"]},"end_reason":{"type":"string","description":"Call end reason."},"reroute_reason":{"type":"string","description":"Reason why the call was rerouted."},"status_code":{"type":"integer","format":"int32","description":"SIP status code of the call, corresponding to the standard SIP response codes."},"destination":{"type":"string","description":"Actual address of the callee, e.g., \"sip:102@192.168.1.100:9002\"."},"outbound_caller_id":{"type":"string","description":"Outbound caller ID set when initiating an outbound call."},"did":{"type":"string","description":"DID saved when an inbound rule matches successfully."},"call_type":{"type":"string","description":"Type of call."},"callback_id":{"type":"integer","format":"int64","description":"Optional field. Multiple CDRs with the same callback_id belong to the same callback process."},"billing_prefix":{"type":"string","description":"Billing prefix used for cost calculation."},"cost":{"type":"number","format":"float","description":"Cost incurred by the call."},"user_data":{"type":"string","description":"Custom data provided when initiating the call via REST API or client."},"inbound_trunk":{"type":"string","description":"Name of the trunk used for inbound calls."},"outbound_trunk":{"type":"string","description":"Name of the trunk used for outbound calls."}}}}}}}}},"4XX":{"description":"Error response"}}}}}}
```

## Get call User history analytics

> Retrieve detailed call user history analytics within a specified time range.\
> \- Supports up to \*\*365 days\*\* range.\
> \- Allows filtering by caller (\`from\`), callee (\`to\`), duration, status, and session ID.\
> \- Supports pagination via \`top\` and \`skip\`.\
> \- Time fields (\`start\_time\`, \`end\_time\`, \`start\_hour\_of\_day\`, \`end\_hour\_of\_day\`) must include timezone information (e.g., \`+08:00\`).\
> \- The \`status\` field is an enumeration with possible values: \`NONE\`, \`ANSWERED\`, \`NOT\_ANSWERED\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/analytics/calls/user/history":{"post":{"tags":["Dataflow"],"operationId":"getCallsUserHistory","summary":"Get call User history analytics","description":"Retrieve detailed call user history analytics within a specified time range.\n- Supports up to **365 days** range.\n- Allows filtering by caller (`from`), callee (`to`), duration, status, and session ID.\n- Supports pagination via `top` and `skip`.\n- Time fields (`start_time`, `end_time`, `start_hour_of_day`, `end_hour_of_day`) must include timezone information (e.g., `+08:00`).\n- The `status` field is an enumeration with possible values: `NONE`, `ANSWERED`, `NOT_ANSWERED`.\n","parameters":[{"name":"count","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Use the $count=true query option to include a count of entities that match the filter criteria.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_duration":{"type":"integer","description":"Call duration from start time in seconds."},"end_duration":{"type":"integer","description":"Call duration until end time in seconds."},"start_hour_of_day":{"type":"integer","description":"Specify the start hour of the call time range (0–23)."},"end_hour_of_day":{"type":"integer","description":"Specify the end hour of the call time range (1–24)."},"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"user":{"type":"string","description":"User number."},"party":{"type":"string","description":"Call party type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.\n","enum":["NONE","INBOUND","OUTBOUND","INTERNAL","IN_TO_OUT"]},"destination":{"type":"string","description":"Actual address of the callee, e.g., \"sip:102@192.168.1.100:9002\"."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of records"},"items":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string","description":"Unique session ID for the call."},"caller":{"type":"string","description":"Caller number."},"caller_display_name":{"type":"string","description":"Display name of the caller."},"caller_endpoint":{"type":"string","description":"Caller endpoint type."},"call_id":{"type":"string","description":"Unique call ID."},"service_number":{"type":"string","description":"Service number involved in the call."},"service_name":{"type":"string","description":"Service name."},"service_type":{"type":"string","description":"Type of service."},"callee":{"type":"string","description":"Callee number."},"callee_display_name":{"type":"string","description":"Callee display name."},"callee_endpoint":{"type":"string","description":"Callee endpoint type."},"started_at":{"type":"integer","format":"int64","description":"Call start time in Unix timestamp (seconds)."},"rang_at":{"type":"integer","format":"int64","description":"Ring start time of the call in Unix timestamp (seconds)."},"answered_at":{"type":"integer","format":"int64","description":"Answer time of the call in Unix timestamp (seconds)."},"ended_at":{"type":"integer","format":"int64","description":"Call end time in Unix timestamp (seconds)."},"direction":{"type":"string","description":"Call party type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"end_reason":{"type":"string","description":"Call end reason."},"reroute_reason":{"type":"string","description":"Reason why the call was rerouted."},"status_code":{"type":"integer","format":"int32","description":"SIP status code of the call, corresponding to the standard SIP response codes."},"destination":{"type":"string","description":"Actual address of the callee, e.g., \"sip:102@192.168.1.100:9002\"."},"outbound_caller_id":{"type":"string","description":"Outbound caller ID set when initiating an outbound call."},"did":{"type":"string","description":"DID saved when an inbound rule matches successfully."},"call_type":{"type":"string","description":"Type of call."},"callback_id":{"type":"integer","format":"int64","description":"Optional field. Multiple CDRs with the same callback_id belong to the same callback process."},"billing_prefix":{"type":"string","description":"Billing prefix used for cost calculation."},"cost":{"type":"number","format":"float","description":"Cost incurred by the call."},"user_data":{"type":"string","description":"Custom data provided when initiating the call via REST API or client."},"inbound_trunk":{"type":"string","description":"Name of the trunk used for inbound calls."},"outbound_trunk":{"type":"string","description":"Name of the trunk used for outbound calls."}}}}}}}}},"4XX":{"description":"Error response"}}}}}}
```

## Retrieve Call History Details

> Retrieve detailed call history for the specified \`session\_id\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/analytics/calls/history/{session_id}":{"post":{"tags":["Dataflow"],"operationId":"getCallsHistoryBySessionId","summary":"Retrieve Call History Details","description":"Retrieve detailed call history for the specified `session_id`.\n","parameters":[{"name":"session_id","in":"path","required":true,"description":"The session ID of the call to retrieve","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Optional filters or additional request parameters"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string","description":"Unique session ID for the call."},"caller":{"type":"string","description":"Caller number."},"caller_display_name":{"type":"string","description":"Display name of the caller."},"caller_endpoint":{"type":"string","description":"Caller endpoint type."},"call_id":{"type":"string","description":"Unique call ID."},"service_number":{"type":"string","description":"Service number involved in the call."},"service_name":{"type":"string","description":"Service name."},"service_type":{"type":"string","description":"Type of service."},"callee":{"type":"string","description":"Callee number."},"callee_display_name":{"type":"string","description":"Callee display name."},"callee_endpoint":{"type":"string","description":"Callee endpoint type."},"started_at":{"type":"integer","format":"int64","description":"Call start time in Unix timestamp (seconds)."},"rang_at":{"type":"integer","format":"int64","description":"Ring start time of the call in Unix timestamp (seconds)."},"answered_at":{"type":"integer","format":"int64","description":"Answer time of the call in Unix timestamp (seconds)."},"ended_at":{"type":"integer","format":"int64","description":"Call end time in Unix timestamp (seconds)."},"direction":{"type":"string","description":"Call party type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"end_reason":{"type":"string","description":"Call end reason."},"reroute_reason":{"type":"string","description":"Reason why the call was rerouted."},"status_code":{"type":"integer","format":"int32","description":"SIP status code of the call, corresponding to the standard SIP response codes."},"destination":{"type":"string","description":"Actual address of the callee, e.g., \"sip:102@192.168.1.100:9002\"."},"outbound_caller_id":{"type":"string","description":"Outbound caller ID set when initiating an outbound call."},"did":{"type":"string","description":"DID saved when an inbound rule matches successfully."},"call_type":{"type":"string","description":"Type of call."},"callback_id":{"type":"integer","format":"int64","description":"Optional field. Multiple CDRs with the same callback_id belong to the same callback process."},"billing_prefix":{"type":"string","description":"Billing prefix used for cost calculation."},"cost":{"type":"number","format":"float","description":"Cost incurred by the call."},"user_data":{"type":"string","description":"Custom data provided when initiating the call via REST API or client."},"inbound_trunk":{"type":"string","description":"Name of the trunk used for inbound calls."},"outbound_trunk":{"type":"string","description":"Name of the trunk used for outbound calls."}}}}}}}}},"4XX":{"description":"Error response"}}}}}}
```

## Retrieve Call History Details by Session ID

> Query detailed call history for a specific \`session\_id\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/analytics/calls/user/history/{session_id}":{"post":{"tags":["Dataflow"],"operationId":"getUserCallHistoryBySessionId","summary":"Retrieve Call History Details by Session ID","description":"Query detailed call history for a specific `session_id`.\n","parameters":[{"name":"session_id","in":"path","required":true,"description":"The session ID of the call to retrieve.","schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Optional filters or additional request parameters"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string","description":"Unique session ID for the call."},"caller":{"type":"string","description":"Caller number."},"caller_display_name":{"type":"string","description":"Display name of the caller."},"caller_endpoint":{"type":"string","description":"Caller endpoint type."},"call_id":{"type":"string","description":"Unique call ID."},"service_number":{"type":"string","description":"Service number involved in the call."},"service_name":{"type":"string","description":"Service name."},"service_type":{"type":"string","description":"Type of service."},"callee":{"type":"string","description":"Callee number."},"callee_display_name":{"type":"string","description":"Callee display name."},"callee_endpoint":{"type":"string","description":"Callee endpoint type."},"started_at":{"type":"integer","format":"int64","description":"Call start time in Unix timestamp (seconds)."},"rang_at":{"type":"integer","format":"int64","description":"Ring start time of the call in Unix timestamp (seconds)."},"answered_at":{"type":"integer","format":"int64","description":"Answer time of the call in Unix timestamp (seconds)."},"ended_at":{"type":"integer","format":"int64","description":"Call end time in Unix timestamp (seconds)."},"direction":{"type":"string","description":"Call party type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"end_reason":{"type":"string","description":"Call end reason."},"reroute_reason":{"type":"string","description":"Reason why the call was rerouted."},"status_code":{"type":"integer","format":"int32","description":"SIP status code of the call, corresponding to the standard SIP response codes."},"destination":{"type":"string","description":"Actual address of the callee, e.g., \"sip:102@192.168.1.100:9002\"."},"outbound_caller_id":{"type":"string","description":"Outbound caller ID set when initiating an outbound call."},"did":{"type":"string","description":"DID saved when an inbound rule matches successfully."},"call_type":{"type":"string","description":"Type of call."},"callback_id":{"type":"integer","format":"int64","description":"Optional field. Multiple CDRs with the same callback_id belong to the same callback process."},"billing_prefix":{"type":"string","description":"Billing prefix used for cost calculation."},"cost":{"type":"number","format":"float","description":"Cost incurred by the call."},"user_data":{"type":"string","description":"Custom data provided when initiating the call via REST API or client."},"inbound_trunk":{"type":"string","description":"Name of the trunk used for inbound calls."},"outbound_trunk":{"type":"string","description":"Name of the trunk used for outbound calls."}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get Report Job List

> Retrieve the list of scheduled report job.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_jobs":{"get":{"tags":["Dataflow"],"operationId":"getReportList","summary":"Get Report Job List","description":"Retrieve the list of scheduled report job.\n","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"count","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Use the $count=true query option to include a count of entities that match the filter criteria.\n"},{"name":"orderby","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the resource.\n"},"type":{"type":"string","description":"Report type, string enum.","enum":["USERSTATISTICS","DAILYSTATISTICS","CALLLOGS","AGENTDETAILSACTIVITY","AGENTSUMMARYACTIVITY","AGENTNOTREADYCODE","QUEUESUMMARY","AGENTQUEUEREPORT","SPEEDOFACCEPT","ABANDONDELAY","CALLBACKSUMMARY","RINGGROUPPERFORMANCE"]},"format":{"type":"string","description":"Report file format:CSV、HTML","enum":["CSV","HTML"]},"schedule_name":{"type":"string","description":"Report Job name"},"create_time":{"type":"string","format":"date-time","description":"The timestamp when the report log entry was created."},"start_time":{"type":"string","description":"Start time; task will not run before this time"},"end_time":{"type":"string","description":"End time"},"cron_expr":{"type":"string","description":"gocron string, e.g.:\nEvery day at 00:01 = 1 0 * * *\nEvery month on 1st at 02:03 = 3 2 1 * *\nEvery Tuesday at 01:02 = 2 1 * * 2"},"active":{"type":"boolean","description":"Whether the task is active"},"time_zone":{"type":"string","description":"Time zone, e.g., Asia/Shanghai"},"recipients":{"type":"string","description":"Recipient emails; multiple emails separated by semicolon"},"last_run_time":{"type":"string","format":"date-time","description":"The timestamp of the most recent execution of the report job."},"params":{"oneOf":[{"title":"USERSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}},{"type":"object","required":["extension_number"],"properties":{"extension_number":{"type":"string","description":"Extension number"}}}]},{"title":"DAILYSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"CALLLOGS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"AGENTDETAILSACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["agent","queue","channel_type"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."}}}]},{"title":"AGENTSUMMARYACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}}]},{"title":"AGENTNOTREADYCODE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}},{"type":"object","properties":{"reason_code":{"type":"string","description":"Reason code for agent not ready status."}}}]},{"title":"QUEUESUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"object","additionalProperties":{"type":"integer","description":"SLA time for the user (e.g., in seconds)"},"description":"Key-value map where:\n  - **key** is the user number (string),\n  - **value** is the SLA time for that user.\n"}}}]},{"title":"AGENTQUEUEREPORT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"SPEEDOFACCEPT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"ABANDONDELAY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"CALLBACKSUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"RINGGROUPPERFORMANCE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["ring_group"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"}}}]}]}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create Report Job

> Create a new analytics report task.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_jobs":{"post":{"tags":["Dataflow"],"operationId":"createReport","summary":"Create Report Job","description":"Create a new analytics report task.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Report type, string enum.","enum":["USERSTATISTICS","DAILYSTATISTICS","CALLLOGS","AGENTDETAILSACTIVITY","AGENTSUMMARYACTIVITY","AGENTNOTREADYCODE","QUEUESUMMARY","AGENTQUEUEREPORT","SPEEDOFACCEPT","ABANDONDELAY","CALLBACKSUMMARY","RINGGROUPPERFORMANCE"]},"format":{"type":"string","description":"Report file format:CSV、HTML","enum":["CSV","HTML"]},"schedule_name":{"type":"string","description":"Report Job name"},"start_time":{"type":"string","description":"Start time; task will not run before this time"},"end_time":{"type":"string","description":"End time"},"cron_expr":{"type":"string","description":"gocron string, e.g.:\nEvery day at 00:01 = 1 0 * * *\nEvery month on 1st at 02:03 = 3 2 1 * *\nEvery Tuesday at 01:02 = 2 1 * * 2"},"active":{"type":"boolean","description":"Whether the task is active"},"recipients":{"type":"string","description":"Recipient emails; multiple emails separated by semicolon"},"timezone":{"type":"string","description":"Time zone, e.g., Asia/Shanghai"},"params":{"oneOf":[{"title":"USERSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}},{"type":"object","required":["extension_number"],"properties":{"extension_number":{"type":"string","description":"Extension number"}}}]},{"title":"DAILYSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"CALLLOGS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"AGENTDETAILSACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["agent","queue","channel_type"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."}}}]},{"title":"AGENTSUMMARYACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}}]},{"title":"AGENTNOTREADYCODE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}},{"type":"object","properties":{"reason_code":{"type":"string","description":"Reason code for agent not ready status."}}}]},{"title":"QUEUESUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"object","additionalProperties":{"type":"integer","description":"SLA time for the user (e.g., in seconds)"},"description":"Key-value map where:\n  - **key** is the user number (string),\n  - **value** is the SLA time for that user.\n"}}}]},{"title":"AGENTQUEUEREPORT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"SPEEDOFACCEPT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"ABANDONDELAY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"CALLBACKSUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"RINGGROUPPERFORMANCE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["ring_group"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"}}}]}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the resource.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve Report Job Details

> Get detailed information of a report execution job specified by \`id\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_jobs/{id}":{"get":{"tags":["Dataflow"],"operationId":"getReportJobById","summary":"Retrieve Report Job Details","description":"Get detailed information of a report execution job specified by `id`.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Report Job ID","schema":{"type":"string","description":"The unique ID of the resource.\n"}}],"responses":{"200":{"description":"Successful retrieval of the report job details.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the resource.\n"},"type":{"type":"string","description":"Report type, string enum.","enum":["USERSTATISTICS","DAILYSTATISTICS","CALLLOGS","AGENTDETAILSACTIVITY","AGENTSUMMARYACTIVITY","AGENTNOTREADYCODE","QUEUESUMMARY","AGENTQUEUEREPORT","SPEEDOFACCEPT","ABANDONDELAY","CALLBACKSUMMARY","RINGGROUPPERFORMANCE"]},"format":{"type":"string","description":"Report file format:CSV、HTML","enum":["CSV","HTML"]},"schedule_name":{"type":"string","description":"Report Job name"},"start_time":{"type":"string","description":"Start time; task will not run before this time"},"end_time":{"type":"string","description":"End time"},"params":{"oneOf":[{"title":"USERSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}},{"type":"object","required":["extension_number"],"properties":{"extension_number":{"type":"string","description":"Extension number"}}}]},{"title":"DAILYSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"CALLLOGS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"AGENTDETAILSACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["agent","queue","channel_type"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."}}}]},{"title":"AGENTSUMMARYACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}}]},{"title":"AGENTNOTREADYCODE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}},{"type":"object","properties":{"reason_code":{"type":"string","description":"Reason code for agent not ready status."}}}]},{"title":"QUEUESUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"object","additionalProperties":{"type":"integer","description":"SLA time for the user (e.g., in seconds)"},"description":"Key-value map where:\n  - **key** is the user number (string),\n  - **value** is the SLA time for that user.\n"}}}]},{"title":"AGENTQUEUEREPORT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"SPEEDOFACCEPT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"ABANDONDELAY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"CALLBACKSUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"RINGGROUPPERFORMANCE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["ring_group"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"}}}]}]},"cron_expr":{"type":"string","description":"gocron string, e.g.:\nEvery day at 00:01 = 1 0 * * *\nEvery month on 1st at 02:03 = 3 2 1 * *\nEvery Tuesday at 01:02 = 2 1 * * 2"},"recipients":{"type":"string","description":"Recipient emails; multiple emails separated by semicolon"},"active":{"type":"boolean","description":"Whether the task is active"},"time_zone":{"type":"string","description":"Time zone, e.g., Asia/Shanghai"},"last_run_time":{"type":"string","format":"date-time","description":"The timestamp of the most recent execution of the report job."}}}}}},"4XX":{"description":"Invalid input or retrieval failed."}}}}}}
```

## Update Report Job

> Update an existing analytics report Job.\
> \`{id}\` is the report Jon ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_jobs/{id}":{"post":{"tags":["Dataflow"],"operationId":"updateReport","summary":"Update Report Job","description":"Update an existing analytics report Job.\n`{id}` is the report Jon ID.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Report Job ID","schema":{"type":"string","description":"The unique ID of the resource.\n"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Report type, string enum.","enum":["USERSTATISTICS","DAILYSTATISTICS","CALLLOGS","AGENTDETAILSACTIVITY","AGENTSUMMARYACTIVITY","AGENTNOTREADYCODE","QUEUESUMMARY","AGENTQUEUEREPORT","SPEEDOFACCEPT","ABANDONDELAY","CALLBACKSUMMARY","RINGGROUPPERFORMANCE"]},"format":{"type":"string","description":"Report file format:CSV、HTML","enum":["CSV","HTML"]},"schedule_name":{"type":"string","description":"Report Job name"},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"},"cron_expr":{"type":"string","description":"gocron string, e.g.:\nEvery day at 00:01 = 1 0 * * *\nEvery month on 1st at 02:03 = 3 2 1 * *\nEvery Tuesday at 01:02 = 2 1 * * 2"},"active":{"type":"boolean","description":"Whether the task is active"},"recipients":{"type":"string","description":"Recipient emails; multiple emails separated by semicolon"},"time_zone":{"type":"string","description":"Time zone, e.g., Asia/Shanghai"},"params":{"oneOf":[{"title":"USERSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}},{"type":"object","required":["extension_number"],"properties":{"extension_number":{"type":"string","description":"Extension number"}}}]},{"title":"DAILYSTATISTICS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"CALLLOGS","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["status","direction"],"properties":{"status":{"type":"string","description":"Call status.\n","enum":["NONE","ANSWERED","UNANSWERED"]},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","INBOUND","OUTBOUND","INTERNAL"]}}}]},{"title":"AGENTDETAILSACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["agent","queue","channel_type"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."}}}]},{"title":"AGENTSUMMARYACTIVITY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}}]},{"title":"AGENTNOTREADYCODE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["agent"],"properties":{"agent":{"type":"array","items":{"type":"string","description":"Agent number."}}}},{"type":"object","properties":{"reason_code":{"type":"string","description":"Reason code for agent not ready status."}}}]},{"title":"QUEUESUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"object","additionalProperties":{"type":"integer","description":"SLA time for the user (e.g., in seconds)"},"description":"Key-value map where:\n  - **key** is the user number (string),\n  - **value** is the SLA time for that user.\n"}}}]},{"title":"AGENTQUEUEREPORT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"SPEEDOFACCEPT","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"ABANDONDELAY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}},{"type":"object","required":["stx"],"properties":{"stx":{"type":"array","items":{"type":"integer","minimum":1,"maximum":3600},"minItems":10,"maxItems":10,"description":"Accepted Agent ST1–ST10 configuration.\nThis array contains exactly 10 integer values.\nValid range for each value is 1–3600 seconds.\n**Values must be in ascending order (ST1 < ST2 < … < ST10).**\n"}}}]},{"title":"CALLBACKSUMMARY","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["queue"],"properties":{"queue":{"type":"array","items":{"type":"string","description":"Queue number."}}}}]},{"title":"RINGGROUPPERFORMANCE","allOf":[{"type":"object","required":["from","to","time_range"],"properties":{"from":{"type":"string","description":"Start time."},"to":{"type":"string","description":"End time."},"time_range":{"type":"string","description":"Time range preset.","enum":["TODAY","YESTERDAY","LAST_WEEK","LAST_SEVEN_DAYS","LAST_MONTH","LAST_28_DAYS","CUSTOM"]}}},{"type":"object","required":["ring_group"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"}}}]}]}}}}}},"responses":{"200":{"description":"updated successfully."},"4XX":{"description":"Invalid input or update failed."}}}}}}
```

## Delete a Report Job

> Permanently delete the report execution task specified by \`id\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_jobs/{id}/destroy":{"post":{"tags":["Dataflow"],"operationId":"destroyReportJob","summary":"Delete a Report Job","description":"Permanently delete the report execution task specified by `id`.\n","parameters":[{"name":"id","in":"path","required":true,"description":"The unique identifier of the report job to delete.","schema":{"type":"string","description":"The unique ID of the resource.\n"}}],"responses":{"200":{"description":"deleted successfully."},"4XX":{"description":"Invalid input or deleted failed."}}}}}}
```

## Retrieve Report Execution Logs

> Get detailed information of a report execution job specified by \`id\`.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_list":{"get":{"tags":["Dataflow"],"operationId":"listReportLog","summary":"Retrieve Report Execution Logs","description":"Get detailed information of a report execution job specified by `id`.\n","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"count","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Use the $count=true query option to include a count of entities that match the filter criteria.\n"},{"name":"orderby","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the resource.\n"},"report_id":{"type":"string","description":"The unique ID of the resource.\n"},"schedule_name":{"type":"string","description":"Report Job name"},"report_name":{"type":"string","description":"Generated report file name"},"type":{"type":"string","description":"Report type, string enum.","enum":["USERSTATISTICS","DAILYSTATISTICS","CALLLOGS","AGENTDETAILSACTIVITY","AGENTSUMMARYACTIVITY","AGENTNOTREADYCODE","QUEUESUMMARY","AGENTQUEUEREPORT","SPEEDOFACCEPT","ABANDONDELAY","CALLBACKSUMMARY","RINGGROUPPERFORMANCE"]},"format":{"type":"string","description":"Report file format:CSV、HTML","enum":["CSV","HTML"]},"file_url":{"type":"string","description":"URL to download the generated report file."},"create_time":{"type":"string","format":"date-time","description":"The timestamp when the report log entry was created."},"finish_time":{"type":"string","format":"date-time","nullable":true,"description":"The timestamp when the report file generation completed. This value is `null` if the report is still being processed."},"recipients":{"type":"string","description":"Recipient emails; multiple emails separated by semicolon"},"start_time":{"type":"string","format":"date-time","description":"The start time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T00:00:00-04:00).\n"},"end_time":{"type":"string","format":"date-time","description":"The end time of the report period.  \nMust include timezone in RFC3339 format (e.g. 2025-09-28T15:00:00-04:00).\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Delete a report log

> Delete a specific report log entry by its unique identifier.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.4"},"tags":[{"name":"Dataflow","description":"Manage Dataflow Functions.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dataflow/report_list/{id}/destroy":{"post":{"tags":["Dataflow"],"operationId":"deleteReportLog","summary":"Delete a report log","description":"Delete a specific report log entry by its unique identifier.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Unique report log identifier.","schema":{"type":"string","description":"The unique ID of the resource.\n"}}],"responses":{"200":{"description":"deleted successfully."},"4XX":{"description":"Invalid input or deleted failed."}}}}}}
```
