# 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.3"},"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.3"},"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.3"},"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.3"},"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.3"},"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.3"},"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)."},"direction":{"type":"string","description":"Call direction 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"}}}}}}
```

## 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.3"},"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."},"direction":{"type":"string","description":"Call direction type, indicating the routing path of the call.","enum":["NONE","CALLER","CALLEE"]},"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 direction 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.3"},"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 direction 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.3"},"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 direction 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.3"},"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","type":"object","required":["extension_number","status","direction","from","to","time_range"],"properties":{"extension_number":{"type":"string","description":"Extension number"},"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"]},"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"]}}},{"title":"DAILYSTATISTICS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"CALLLOGS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"AGENTDETAILSACTIVITY","type":"object","required":["agent","queue","channel_type","from","to","time_range"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."},"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"]}}},{"title":"AGENTSUMMARYACTIVITY","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"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"]}}},{"title":"AGENTNOTREADYCODE","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"reason_code":{"type":"string","description":"Reason code for agent not ready status."},"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"]}}},{"title":"QUEUESUMMARY","type":"object","required":["queue","from","to","time_range"],"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"},"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"]}}},{"title":"AGENTQUEUEREPORT","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"SPEEDOFACCEPT","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"ABANDONDELAY","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"CALLBACKSUMMARY","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"RINGGROUPPERFORMANCE","type":"object","required":["ring_group","from","to","time_range"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"},"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"]}}}]}}}}}}}}},"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.3"},"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","type":"object","required":["extension_number","status","direction","from","to","time_range"],"properties":{"extension_number":{"type":"string","description":"Extension number"},"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"]},"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"]}}},{"title":"DAILYSTATISTICS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"CALLLOGS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"AGENTDETAILSACTIVITY","type":"object","required":["agent","queue","channel_type","from","to","time_range"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."},"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"]}}},{"title":"AGENTSUMMARYACTIVITY","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"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"]}}},{"title":"AGENTNOTREADYCODE","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"reason_code":{"type":"string","description":"Reason code for agent not ready status."},"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"]}}},{"title":"QUEUESUMMARY","type":"object","required":["queue","from","to","time_range"],"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"},"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"]}}},{"title":"AGENTQUEUEREPORT","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"SPEEDOFACCEPT","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"ABANDONDELAY","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"CALLBACKSUMMARY","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"RINGGROUPPERFORMANCE","type":"object","required":["ring_group","from","to","time_range"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"},"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"]}}}]}}}}}},"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.3"},"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","type":"object","required":["extension_number","status","direction","from","to","time_range"],"properties":{"extension_number":{"type":"string","description":"Extension number"},"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"]},"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"]}}},{"title":"DAILYSTATISTICS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"CALLLOGS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"AGENTDETAILSACTIVITY","type":"object","required":["agent","queue","channel_type","from","to","time_range"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."},"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"]}}},{"title":"AGENTSUMMARYACTIVITY","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"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"]}}},{"title":"AGENTNOTREADYCODE","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"reason_code":{"type":"string","description":"Reason code for agent not ready status."},"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"]}}},{"title":"QUEUESUMMARY","type":"object","required":["queue","from","to","time_range"],"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"},"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"]}}},{"title":"AGENTQUEUEREPORT","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"SPEEDOFACCEPT","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"ABANDONDELAY","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"CALLBACKSUMMARY","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"RINGGROUPPERFORMANCE","type":"object","required":["ring_group","from","to","time_range"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"},"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"]}}}]},"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.3"},"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","type":"object","required":["extension_number","status","direction","from","to","time_range"],"properties":{"extension_number":{"type":"string","description":"Extension number"},"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"]},"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"]}}},{"title":"DAILYSTATISTICS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"CALLLOGS","type":"object","required":["status","direction","from","to","time_range"],"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"]},"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"]}}},{"title":"AGENTDETAILSACTIVITY","type":"object","required":["agent","queue","channel_type","from","to","time_range"],"properties":{"agent":{"type":"string","description":"Agent number."},"queue":{"type":"string","description":"Queue number."},"channel_type":{"type":"string","description":"Channel type for filtering report data."},"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"]}}},{"title":"AGENTSUMMARYACTIVITY","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"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"]}}},{"title":"AGENTNOTREADYCODE","type":"object","required":["queue","agent"],"properties":{"queue":{"type":"string","description":"Queue number."},"agent":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Agent number."}},"reason_code":{"type":"string","description":"Reason code for agent not ready status."},"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"]}}},{"title":"QUEUESUMMARY","type":"object","required":["queue","from","to","time_range"],"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"},"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"]}}},{"title":"AGENTQUEUEREPORT","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"SPEEDOFACCEPT","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"ABANDONDELAY","type":"object","required":["queue","stx","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"},"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"]}}},{"title":"CALLBACKSUMMARY","type":"object","required":["queue","from","to","time_range"],"properties":{"queue":{"type":"array","description":"List of agent identifiers.","items":{"type":"string","description":"Queue number."}},"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"]}}},{"title":"RINGGROUPPERFORMANCE","type":"object","required":["ring_group","from","to","time_range"],"properties":{"ring_group":{"type":"array","items":{"type":"string"},"description":"List of ring groups.\n"},"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"]}}}]}}}}}},"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.3"},"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.3"},"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.3"},"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."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.portsip.com/development-portsip/rest-apis/version-22.3/dataflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
